A mini full-stack Complaint Management System that allows users to submit and track complaints while providing administrators with tools to manage, update, and monitor complaint progress.
| Component | Technology |
|---|---|
| Frontend | HTML, CSS, Vanilla JavaScript |
| Backend | Node.js, Express.js |
| Database | SQLite |
| Authentication | JWT with HTTP-only Cookies |
| Password Security | bcrypt |
Vanilla JavaScript means pure/plain JavaScript without using a frontend framework or library such as React, Angular, or Vue.
- Submit a new complaint
- Automatically generate a unique tracking ID
- Track a complaint using the tracking ID
- View complaint details
- View complaint status and priority
- View assigned department
- View complaint history timeline
- Secure administrator login
- JWT-based authentication using HTTP-only cookies
- View all submitted complaints
- Search complaints
- Filter complaints by:
- Status
- Category
- Priority
- View complete complaint details
- Update complaint status
- Update complaint priority
- Assign complaints to departments
- Add internal notes
- Add resolution notes
- Maintain complaint history
- Dashboard statistics for complaint monitoring
Complaint-Management-System/
│
├── backend/
│ ├── db/
│ │ ├── db.js
│ │ └── seed.js
│ │
│ ├── middleware/
│ │ └── auth.js
│ │
│ ├── routes/
│ │ ├── admin.js
│ │ ├── auth.js
│ │ └── complaints.js
│ │
│ ├── .env.example
│ ├── package.json
│ ├── package-lock.json
│ └── server.js
│
├── frontend/
│ ├── assets/
│ │ ├── css/
│ │ │ └── styles.css
│ │ │
│ │ └── js/
│ │ ├── admin_complaint_detail.js
│ │ ├── admin_dashboard.js
│ │ ├── admin_login.js
│ │ ├── common.js
│ │ ├── complaint_submit.js
│ │ └── track.js
│ │
│ ├── pages/
│ │ ├── admin_complaint_detail.html
│ │ ├── admin_dashboard.html
│ │ ├── admin_login.html
│ │ ├── complaint_submit.html
│ │ └── track.html
│ │
│ └── index.html
│
├── .gitignore
├── README.md
├── start_all.bat
└── start_backend.bat
git clone https://github.com/hashim212-cs/Complaint-Management-System.gitcd Complaint-Management-Systemcd backendnpm installCreate a .env file inside the backend folder using .env.example as a reference.
Example:
PORT=3000
JWT_SECRET=your_secure_jwt_secret_here
DB_PATH=db/cms.sqliteUse a strong and private value for
JWT_SECRETin a real deployment.
npm run seedThis creates the SQLite database and adds the default administrator account.
For normal mode:
npm startFor development mode with automatic restart:
npm run devhttp://localhost:3000
| Field | Value |
|---|---|
| Username | admin |
| Password | admin123 |
These are default demo credentials created by the database seed script. Change them before using the application in a production environment.
| Command | Purpose |
|---|---|
npm start |
Starts the Node.js server |
npm run dev |
Starts the server using Nodemon |
npm run seed |
Creates/initializes the database and default admin |
| Method | Endpoint | Purpose |
|---|---|---|
POST |
/api/complaints |
Submit a new complaint |
GET |
/api/complaints/:trackingId |
Track a complaint |
POST |
/api/auth/login |
Administrator login |
GET |
/api/admin/complaints |
Get complaints for admin |
GET |
/api/admin/complaints/:id |
Get complaint details |
PATCH |
/api/admin/complaints/:id |
Update a complaint |
GET |
/api/health |
Check server health |
The project uses SQLite, a lightweight relational SQL database.
The database contains three main tables:
complaintscomplaint_historyadmins
The actual SQLite database file is excluded from GitHub through .gitignore and can be recreated using:
npm run seedThe application includes:
- Password hashing using bcrypt
- Authentication using JSON Web Tokens (JWT)
- JWT stored inside an HTTP-only cookie
- Protected administrator routes
- Environment variable support for sensitive configuration
This project is designed primarily as an educational/full-stack project. Additional security hardening should be applied before production deployment.
Windows users can use:
start_backend.bat
to start the backend or:
start_all.bat
to start the application and open it in the browser.
User
↓
HTML + CSS + Vanilla JavaScript
↓
Express.js API
↓
Node.js Backend
↓
SQLite Database
Submit Complaint
↓
Generate Tracking ID
↓
Store in SQLite
↓
Admin Reviews Complaint
↓
Update Status / Priority / Department
↓
Create History Record
↓
User Tracks Complaint Progress
Mini Full-Stack Web Application
This project demonstrates the integration of:
- Frontend development
- Backend development
- REST API development
- Database management
- Authentication
- CRUD operations
- Complaint tracking
- Administrative management
Possible future enhancements include:
- User accounts and registration
- Email notifications
- Password change functionality
- Role-based access control
- File/image attachments with complaints
- Advanced analytics dashboard
- Pagination
- Cloud database integration
- Production deployment
This project is currently provided for educational and portfolio purposes.





