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:
admin@hostel.com - 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: support@hostelsystem.com
- GitHub: Repository Issues
© 2024 Hostel Room Allotment System - Built by Team Devs