Skip to content

Latest commit

 

History

History
160 lines (130 loc) · 5.98 KB

File metadata and controls

160 lines (130 loc) · 5.98 KB

Grievance Feature Implementation Summary

Overview

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.

Features Implemented

1. Backend Implementation

Database Model (/server/models/Grievance.js)

  • Created a comprehensive Grievance schema with fields:
    • menteeId and mentorId (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

API Routes (/server/routes/grievanceRoutes.js)

  • 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)

Dashboard Integration

  • Updated mentee dashboard routes to include grievance statistics
  • Updated mentor dashboard routes to include grievance counts
  • Added real-time notifications via Socket.IO

2. Frontend Implementation

Grievance Page (/client/src/pages/GrievancePage.jsx)

  • 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

Form Fields (As Requested)

  • 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

Dashboard Integration

  • Added Grievance cards to both mentee and mentor dashboards
  • Shows total grievances count and navigation to grievance page
  • Real-time updates of grievance statistics

Navigation

  • Added "Grievances" link to the sidebar navigation
  • Available for both mentors and mentees
  • Uses FileText icon from Lucide React

3. User Interface Features

For Mentees:

  • Submit new grievances with comprehensive form
  • Track status of submitted grievances
  • View detailed history and responses
  • Filter and search through grievances

For Mentors:

  • Review grievances from their mentees
  • Mark grievances as "in-review"
  • Resolve grievances with resolution comments
  • Reject grievances with reason
  • Filter by status

Visual Design:

  • 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

4. System Integration

Real-time Features:

  • Socket.IO notifications for status updates
  • Live updates when mentors review/resolve grievances
  • Instant feedback to users

Security:

  • Role-based access control
  • Authentication required for all operations
  • Data validation on both client and server
  • Proper error handling

Database:

  • MongoDB integration with existing database
  • Proper indexing and relationships
  • Error handling and retry mechanisms

File Structure

Server Files Created/Modified:

  • 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 Files Created/Modified:

  • 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)

Usage Instructions

For Mentees:

  1. Navigate to "Grievances" in the sidebar
  2. Click "Submit Grievance" button
  3. Fill out the form with incident details
  4. Submit and track status in the grievances list

For Mentors:

  1. View grievances from mentees in the Grievances section
  2. Use action buttons to review, resolve, or reject grievances
  3. Add comments and resolution details as needed
  4. Track all grievances with filtering options

API Endpoints Summary

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

Status Workflow

  1. Pending - Newly submitted grievance
  2. In-Review - Mentor has acknowledged and is reviewing
  3. Resolved - Issue has been resolved with resolution details
  4. 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.