How dsingh0304/hostleseatallocation works
ResidentIQ is a role-based hostel allocation platform. Students authenticate and complete onboarding, browse eligibility and availability, then book rooms or coordinate roommate invites; administrators manage hostels, students, allocation windows and exceptions, and review reports. The Next.js pages call a REST API, whose Express routes dispatch to feature controllers and allocation logic backed by Prisma/PostgreSQL. Auth, audit and rate-limit middleware support the API, while the server synchronizes window state and starts an email worker. Some README capabilities lack sampled implementation excerpts, so those are represented at documented subsystem level only.
Main entry points: app.ts Express API · allocation.routes.ts Booking routes · prisma.ts PostgreSQL access · auth.routes.ts Auth routes
Components 26
Web client
- Student dashboard
client/app/dashboard/student/page.tsx - Admin dashboard
client/app/dashboard/admin/page.tsx - Admin tools
client/app/dashboard/admin/components - API client
client/app/lib/api.ts - Auth state
client/app/store/authStore.ts
API and access
- Express API
server/src/app.ts - Auth routes
server/src/modules/auth/auth.routes.ts - Auth workflows
server/src/modules/auth/auth.controller.ts - Token and password service
server/src/modules/auth/auth.service.ts - Authentication and roles
server/src/middleware/auth.middleware.ts - Rate limiting
server/src/middleware/rateLimiter.middleware.ts - Audit logging
server/src/middleware/auditLog.middleware.ts - Error handling
server/src/middleware/errorHandler.middleware.ts
Allocation operations
- Admin routes
server/src/modules/admin/admin.routes.ts - Admin management
server/src/modules/admin/admin.controller.ts - Student routes
server/src/modules/student/student.routes.ts - Student services
server/src/modules/student/student.controller.ts - Booking routes
server/src/modules/allocation/allocation.routes.ts - Booking controller
server/src/modules/allocation/allocation.controller.ts - Booking logic
server/src/modules/allocation/allocation.service.ts
Runtime services
- PostgreSQL access
server/src/lib/prisma.ts - Redis
server/src/lib/redis.ts - Email worker
server/src/workers/email.worker.ts - Logger
server/src/lib/logger.ts
Other components
- Student
- Admin or warden
Connections 34
- Student → Student dashboard: uses
- Admin or warden → Admin dashboard: uses
- Student dashboard → API client: calls
client/app/dashboard/student/page.tsx - Admin dashboard → Admin tools: renders
client/app/dashboard/admin/page.tsx - Admin tools → API client: calls
client/app/dashboard/admin/components/AllocateTab.tsx - Student dashboard → Auth state: reads
client/app/dashboard/student/page.tsx - Admin dashboard → Auth state: reads
client/app/dashboard/admin/page.tsx - API client → Express API: calls REST
- Express API → Auth routes: mounts
server/src/app.ts - Express API → Booking routes: mounts
server/src/app.ts - Express API → Admin routes: mounts
server/src/app.ts - Express API → Student routes: mounts
server/src/app.ts - Auth routes → Auth workflows: dispatches
server/src/modules/auth/auth.routes.ts - Auth routes → Rate limiting: applies
server/src/modules/auth/auth.routes.ts - Auth routes → Authentication and roles: applies
server/src/modules/auth/auth.routes.ts - Auth workflows → Token and password service: uses
server/src/modules/auth/auth.controller.ts - Auth workflows → PostgreSQL access: reads/writes
server/src/modules/auth/auth.controller.ts - Token and password service → Redis: uses
server/src/modules/auth/auth.service.ts - Admin routes → Admin management: dispatches
server/src/modules/admin/admin.routes.ts - Admin routes → Authentication and roles: applies
server/src/modules/admin/admin.routes.ts - Admin management → PostgreSQL access: reads/writes
server/src/modules/admin/admin.controller.ts - Student routes → Student services: dispatches
server/src/modules/student/student.routes.ts - Student routes → Authentication and roles: applies
server/src/modules/student/student.routes.ts - Student services → PostgreSQL access: reads/writes
server/src/modules/student/student.controller.ts - Booking routes → Booking controller: dispatches
server/src/modules/allocation/allocation.routes.ts - Booking routes → Authentication and roles: applies
server/src/modules/allocation/allocation.routes.ts - Booking routes → Audit logging: applies
server/src/modules/allocation/allocation.routes.ts - Booking routes → Rate limiting: applies
server/src/modules/allocation/allocation.routes.ts - Booking controller → Booking logic: calls
server/src/modules/allocation/allocation.controller.ts - Booking logic → PostgreSQL access: reads/writes
server/src/modules/allocation/allocation.service.ts - Booking logic → Redis: uses
server/src/modules/allocation/allocation.service.ts - Express API → PostgreSQL access: syncs windows
server/src/app.ts - Express API → Email worker: starts
server/src/app.ts - Error handling → Logger: logs errors
server/src/middleware/errorHandler.middleware.ts