# manmathan6305/hostal_management_portal architecture

> Architecture diagram of the GitHub repository manmathan6305/hostal_management_portal, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/manmathan6305/hostal_management_portal
- Repository: https://github.com/manmathan6305/hostal_management_portal

## Overview

This is a role-based hostel management portal: students apply for accommodation and use student services, while wardens and administrators review applications and manage hostel operations. The frontend routes users to role-specific pages; the Express backend exposes authentication, application, allocation, room, and student-service endpoints backed by Sequelize models and MySQL. The excerpts show application review creating allocations and student portal queries; other route-to-model links are supported by the source index. Frontend-to-backend request wiring was not established by the sampled evidence, so it is not drawn.

Main entry points: [`backend/src/index.js`](https://github.com/manmathan6305/hostal_management_portal/blob/main/backend/src/index.js) (Express server), [`frontend/src/App.tsx`](https://github.com/manmathan6305/hostal_management_portal/blob/main/frontend/src/App.tsx) (Role-based routes), [`backend/src/routes/application.routes.js`](https://github.com/manmathan6305/hostal_management_portal/blob/main/backend/src/routes/application.routes.js) (Applications API), [`backend/src/config/database.js`](https://github.com/manmathan6305/hostal_management_portal/blob/main/backend/src/config/database.js) (Sequelize connection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web application"]
  node_app["Role-based routes<br/>[App.tsx]"]
  node_apply_page["Hostel application<br/>[ApplyHostel.tsx]"]
  node_admin_allocation["Allocation management<br/>[AddAllocation.tsx]"]
  node_room_admin["Room management<br/>[Rooms.tsx]"]
  node_admin_hostels["Hostel management<br/>[Hostels.tsx]"]
  node_admin_menu["Menu management<br/>[Menu.tsx]"]
  node_requests_page["Student requests<br/>[Requests.tsx]"]
end

subgraph group_api["Backend API"]
  node_server["Express server<br/>[index.js]"]
  node_auth["Token and roles<br/>[auth.js]"]
  node_applications_api["Applications API"]
  node_allocations_api["Allocations API"]
  node_student_api["Student services API"]
  node_rooms_api["Rooms API<br/>[room.routes.js]"]
  node_hostels_api["Hostels API<br/>[hostel.routes.js]"]
  node_auth_api["Authentication API<br/>[auth.routes.js]"]
  node_attendance_api["Attendance API"]
  node_complaints_api["Complaints API"]
  node_feedback_api["Feedback API<br/>[feedback.routes.js]"]
  node_dashboard_api["Dashboard API"]
end

subgraph group_domain["Hostel domain"]
  node_student_model["Student records<br/>[Student.js]"]
  node_user_model["User accounts<br/>[User.js]"]
  node_application_model["Applications<br/>[Application.js]"]
  node_hostel_model["Hostels<br/>[Hostel.js]"]
  node_room_model["Rooms<br/>[Room.js]"]
  node_allocation_model["Room allocations<br/>[Allocation.js]"]
  node_complaint_model["Complaints<br/>[Complaint.js]"]
  node_attendance_model["Attendance<br/>[Attendance.js]"]
  node_feedback_model["Food feedback<br/>[Feedback.js]"]
end

subgraph group_persistence["Persistence"]
  node_db_config["Sequelize connection<br/>[database.js]"]
end

node_user(("Portal user"))
node_mysql[("MySQL")]

node_user -->|"opens portal"| node_app
node_app -->|"routes to"| node_apply_page
node_app -->|"routes to"| node_admin_allocation
node_app -->|"routes to"| node_room_admin
node_app -->|"routes to"| node_admin_hostels
node_app -->|"routes to"| node_admin_menu
node_app -->|"routes to"| node_requests_page
node_server -->|"mounts routes"| node_auth_api
node_server -->|"mounts routes"| node_applications_api
node_server -->|"mounts routes"| node_allocations_api
node_server -->|"mounts routes"| node_student_api
node_server -->|"mounts routes"| node_rooms_api
node_server -->|"mounts routes"| node_hostels_api
node_server -->|"mounts routes"| node_attendance_api
node_server -->|"mounts routes"| node_complaints_api
node_applications_api -->|"checks roles"| node_auth
node_allocations_api -->|"checks roles"| node_auth
node_applications_api -->|"reads or writes"| node_student_model
node_applications_api -->|"reads or writes"| node_application_model
node_applications_api -->|"reads"| node_hostel_model
node_applications_api -->|"selects room"| node_room_model
node_applications_api -->|"creates allocation"| node_allocation_model
node_allocations_api -->|"reads or writes"| node_allocation_model
node_allocations_api -->|"checks capacity"| node_room_model
node_allocations_api -->|"reads students"| node_student_model
node_allocations_api -->|"scopes wardens"| node_hostel_model
node_student_api -->|"loads profile"| node_student_model
node_student_api -->|"finds assignment"| node_allocation_model
node_student_api -->|"loads room"| node_room_model
node_student_api -->|"reads complaints"| node_complaint_model
node_student_api -->|"reads attendance"| node_attendance_model
node_rooms_api -->|"manages rooms"| node_room_model
node_hostels_api -->|"manages hostels"| node_hostel_model
node_auth_api -->|"authenticates users"| node_user_model
node_complaints_api -->|"manages complaints"| node_complaint_model
node_feedback_api -->|"manages feedback"| node_feedback_model
node_dashboard_api -.->|"summarizes data"| node_student_model
node_student_model -->|"defines model"| node_db_config
node_user_model -->|"defines model"| node_db_config
node_application_model -->|"defines model"| node_db_config
node_hostel_model -->|"defines model"| node_db_config
node_room_model -->|"defines model"| node_db_config
node_allocation_model -->|"defines model"| node_db_config
node_db_config -->|"connects to"| node_mysql

click node_app "https://github.com/manmathan6305/hostal_management_portal/blob/main/frontend/src/App.tsx"
click node_apply_page "https://github.com/manmathan6305/hostal_management_portal/blob/main/frontend/src/pages/student/ApplyHostel.tsx"
click node_admin_allocation "https://github.com/manmathan6305/hostal_management_portal/blob/main/frontend/src/pages/admin/AddAllocation.tsx"
click node_room_admin "https://github.com/manmathan6305/hostal_management_portal/blob/main/frontend/src/pages/admin/Rooms.tsx"
click node_admin_hostels "https://github.com/manmathan6305/hostal_management_portal/blob/main/frontend/src/pages/admin/Hostels.tsx"
click node_admin_menu "https://github.com/manmathan6305/hostal_management_portal/blob/main/frontend/src/pages/admin/Menu.tsx"
click node_requests_page "https://github.com/manmathan6305/hostal_management_portal/blob/main/frontend/src/pages/student/Requests.tsx"
click node_server "https://github.com/manmathan6305/hostal_management_portal/blob/main/backend/src/index.js"
click node_auth "https://github.com/manmathan6305/hostal_management_portal/blob/main/backend/src/middleware/auth.js"
click node_applications_api "https://github.com/manmathan6305/hostal_management_portal/blob/main/backend/src/routes/application.routes.js"
click node_allocations_api "https://github.com/manmathan6305/hostal_management_portal/blob/main/backend/src/routes/allocation.routes.js"
click node_student_api "https://github.com/manmathan6305/hostal_management_portal/blob/main/backend/src/routes/studentPortal.routes.js"
click node_rooms_api "https://github.com/manmathan6305/hostal_management_portal/blob/main/backend/src/routes/room.routes.js"
click node_hostels_api "https://github.com/manmathan6305/hostal_management_portal/blob/main/backend/src/routes/hostel.routes.js"
click node_auth_api "https://github.com/manmathan6305/hostal_management_portal/blob/main/backend/src/routes/auth.routes.js"
click node_attendance_api "https://github.com/manmathan6305/hostal_management_portal/blob/main/backend/src/routes/attendance.routes.js"
click node_complaints_api "https://github.com/manmathan6305/hostal_management_portal/blob/main/backend/src/routes/complaint.routes.js"
click node_feedback_api "https://github.com/manmathan6305/hostal_management_portal/blob/main/backend/src/routes/feedback.routes.js"
click node_dashboard_api "https://github.com/manmathan6305/hostal_management_portal/blob/main/backend/src/routes/dashboard.routes.js"
click node_student_model "https://github.com/manmathan6305/hostal_management_portal/blob/main/backend/src/models/Student.js"
click node_user_model "https://github.com/manmathan6305/hostal_management_portal/blob/main/backend/src/models/User.js"
click node_application_model "https://github.com/manmathan6305/hostal_management_portal/blob/main/backend/src/models/Application.js"
click node_hostel_model "https://github.com/manmathan6305/hostal_management_portal/blob/main/backend/src/models/Hostel.js"
click node_room_model "https://github.com/manmathan6305/hostal_management_portal/blob/main/backend/src/models/Room.js"
click node_allocation_model "https://github.com/manmathan6305/hostal_management_portal/blob/main/backend/src/models/Allocation.js"
click node_complaint_model "https://github.com/manmathan6305/hostal_management_portal/blob/main/backend/src/models/Complaint.js"
click node_attendance_model "https://github.com/manmathan6305/hostal_management_portal/blob/main/backend/src/models/Attendance.js"
click node_feedback_model "https://github.com/manmathan6305/hostal_management_portal/blob/main/backend/src/models/Feedback.js"
click node_db_config "https://github.com/manmathan6305/hostal_management_portal/blob/main/backend/src/config/database.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_apply_page,node_admin_allocation,node_room_admin,node_admin_hostels,node_admin_menu,node_requests_page,node_user toneBlue
class node_server,node_auth,node_applications_api,node_allocations_api,node_student_api,node_rooms_api,node_hostels_api,node_auth_api,node_attendance_api,node_complaints_api,node_feedback_api,node_dashboard_api,node_mysql toneAmber
class node_student_model,node_user_model,node_application_model,node_hostel_model,node_room_model,node_allocation_model,node_complaint_model,node_attendance_model,node_feedback_model toneMint
class node_db_config toneRose
```

## Components

### Web application

- [Role-based routes](https://github.com/manmathan6305/hostal_management_portal/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Hostel application](https://github.com/manmathan6305/hostal_management_portal/blob/main/frontend/src/pages/student/ApplyHostel.tsx): `frontend/src/pages/student/ApplyHostel.tsx`
- [Allocation management](https://github.com/manmathan6305/hostal_management_portal/blob/main/frontend/src/pages/admin/AddAllocation.tsx): `frontend/src/pages/admin/AddAllocation.tsx`
- [Room management](https://github.com/manmathan6305/hostal_management_portal/blob/main/frontend/src/pages/admin/Rooms.tsx): `frontend/src/pages/admin/Rooms.tsx`
- [Hostel management](https://github.com/manmathan6305/hostal_management_portal/blob/main/frontend/src/pages/admin/Hostels.tsx): `frontend/src/pages/admin/Hostels.tsx`
- [Menu management](https://github.com/manmathan6305/hostal_management_portal/blob/main/frontend/src/pages/admin/Menu.tsx): `frontend/src/pages/admin/Menu.tsx`
- [Student requests](https://github.com/manmathan6305/hostal_management_portal/blob/main/frontend/src/pages/student/Requests.tsx): `frontend/src/pages/student/Requests.tsx`

### Backend API

- [Express server](https://github.com/manmathan6305/hostal_management_portal/blob/main/backend/src/index.js): `backend/src/index.js`
- [Token and roles](https://github.com/manmathan6305/hostal_management_portal/blob/main/backend/src/middleware/auth.js): `backend/src/middleware/auth.js`
- [Applications API](https://github.com/manmathan6305/hostal_management_portal/blob/main/backend/src/routes/application.routes.js): `backend/src/routes/application.routes.js`
- [Allocations API](https://github.com/manmathan6305/hostal_management_portal/blob/main/backend/src/routes/allocation.routes.js): `backend/src/routes/allocation.routes.js`
- [Student services API](https://github.com/manmathan6305/hostal_management_portal/blob/main/backend/src/routes/studentPortal.routes.js): `backend/src/routes/studentPortal.routes.js`
- [Rooms API](https://github.com/manmathan6305/hostal_management_portal/blob/main/backend/src/routes/room.routes.js): `backend/src/routes/room.routes.js`
- [Hostels API](https://github.com/manmathan6305/hostal_management_portal/blob/main/backend/src/routes/hostel.routes.js): `backend/src/routes/hostel.routes.js`
- [Authentication API](https://github.com/manmathan6305/hostal_management_portal/blob/main/backend/src/routes/auth.routes.js): `backend/src/routes/auth.routes.js`
- [Attendance API](https://github.com/manmathan6305/hostal_management_portal/blob/main/backend/src/routes/attendance.routes.js): `backend/src/routes/attendance.routes.js`
- [Complaints API](https://github.com/manmathan6305/hostal_management_portal/blob/main/backend/src/routes/complaint.routes.js): `backend/src/routes/complaint.routes.js`
- [Feedback API](https://github.com/manmathan6305/hostal_management_portal/blob/main/backend/src/routes/feedback.routes.js): `backend/src/routes/feedback.routes.js`
- [Dashboard API](https://github.com/manmathan6305/hostal_management_portal/blob/main/backend/src/routes/dashboard.routes.js): `backend/src/routes/dashboard.routes.js`

### Hostel domain

- [Student records](https://github.com/manmathan6305/hostal_management_portal/blob/main/backend/src/models/Student.js): `backend/src/models/Student.js`
- [User accounts](https://github.com/manmathan6305/hostal_management_portal/blob/main/backend/src/models/User.js): `backend/src/models/User.js`
- [Applications](https://github.com/manmathan6305/hostal_management_portal/blob/main/backend/src/models/Application.js): `backend/src/models/Application.js`
- [Hostels](https://github.com/manmathan6305/hostal_management_portal/blob/main/backend/src/models/Hostel.js): `backend/src/models/Hostel.js`
- [Rooms](https://github.com/manmathan6305/hostal_management_portal/blob/main/backend/src/models/Room.js): `backend/src/models/Room.js`
- [Room allocations](https://github.com/manmathan6305/hostal_management_portal/blob/main/backend/src/models/Allocation.js): `backend/src/models/Allocation.js`
- [Complaints](https://github.com/manmathan6305/hostal_management_portal/blob/main/backend/src/models/Complaint.js): `backend/src/models/Complaint.js`
- [Attendance](https://github.com/manmathan6305/hostal_management_portal/blob/main/backend/src/models/Attendance.js): `backend/src/models/Attendance.js`
- [Food feedback](https://github.com/manmathan6305/hostal_management_portal/blob/main/backend/src/models/Feedback.js): `backend/src/models/Feedback.js`

### Persistence

- [Sequelize connection](https://github.com/manmathan6305/hostal_management_portal/blob/main/backend/src/config/database.js): `backend/src/config/database.js`

### Other components

- **Portal user**
- **MySQL**

## Connections

- Portal user → Role-based routes: opens portal (evidence: `frontend/src/App.tsx`)
- Role-based routes → Hostel application: routes to (evidence: `frontend/src/App.tsx`)
- Role-based routes → Allocation management: routes to (evidence: `frontend/src/App.tsx`)
- Role-based routes → Room management: routes to (evidence: `frontend/src/App.tsx`)
- Role-based routes → Hostel management: routes to (evidence: `frontend/src/App.tsx`)
- Role-based routes → Menu management: routes to (evidence: `frontend/src/App.tsx`)
- Role-based routes → Student requests: routes to (evidence: `frontend/src/App.tsx`)
- Express server → Authentication API: mounts routes (evidence: `backend/src/index.js`)
- Express server → Applications API: mounts routes (evidence: `backend/src/index.js`)
- Express server → Allocations API: mounts routes (evidence: `backend/src/index.js`)
- Express server → Student services API: mounts routes (evidence: `backend/src/index.js`)
- Express server → Rooms API: mounts routes (evidence: `backend/src/index.js`)
- Express server → Hostels API: mounts routes (evidence: `backend/src/index.js`)
- Express server → Attendance API: mounts routes (evidence: `backend/src/index.js`)
- Express server → Complaints API: mounts routes (evidence: `backend/src/index.js`)
- Applications API → Token and roles: checks roles (evidence: `backend/src/routes/application.routes.js`)
- Allocations API → Token and roles: checks roles (evidence: `backend/src/routes/allocation.routes.js`)
- Applications API → Student records: reads or writes (evidence: `backend/src/routes/application.routes.js`)
- Applications API → Applications: reads or writes (evidence: `backend/src/routes/application.routes.js`)
- Applications API → Hostels: reads (evidence: `backend/src/routes/application.routes.js`)
- Applications API → Rooms: selects room (evidence: `backend/src/routes/application.routes.js`)
- Applications API → Room allocations: creates allocation (evidence: `backend/src/routes/application.routes.js`)
- Allocations API → Room allocations: reads or writes (evidence: `backend/src/routes/allocation.routes.js`)
- Allocations API → Rooms: checks capacity (evidence: `backend/src/routes/allocation.routes.js`)
- Allocations API → Student records: reads students (evidence: `backend/src/routes/allocation.routes.js`)
- Allocations API → Hostels: scopes wardens (evidence: `backend/src/routes/allocation.routes.js`)
- Student services API → Student records: loads profile (evidence: `backend/src/routes/studentPortal.routes.js`)
- Student services API → Room allocations: finds assignment (evidence: `backend/src/routes/studentPortal.routes.js`)
- Student services API → Rooms: loads room (evidence: `backend/src/routes/studentPortal.routes.js`)
- Student services API → Complaints: reads complaints (evidence: `backend/src/routes/studentPortal.routes.js`)
- Student services API → Attendance: reads attendance (evidence: `backend/src/routes/studentPortal.routes.js`)
- Rooms API → Rooms: manages rooms (evidence: `backend/src/routes/room.routes.js`)
- Hostels API → Hostels: manages hostels
- Authentication API → User accounts: authenticates users (evidence: `backend/src/routes/auth.routes.js`)
- Complaints API → Complaints: manages complaints (evidence: `backend/src/routes/complaint.routes.js`)
- Feedback API → Food feedback: manages feedback (evidence: `backend/src/routes/feedback.routes.js`)
- Dashboard API → Student records: summarizes data
- Student records → Sequelize connection: defines model (evidence: `backend/src/models/Student.js`)
- User accounts → Sequelize connection: defines model (evidence: `backend/src/models/User.js`)
- Applications → Sequelize connection: defines model (evidence: `backend/src/models/Application.js`)
- Hostels → Sequelize connection: defines model (evidence: `backend/src/models/Hostel.js`)
- Rooms → Sequelize connection: defines model (evidence: `backend/src/models/Room.js`)
- Room allocations → Sequelize connection: defines model (evidence: `backend/src/models/Allocation.js`)
- Sequelize connection → MySQL: connects to (evidence: `backend/src/config/database.js`)
