A comprehensive full-stack web application for managing hostel room allocations with separate student and admin portals.
- Frontend: https://ap-project-1-a3e5.onrender.com
- Backend API: https://ap-project-v67b.onrender.com
Admin Login Credentials:
- Email:
[email protected] - Password:
admin123
Use these credentials to access the admin panel and test all administrative features including room management, user management, and profile approvals.
Team: Devs
Tech Stack: Node.js + Express + React + Prisma + PostgreSQL
Architecture: Full-stack web application with REST API
AP-PROJECT-/
βββ backend/ # Node.js + Express API
β βββ src/
β β βββ modules/
β β β βββ auth/ # Authentication & Profile Management
β β β βββ rooms/ # Room Management
β β β βββ allotments/ # Room Allocation System
β β β βββ admin/ # Admin Panel Operations
β β βββ middleware/ # JWT Authentication
β β βββ config/ # Database Configuration
β β βββ app.js # Express App
β βββ prisma/ # Database Schema & Migrations
β βββ .env # Environment Variables
β βββ package.json # Dependencies
β βββ server.js # Server Entry Point
β
βββ frontend/ # React Application
β βββ src/
β β βββ components/ # React Components
β β β βββ Dashboard.js # Student Dashboard
β β β βββ AdminDashboard.js # Admin Dashboard
β β β βββ ProfileForm.js # Profile Management
β β β βββ RoomManagement.js # Room CRUD Operations
β β β βββ UserManagement.js # User Administration
β β β βββ ProfileApproval.js # Profile Approval System
β β βββ services/ # API Integration
β β βββ App.js # Main App & Routing
β βββ public/ # Static Assets
β βββ .env # Environment Variables
β βββ package.json # Dependencies
β
βββ .gitignore # Git Ignore Rules
βββ README.md # Project Documentation
- Framework: Node.js + Express.js
- Database: PostgreSQL with Prisma ORM
- Authentication: JWT (JSON Web Tokens)
- API: RESTful endpoints
- Deployment: Render
- Framework: React 18
- Routing: React Router DOM
- Styling: Pure CSS (Black & White Theme)
- HTTP Client: Fetch API
- Deployment: Render Static Site
- Student registration and login
- JWT-based authentication
- Role-based access control (Student/Admin)
- Secure password hashing with bcrypt
- Protected routes and middleware
- Dashboard: Overview with room allocation status
- Profile Management: Complete profile with personal details
- Profile Approval: Submit profile for admin approval
- Room Allocation:
- 1st Year: Automatic random room allocation after profile approval
- 2nd+ Year: Manual room selection from available options
- Application Status: Track profile and room allocation progress
- Room Details: View allocated room and hostel information
- Dashboard: System statistics and overview
- Room Management: Create, update, delete rooms with capacity tracking
- Profile Approval: Review and approve/reject student profiles
- User Management: View all students with profile and room status
- Allocation Monitoring: Track room occupancy and availability
- Real-time Updates: Live room capacity and allocation status
- id (Primary Key)
- name (String)
- email (Unique)
- password (Hashed)
- role (student/admin)
- college (String)
- year (Integer)
- gender (Male/Female)
- profileApproved (Boolean)
- phone (String)
- address (String)
- guardianName (String)
- guardianPhone (String)
- switchCount (Integer)- id (Primary Key)
- roomNumber (Unique)
- capacity (Integer)
- status (Available/Occupied)
- yearGroup (Integer)
- gender (Male/Female)
- hostelName (String)- id (Primary Key)
- studentId (Foreign Key β User)
- roomId (Foreign Key β Room)
- dateOfAllotment (DateTime)
- status (pending/approved/rejected)POST /auth/signup- Register new userPOST /auth/login- User loginGET /auth/my-profile- Get current user profilePUT /auth/profile- Update user profile
GET /rooms/all- List available roomsPOST /allotment/apply/:roomId- Apply for room (2nd+ year)POST /allotment/random-allocate- Random room allocation (1st year)GET /allotment/my- View my allotment
GET /admin/users- Get all usersGET /admin/rooms- Get all rooms with occupancyGET /admin/allotments- Get all allotmentsPOST /rooms/create- Create new roomPUT /rooms/update/:id- Update room detailsDELETE /rooms/delete/:id- Delete roomPOST /auth/approve/:userId- Approve user profilePOST /auth/disapprove/:userId- Reject user profileGET /auth/pending-profiles- Get pending profile approvals
| Member | Module | Responsibility |
|---|---|---|
| Ishita | Authentication | User signup, login, JWT tokens |
| Swarnim | Room Management | CRUD operations for rooms |
| Ansh | Allotment System | Application processing |
| Atharva | Integration | Frontend, API integration, deployment |
- Node.js (v16+)
- PostgreSQL Database
- Git
-
Clone Repository
git clone https://github.com/swarnim02/AP-PROJECT-.git cd AP-PROJECT- -
Setup Backend
cd backend npm install npx prisma db push npm start -
Setup Frontend
cd frontend npm install npm start -
Environment Variables Create
.envin backend folder:DATABASE_URL="postgresql://username:password@localhost:5432/hostel_db" JWT_SECRET="your_jwt_secret_key" PORT=5002
- Register: Create account with college email and basic details
- Login: Access student dashboard
- Complete Profile: Fill personal details, phone, address, guardian info
- Wait for Approval: Admin reviews and approves profile
- Room Allocation:
- 1st Year: Automatic random room allocation after approval
- 2nd+ Year: Browse and manually select from available rooms
- Track Status: Monitor profile approval and room allocation progress
- Login: Use admin credentials provided above
- Profile Management: Review and approve/reject student profiles
- Room Management: Create, update, delete rooms with capacity and gender settings
- User Monitoring: View all students with their profile and room status
- System Overview: Monitor room occupancy and allocation statistics
- Password Hashing: bcrypt encryption
- JWT Authentication: Secure token-based auth
- CORS Protection: Cross-origin request security
- Input Validation: Server-side data validation
- Role-based Access: Admin/student permissions
- Desktop: Full sidebar navigation
- Tablet: Collapsible sidebar
- Mobile: Bottom navigation tabs
- All devices: Touch-friendly interfaces
The application is deployed on Render:
- Frontend: Static site deployment
- Backend: Web service deployment
- Database: PostgreSQL database
For any issues or questions:
- Email: [email protected]
- GitHub: Repository Issues
Β© 2024 Hostel Room Allotment System - Built by Team Devs