A comprehensive web application for managing hostel operations, built with the MERN stack.
- User Registration & Authentication - Multi-step registration with email verification
- Room Management - Browse, book, and manage room allocations
- Payment Integration - Secure online payments via Razorpay
- Complaint System - Submit and track maintenance requests
- Visitor Management - Register and manage visitor entries
- Real-time Notifications - Get instant updates via Socket.io
- Comprehensive Dashboard - Real-time analytics and insights
- User Management - Manage students, wardens, and admin accounts
- Room Administration - Create, update, and monitor room availability
- Payment Tracking - Monitor all transactions and pending payments
- Complaint Resolution - Assign, track, and resolve maintenance issues
- Visitor Oversight - Approve/reject visitor requests
- Email Notifications - Automated welcome emails and updates
- JWT Authentication - Secure token-based authentication
- Role-based Access Control - Admin, Warden, and Student roles
- Password Hashing - Bcrypt encryption for passwords
- Input Validation - Comprehensive form validation
- File Upload Security - Secure image uploads via Cloudinary
- React 18 - Modern React with hooks
- Material-UI (MUI) - Professional UI components
- Framer Motion - Smooth animations
- Axios - HTTP client for API calls
- React Router - Client-side routing
- Socket.io Client - Real-time communication
- Node.js - JavaScript runtime
- Express.js - Web framework
- MongoDB - NoSQL database
- Mongoose - MongoDB object modeling
- Socket.io - Real-time communication
- JWT - JSON Web Tokens for authentication
- Nodemailer - Email sending
- Multer - File upload handling
- Cloudinary - Image storage and management
- React Admin Panel - Separate admin interface
- Advanced Analytics - Dashboard with charts and statistics
- Hardcoded Admin Access - Secure admin authentication
smart-hostel-management/
βββ frontend/ # React frontend application
β βββ src/
β β βββ components/ # Reusable components
β β βββ pages/ # Page components
β β βββ context/ # React context providers
β β βββ services/ # API services
β β βββ utils/ # Utility functions
β βββ package.json
βββ backend/ # Node.js backend API
β βββ routes/ # API routes
β βββ models/ # Database models
β βββ middleware/ # Custom middleware
β βββ services/ # Business logic services
β βββ config/ # Configuration files
β βββ package.json
βββ admin/ # Admin panel application
β βββ src/
β β βββ components/ # Admin components
β β βββ pages/ # Admin pages
β β βββ services/ # Admin API services
β βββ package.json
βββ README.md
- Node.js (v16 or higher)
- MongoDB (local or cloud)
- Git
git clone https://github.com/yourusername/smart-hostel-management.git
cd smart-hostel-managementcd backend
npm install
cp .env.example .env
# Edit .env with your configuration
npm run devcd frontend
npm install
npm run devcd admin
npm install
npm run devCreate a .env file in the backend directory:
NODE_ENV=development
PORT=5000
MONGODB_URI=mongodb://localhost:27017/shms
JWT_SECRET=your_jwt_secret_key
CLIENT_URL=http://localhost:3000
CLOUDINARY_CLOUD_NAME=your_cloudinary_name
CLOUDINARY_API_KEY=your_cloudinary_key
CLOUDINARY_API_SECRET=your_cloudinary_secret
RAZORPAY_KEY_ID=your_razorpay_key
RAZORPAY_KEY_SECRET=your_razorpay_secret
EMAIL_USER=your_email@gmail.com
EMAIL_PASS=your_app_password
EMAIL_FROM=noreply@smarthostel.com- Email: admin@shms.com
- Password: admin123456
- Email: warden@shms.com
- Password: warden123456
Students can register through the frontend application with:
- Personal information
- Emergency contact details
- Address information
- Profile picture upload
POST /api/auth/register- User registrationPOST /api/auth/login- User loginGET /api/auth/me- Get current userPOST /api/auth/forgot-password- Password reset request
GET /api/users- Get all users (Admin/Warden)GET /api/users/:id- Get specific userPUT /api/users/:id- Update user profileDELETE /api/users/:id- Delete user (Admin)
GET /api/rooms- Get all roomsPOST /api/rooms- Create room (Admin)PUT /api/rooms/:id- Update roomPOST /api/rooms/:id/book- Book room
GET /api/payments- Get paymentsPOST /api/payments- Create paymentPOST /api/payments/verify- Verify Razorpay payment
GET /api/complaints- Get complaintsPOST /api/complaints- Create complaintPUT /api/complaints/:id- Update complaintPOST /api/complaints/:id/resolve- Resolve complaint
# Backend
cd backend && npm run dev
# Frontend
cd frontend && npm run dev
# Admin Panel
cd admin && npm run dev# Frontend
cd frontend && npm run build
# Admin Panel
cd admin && npm run build- Real-time occupancy tracking
- Payment status monitoring
- Complaint resolution metrics
- User activity insights
- Welcome emails for new users
- Password reset notifications
- Complaint status updates
- Payment reminders
- Profile picture uploads
- Document storage
- Cloudinary integration
- Secure file handling
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Sudhanshu Ravindra Sakhare - Initial work - YourGitHub
- Material-UI for the beautiful components
- MongoDB for the robust database
- Cloudinary for image management
- Razorpay for payment processing
- Socket.io for real-time features
For support, email sudhanshusakhare808@gmail.com or create an issue in this repository.
β If you found this project helpful, please give it a star!



