A comprehensive full-stack web platform designed to digitize and streamline hostel facility management. It replaces informal complaint methods with a structured, accountable, and traceable digital system.
The Smart Hostel Management System enables students to report issues, track status in real-time, and receive updates on announcements. Management can view all issues, assign tasks to staff, generate reports, and post announcements.
- Framework: Next.js 16 (React 19)
- Language: TypeScript
- Styling: Tailwind CSS
- State Management: Zustand
- Data Fetching: TanStack Query
- Forms: React Hook Form + Zod
- UI Components: Radix UI
- Real-time: Socket.io Client
- Runtime: Node.js
- Framework: Express.js
- Language: TypeScript
- Database: PostgreSQL with Prisma ORM
- Cache: Redis
- Authentication: Passport.js (Local + Google OAuth)
- File Storage: Cloudinary
- Real-time: Socket.io
- Validation: Zod
- User registration and authentication
- Role-based access control (Student, Staff, Management)
- Profile management
- Password reset functionality
- Create, view, and track issues
- Image and document attachments
- Status updates and tracking
- Priority-based handling
- Category-based organization
- Create and manage announcements
- Target-specific hostels, blocks, and roles
- Priority announcements
- Mark as read tracking
- Report lost items
- Claim found items
- Verification process
- Status tracking
- Issue statistics and trends
- Category-wise breakdown
- Resolution time metrics
- Visual dashboards
- Real-time notifications
- Email notifications
- In-app notification center
├── hostel-backend/ # Backend API server
│ ├── src/
│ │ ├── config/ # Configuration files
│ │ ├── modules/ # Feature modules
│ │ │ ├── auth/ # Authentication
│ │ │ ├── issues/ # Issue management
│ │ │ ├── announcements/ # Announcements
│ │ │ ├── lost-found/ # Lost & Found
│ │ │ ├── notifications/ # Notifications
│ │ │ └── analytics/ # Analytics
│ │ └── shared/ # Shared utilities
│ └── prisma/ # Database schema
│
├── hostel-frontend/ # Next.js frontend
│ ├── src/
│ │ ├── app/ # Next.js App Router pages
│ │ ├── components/ # Reusable components
│ │ ├── store/ # Zustand stores
│ │ ├── lib/ # Utilities
│ │ └── types/ # TypeScript types
│
└── README.md # This file
- Node.js 20+
- PostgreSQL 15+
- Redis 7+
cd hostel-backend
# Install dependencies
npm install
# Copy environment file
cp .env.example .env
# Edit .env with your database and service credentials
# Generate Prisma client
npm run prisma:generate
# Run database migrations
npm run prisma:migrate
# Start development server
npm run devBackend runs on http://localhost:5000
cd hostel-frontend
# Install dependencies
npm install
# Copy environment file
cp .env.local.example .env.local
# Edit .env.local with your API URL
# Start development server
npm run devFrontend runs on http://localhost:3000
NODE_ENV=development
PORT=5000
DATABASE_URL=postgresql://user:password@localhost:5432/hostel
REDIS_URL=redis://localhost:6379
JWT_SECRET=your-secret-key
CLOUDINARY_CLOUD_NAME=xxx
CLOUDINARY_API_KEY=xxx
CLOUDINARY_API_SECRET=xxx
GOOGLE_CLIENT_ID=xxx
GOOGLE_CLIENT_SECRET=xxx
FRONTEND_URL=http://localhost:3000
EMAIL_HOST=smtp.gmail.com
EMAIL_PORT=587
EMAIL_USER=xxx
EMAIL_PASS=xxx
NEXT_PUBLIC_API_URL=http://localhost:5000/api/v1
NEXT_PUBLIC_SOCKET_URL=http://localhost:5000
NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME=xxx
| Command | Description |
|---|---|
npm run dev |
Start development server |
npm run build |
Build for production |
npm run start |
Start production server |
npm run prisma:generate |
Generate Prisma client |
npm run prisma:migrate |
Run database migrations |
npm run typecheck |
Check TypeScript |
| Command | Description |
|---|---|
npm run dev |
Start development server |
npm run build |
Build for production |
npm run start |
Start production server |
npm run lint |
Run ESLint |
POST /api/v1/auth/register- User registrationPOST /api/v1/auth/login- User loginPOST /api/v1/auth/logout- User logoutGET /api/v1/auth/google- Google OAuthPOST /api/v1/auth/forgot-password- Request password resetPOST /api/v1/auth/reset-password- Reset password
GET /api/v1/issues- List issuesPOST /api/v1/issues- Create issueGET /api/v1/issues/:id- Get issue detailsPATCH /api/v1/issues/:id- Update issuePATCH /api/v1/issues/:id/status- Update issue statusDELETE /api/v1/issues/:id- Delete issue
GET /api/v1/announcements- List announcementsPOST /api/v1/announcements- Create announcementGET /api/v1/announcements/:id- Get announcementPATCH /api/v1/announcements/:id- Update announcementDELETE /api/v1/announcements/:id- Delete announcement
GET /api/v1/lost-found- List itemsPOST /api/v1/lost-found- Report lost/found itemGET /api/v1/lost-found/:id- Get item detailsPATCH /api/v1/lost-found/:id- Update itemPOST /api/v1/lost-found/:id/claim- Claim item
GET /api/v1/analytics/issues- Issue analyticsGET /api/v1/analytics/dashboard- Dashboard stats
GET /api/v1/notifications- Get notificationsPATCH /api/v1/notifications/:id/read- Mark as readDELETE /api/v1/notifications/read-all- Mark all as read
| Role | Description |
|---|---|
| STUDENT | Can report issues, view announcements |
| STAFF | Can view and resolve assigned issues |
| MANAGEMENT | Full access to all features |
ISC