A modern, full-stack web application for efficient complaint management in hostel environments. Built with React, TypeScript, Node.js, and MongoDB, featuring role-based access control and real-time complaint tracking.
- Multi-Role Dashboard System: Separate interfaces for Students, Wardens, and Maintenance Staff
- Real-time Complaint Tracking: Live status updates from submission to resolution
- Building-wise Management: Organized complaint handling across hostel buildings (BH1, BH2, BH3, BH4, GH)
- Professional Assignment: Complaint filtering based on maintenance specialization (Electrician, AC Duct, LAN, Carpenter)
- Time-based Auto-cleanup: Resolved complaints automatically hide after midnight to keep dashboards clean
- Glass-morphism Design: Premium, modern interface with backdrop-blur effects
- Responsive Layout: Mobile-first design that works on all devices
- Gradient Accents: Beautiful color schemes with animated backgrounds
- Component-based Architecture: Reusable UI components built with Radix UI
- Student Portal: Submit complaints, track progress, view personal complaint history
- Warden Dashboard: Manage building-specific complaints, view pending and resolved complaints
- Maintenance Interface: View assigned tasks filtered by profession, update complaint status
- Statistics Overview: Real-time complaint counts by status
- Quick Actions: One-click complaint submission and status updates
- Filtered Views: Complaints organized by status (Pending, Resolved)
- Building Filters: Switch between different hostel buildings
- Node.js (v16 or higher)
- MongoDB (v4.4 or higher)
- npm package manager
-
Clone the repository
git clone https://github.com/techvoyager-varun/Lnmiit-Complaint-Box.git cd Lnmiit-Complaint-Box -
Backend Setup
cd backend npm install # Create environment file cp .env.example .env # Edit .env with your MongoDB connection string and JWT secret # Start the backend server npm run dev
-
Frontend Setup
cd frontend npm install # Start the development server npm run dev
Create a .env file in the backend directory:
PORT=5000
MONGODB_URI="mongodb+srv://<USERNAME>:<PASSWORD>@cluster0.mongodb.net/lnmiit_complaint_box"
JWT_SECRET=your-super-secret-jwt-key
FRONTEND_URL=xxxx- Submit new complaints with title, description, and category
- View personal complaint history
- Track complaint status (Pending → Assigned → Resolved)
- Update complaint status (mark as resolved/not-resolved)
- View all complaints for assigned building(s)
- Switch between different buildings (BH1, BH2, BH3, BH4, GH)
- View complaints by status (Pending, Resolved)
- Update complaint status and mark as resolved
- Manual refresh to get latest complaint updates
- View complaints filtered by profession (Electrician, AC Duct, LAN, Carpenter)
- Filter complaints by building
- Update complaint status from pending to resolved
- Only see complaints relevant to their specialization
Lnmiit-Complaint-Box/
├── frontend/ # React TypeScript frontend
│ ├── src/
│ │ ├── components/ # Reusable UI components
│ │ │ ├── auth/ # Login and signup forms
│ │ │ ├── complaints/ # Complaint card and form components
│ │ │ ├── dashboard/ # Dashboard widgets (StatCard, QuickAction, etc.)
│ │ │ ├── layout/ # Header, Sidebar, DashboardLayout
│ │ │ └── ui/ # Base UI components (Radix UI)
│ │ ├── contexts/ # AuthContext for user management
│ │ ├── hooks/ # useMidnightRefresh for auto-cleanup
│ │ ├── lib/ # API functions and utility helpers
│ │ ├── pages/ # Page components (Dashboards, Login, etc.)
│ │ └── types/ # TypeScript type definitions
│ └── package.json
│
├── backend/ # Node.js Express backend
│ ├── src/
│ │ ├── config/ # Database configuration
│ │ ├── controllers/ # Request handlers (auth, complaints)
│ │ ├── middleware/ # Authentication and error handling
│ │ ├── models/ # MongoDB schemas (User, Complaint)
│ │ └── routes/ # API route definitions
│ └── package.json
│
└── README.md # This file
- Resolved complaints automatically disappear from dashboards after midnight
- Only affects complaints with status "resolved"
- Pending and in-progress complaints remain visible until resolved
- Automatic UI refresh at midnight using
useMidnightRefreshhook
Pending (open) → Assigned (in_progress) → Resolved (resolved)
- Students can submit complaints (status: "pending")
- Wardens and maintenance staff can update status to "resolved"
- Clear status progression with role-based permissions
- BH1-BH4: Boys' hostels
- GH: Girls' hostel
- Building-specific complaint filtering
- Wardens can be assigned to specific buildings
POST /api/auth/register # User registration
POST /api/auth/login # User login
GET /api/auth/me # Get current user profile
GET /api/complaints # List all complaints (admin/warden/maintenance)
POST /api/complaints # Create new complaint (student)
GET /api/complaints/my # Get user's own complaints (student)
PUT /api/complaints/:id # Update complaint status
- JWT Authentication: Secure token-based authentication
- Password Hashing: Bcrypt with secure salt rounds
- Input Validation: Zod schema validation for all requests
- CORS Protection: Configured cross-origin policies
- Role-based Access: Different permissions for each user role
# Backend (Terminal 1)
cd backend
npm run dev
# Frontend (Terminal 2)
cd frontend
npm run devMade with ❤️ for LNMIIT Community