How avanibhide30/se-project-hms works
This is a role-based hostel management system: students apply for accommodation and manage rooms, fees, visitors, curfew, and leave; staff administer applications, allocations, accounts, security operations, notices, and reports. The frontend routes users to student or staff pages, makes authenticated API requests, and the Express backend dispatches those requests to domain routes backed by Prisma. The source index documents route registration and several route-to-storage dependencies; detailed calls within unsampled route modules are not asserted.
Main entry points: index.ts Express API · prisma.ts Prisma data access · App.tsx Role-based pages · auth.ts Authentication and roles
Components 24
Web application
- Role-based pages
frontend/src/App.tsx - Session context
frontend/src/context/AuthContext.tsx - Student services
frontend/src/pages/student - Staff portal
frontend/src/pages/staff/StaffPages.tsx - API client
frontend/src/services/api.ts
API and access
- Express API
backend/src/index.ts - Authentication and roles
backend/src/middleware/auth.ts - Login and identity
backend/src/routes/auth.ts - Administration
backend/src/routes/admin.ts - Reports
backend/src/routes/reports.ts - Audit logging
backend/src/middleware/audit.ts - Prisma data access
backend/src/prisma.ts - Application database
Residence operations
- Applications
backend/src/routes/applications.ts - Rooms
backend/src/routes/rooms.ts - Bed allocations
backend/src/routes/allocations.ts
Campus services
- Fees
backend/src/routes/fees.ts - Payments
backend/src/routes/payments.ts - Visitors
backend/src/routes/visitors.ts - Curfew
backend/src/routes/curfew.ts - Outpasses and leave
backend/src/routes/outpasses.ts - Notices
backend/src/routes/notices.ts - Notifications
backend/src/routes/notifications.ts
Other components
- Student or staff
Connections 35
- Student or staff → Role-based pages: uses
frontend/src/App.tsx - Role-based pages → Session context: checks session
frontend/src/App.tsx - Role-based pages → Student services: routes students
frontend/src/App.tsx - Role-based pages → Staff portal: routes staff
frontend/src/App.tsx - Student services → API client: requests data
frontend/src/pages/student/ApplicationPage.tsx - Staff portal → API client: requests data
frontend/src/pages/staff/StaffPages.tsx - Session context → API client: authenticates via
frontend/src/context/AuthContext.tsx - API client → Express API: sends HTTP
frontend/src/services/api.ts - Express API → Login and identity: dispatches
backend/src/index.ts - Express API → Applications: dispatches
backend/src/index.ts - Express API → Rooms: dispatches
backend/src/index.ts - Express API → Bed allocations: dispatches
backend/src/index.ts - Express API → Fees: dispatches
backend/src/index.ts - Express API → Payments: dispatches
backend/src/index.ts - Express API → Visitors: dispatches
backend/src/index.ts - Express API → Curfew: dispatches
backend/src/index.ts - Express API → Outpasses and leave: dispatches
backend/src/index.ts - Express API → Notices: dispatches
backend/src/index.ts - Express API → Notifications: dispatches
backend/src/index.ts - Express API → Administration: dispatches
backend/src/index.ts - Express API → Reports: dispatches
backend/src/index.ts - Applications → Authentication and roles: checks roles
backend/src/routes/applications.ts - Login and identity → Authentication and roles: uses authentication
backend/src/routes/auth.ts - Applications → Prisma data access: reads and writes
backend/src/routes/applications.ts - Rooms → Prisma data access: reads and writes
backend/src/routes/rooms.ts - Bed allocations → Prisma data access: reads and writes
backend/src/routes/allocations.ts - Fees → Prisma data access: reads and writes
backend/src/routes/fees.ts - Payments → Prisma data access: reads and writes
backend/src/routes/payments.ts - Visitors → Prisma data access: reads and writes
backend/src/routes/visitors.ts - Curfew → Prisma data access: reads and writes
backend/src/routes/curfew.ts - Outpasses and leave → Prisma data access: reads and writes
backend/src/routes/outpasses.ts - Administration → Prisma data access: reads and writes
backend/src/routes/admin.ts - Authentication and roles → Prisma data access: loads user
backend/src/middleware/auth.ts - Authentication and roles → Audit logging: records actions
- Prisma data access → Application database: persists records