This is a demo for kwasu complaint system
# KWASU Automated Complaint Management System
A web-based system for Kwara State University that lets students submit
complaints online, automatically classifies them with machine learning,
flags abusive language for human review, and gives administrators a
dashboard to verify students and manage complaints.
> **Categories:** This build classifies complaints into **two** categories —
> **Academic** and **Administrative** — because the provided dataset only
> contains those two labels. (The original brief listed four; Facility and
> Finance are not present in the data and cannot be predicted. See
> `ml_training/training_results.txt`.)
---
## Tech stack
| Layer | Technology |
|--------------|----------------------------------------------|
| Frontend | React (Vite) |
| Backend | Python + Flask (REST API) |
| Database | MySQL (SQLAlchemy ORM) |
| ML | scikit-learn (Naïve Bayes + SVM, TF-IDF) |
| Auth | JWT (login with email **or** matric number) |
| Hosting | Vercel (frontend) · Render (backend) · Railway/PlanetScale (MySQL) |
---
## Features
**Students**
- Sign up with email + matric number + password; log in with **either** email or matric number
- Complete a profile (name, matric, department, level) that an admin must verify
- Editing the profile resets it to *pending* and requires re-approval
- View the complaint feed; verified students can submit complaints and comment
- Track personal complaint status and admin responses
**Automatic processing on submit**
1. Abuse detection runs first (profanity wordlist + regex). If flagged → flagged queue, **not** published, **not** classified.
2. If clean → preprocessing → TF-IDF → chi-square feature selection → ML classification → stored as *Pending* and published to the feed.
**Admins** (two dashboard sections)
- **Profile Management:** approve / reject (with rea …