I have successfully implemented a comprehensive Grievance system for the MMSpace mentee-mentor platform. This feature allows mentees to submit grievances and mentors to review and manage them, similar to the existing leave request system.
- Created a comprehensive Grievance schema with fields:
menteeIdandmentorId(references)name,email,rollNo(user information)subject(grievance title)grievanceType(categorized dropdown options)description(detailed description)dateOfIncident(when the incident occurred)status(pending, in-review, resolved, rejected)mentorComments,adminComments,resolution- Timestamps for tracking creation, review, and resolution
- POST
/api/grievances- Submit new grievance (mentee only) - GET
/api/grievances/mentee- Get mentee's grievances - GET
/api/grievances/mentor- Get mentor's mentees' grievances - GET
/api/grievances/admin- Get all grievances (admin only) - PUT
/api/grievances/:id/review- Review grievance (mentor/admin) - PUT
/api/grievances/:id/resolve- Resolve grievance (mentor/admin) - PUT
/api/grievances/:id/reject- Reject grievance (mentor/admin)
- Updated mentee dashboard routes to include grievance statistics
- Updated mentor dashboard routes to include grievance counts
- Added real-time notifications via Socket.IO
- Complete grievance management interface with:
- Submit new grievance form with all required fields
- Filter grievances by status (all, pending, in-review, resolved, rejected)
- View detailed grievance information in modal
- Mentor actions (review, resolve, reject)
- Status and priority indicators
- Responsive design with beautiful UI
- Name - Text (auto-filled if logged in)
- Email / Roll No / ID - Text
- Subject / Title - Text
- Grievance Type - Dropdown with categories:
- Misconduct / Complaint
- User Experience
- Billing / Payment
- Communication & Support
- Administrative Issues
- Technical Issues
- Other
- Date of Incident - Date picker
- Description - Textarea for detailed description
- Added Grievance cards to both mentee and mentor dashboards
- Shows total grievances count and navigation to grievance page
- Real-time updates of grievance statistics
- Added "Grievances" link to the sidebar navigation
- Available for both mentors and mentees
- Uses FileText icon from Lucide React
- Submit new grievances with comprehensive form
- Track status of submitted grievances
- View detailed history and responses
- Filter and search through grievances
- Review grievances from their mentees
- Mark grievances as "in-review"
- Resolve grievances with resolution comments
- Reject grievances with reason
- Filter by status
- Consistent with existing MMSpace design language
- Glassmorphism effects and modern UI components
- Color-coded status indicators
- Responsive layout for all devices
- Smooth animations and transitions
- Socket.IO notifications for status updates
- Live updates when mentors review/resolve grievances
- Instant feedback to users
- Role-based access control
- Authentication required for all operations
- Data validation on both client and server
- Proper error handling
- MongoDB integration with existing database
- Proper indexing and relationships
- Error handling and retry mechanisms
server/models/Grievance.js(NEW)server/routes/grievanceRoutes.js(NEW)server/server.js(MODIFIED - added route)server/routes/menteeRoutes.js(MODIFIED - added grievance stats)server/routes/mentorRoutes.js(MODIFIED - added grievance stats)
client/src/pages/GrievancePage.jsx(NEW)client/src/App.jsx(MODIFIED - added route)client/src/components/Layout.jsx(MODIFIED - added navigation)client/src/pages/DashboardPage.jsx(MODIFIED - added grievance cards)
- Navigate to "Grievances" in the sidebar
- Click "Submit Grievance" button
- Fill out the form with incident details
- Submit and track status in the grievances list
- View grievances from mentees in the Grievances section
- Use action buttons to review, resolve, or reject grievances
- Add comments and resolution details as needed
- Track all grievances with filtering options
| Method | Endpoint | Description | Access |
|---|---|---|---|
| POST | /api/grievances |
Submit grievance | Mentee |
| GET | /api/grievances/mentee |
Get mentee grievances | Mentee |
| GET | /api/grievances/mentor |
Get mentor grievances | Mentor |
| GET | /api/grievances/admin |
Get all grievances | Admin |
| PUT | /api/grievances/:id/review |
Review grievance | Mentor/Admin |
| PUT | /api/grievances/:id/resolve |
Resolve grievance | Mentor/Admin |
| PUT | /api/grievances/:id/reject |
Reject grievance | Mentor/Admin |
- Pending - Newly submitted grievance
- In-Review - Mentor has acknowledged and is reviewing
- Resolved - Issue has been resolved with resolution details
- Rejected - Grievance rejected with reason
The implementation is now complete and ready for use! Both the server (port 5000) and client (port 5174) are running successfully.