# shankhodeep-das/exam_seat_allocation_project architecture

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

- Interactive diagram: https://gitdiagram.com/shankhodeep-das/exam_seat_allocation_project
- Repository: https://github.com/shankhodeep-das/exam_seat_allocation_project

## Overview

SeatWise combines a terminal-based exam-seat utility with a web/mobile portal and an Express API. In the terminal workflow, an operator chooses student or room tasks; the Python entry point dispatches to student-file operations or seat/room lookups. In the portal workflow, users sign in, request a role-specific dashboard, and staff can manage buildings and rooms. The backend uses Prisma with Neon; staff dashboard code also reads allocation and empty-seat report files. Several links are limited to explicit imports, routes, or calls shown in the excerpts; unsampled allocation and UI wiring is not inferred.

Main entry points: [`backend/src/routes/auth.routes.js`](https://github.com/shankhodeep-das/exam_seat_allocation_project/blob/main/backend/src/routes/auth.routes.js) (Auth Routes), [`website/lib/api.js`](https://github.com/shankhodeep-das/exam_seat_allocation_project/blob/main/website/lib/api.js) (Web API Client), [`main.py`](https://github.com/shankhodeep-das/exam_seat_allocation_project/blob/main/main.py) (Terminal Menu), [`backend/src/config/prisma.js`](https://github.com/shankhodeep-das/exam_seat_allocation_project/blob/main/backend/src/config/prisma.js) (Prisma Client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_python["Terminal Exam Tools"]
  node_python_cli["Terminal Menu<br/>[main.py]"]
  node_students["Student Records"]
  node_student_search["Student Search<br/>[Student_search.py]"]
  node_capacity["Room Capacity<br/>[Check_capacity.py]"]
  node_seat_lookup["Seat Lookup"]
  node_room_details["Room Details"]
  node_ct_allocation["CT Seating"]
  node_semester_allocation["Semester Seating"]
  node_student_generator["Student Data Generator"]
end

subgraph group_api["API and Data"]
  node_api_app["Express API<br/>[app.js]"]
  node_auth_routes["Auth Routes<br/>[auth.routes.js]"]
  node_building_routes["Building Routes<br/>[building.routes.js]"]
  node_auth["Authentication<br/>[auth.controller.js]"]
  node_auth_middleware["Token Authorization<br/>[auth.middleware.js]"]
  node_student_dash["Student Dashboard"]
  node_staff_dash["Staff Dashboard"]
  node_building_mgmt["Building Management"]
  node_orm["Prisma Client<br/>[prisma.js]"]
  node_database[("Neon Database")]
  node_seat_jobs["Seat Allocation Jobs"]
end

subgraph group_web["Web Portal"]
  node_web_staff["Staff Dashboard UI<br/>[page.jsx]"]
  node_web_rooms["Room Administration<br/>[AddBuildings.jsx]"]
  node_web_exam_rooms["Exam Room Views<br/>[YourExamRooms.jsx]"]
  node_web_student["Student Dashboard UI<br/>[page.jsx]"]
  node_web_auth["Web Session Auth<br/>[AuthContext.jsx]"]
  node_web_api["Web API Client<br/>[api.js]"]
end

subgraph group_mobile["Mobile App"]
  node_mobile_auth["Mobile Session<br/>[AuthContext.tsx]"]
  node_mobile_api["Mobile API Client<br/>[api.ts]"]
  node_mobile_home["Mobile Home<br/>[index.tsx]"]
end

node_operator(("Operator"))

node_operator -->|"selects tasks"| node_python_cli
node_python_cli -->|"dispatches CRUD"| node_students
node_python_cli -->|"dispatches search"| node_student_search
node_python_cli -->|"checks capacity"| node_capacity
node_python_cli -->|"finds seat"| node_seat_lookup
node_python_cli -->|"shows room"| node_room_details
node_web_staff -->|"requests data"| node_web_api
node_web_staff -->|"updates password"| node_web_api
node_web_api -.->|"calls dashboard API"| node_auth_routes
node_web_rooms -.->|"requests room API"| node_web_api
node_web_exam_rooms -.->|"requests room API"| node_web_api
node_web_student -.->|"requests dashboard"| node_web_api
node_web_auth -.->|"uses API"| node_web_api
node_api_app -->|"mounts routes"| node_auth_routes
node_api_app -->|"mounts routes"| node_building_routes
node_auth_routes -->|"routes login"| node_auth
node_auth_routes -->|"protects endpoints"| node_auth_middleware
node_auth_routes -->|"routes dashboard"| node_student_dash
node_auth_routes -->|"routes dashboard"| node_staff_dash
node_building_routes -->|"protects endpoints"| node_auth_middleware
node_building_routes -->|"routes operations"| node_building_mgmt
node_auth -->|"queries records"| node_orm
node_student_dash -->|"queries dashboard"| node_orm
node_staff_dash -->|"queries staff"| node_orm
node_building_mgmt -->|"manages rooms"| node_orm
node_auth_middleware -->|"loads user"| node_orm
node_orm -->|"connects through adapter"| node_database
node_staff_dash -->|"reads reports"| node_seat_jobs
node_seat_jobs -.->|"produces reports"| node_staff_dash
node_mobile_home -->|"uses session"| node_mobile_auth
node_mobile_auth -->|"loads dashboard"| node_mobile_api
node_mobile_api -.->|"requests dashboard"| node_auth_routes

click node_python_cli "https://github.com/shankhodeep-das/exam_seat_allocation_project/blob/main/main.py"
click node_students "https://github.com/shankhodeep-das/exam_seat_allocation_project/tree/main/STUDENTS_SECTION"
click node_student_search "https://github.com/shankhodeep-das/exam_seat_allocation_project/blob/main/STUDENTS_SECTION/Student_search.py"
click node_capacity "https://github.com/shankhodeep-das/exam_seat_allocation_project/blob/main/EXAM_SECTION/Check_capacity.py"
click node_seat_lookup "https://github.com/shankhodeep-das/exam_seat_allocation_project/blob/main/SEAT_SECTION/Student_Seat_position.py"
click node_room_details "https://github.com/shankhodeep-das/exam_seat_allocation_project/blob/main/SEAT_SECTION/View_Room_Details.py"
click node_ct_allocation "https://github.com/shankhodeep-das/exam_seat_allocation_project/blob/main/SEAT_SECTION/Seating_arrangements_for_CT.py"
click node_semester_allocation "https://github.com/shankhodeep-das/exam_seat_allocation_project/blob/main/SEAT_SECTION/Seating_arrangements_for_semester.py"
click node_student_generator "https://github.com/shankhodeep-das/exam_seat_allocation_project/blob/main/STUDENTS_SECTION/Student_data_generator.py"
click node_api_app "https://github.com/shankhodeep-das/exam_seat_allocation_project/blob/main/backend/src/app.js"
click node_auth_routes "https://github.com/shankhodeep-das/exam_seat_allocation_project/blob/main/backend/src/routes/auth.routes.js"
click node_building_routes "https://github.com/shankhodeep-das/exam_seat_allocation_project/blob/main/backend/src/routes/building.routes.js"
click node_auth "https://github.com/shankhodeep-das/exam_seat_allocation_project/blob/main/backend/src/controllers/auth.controller.js"
click node_auth_middleware "https://github.com/shankhodeep-das/exam_seat_allocation_project/blob/main/backend/src/middleware/auth.middleware.js"
click node_student_dash "https://github.com/shankhodeep-das/exam_seat_allocation_project/blob/main/backend/src/controllers/studentDashboard.controller.js"
click node_staff_dash "https://github.com/shankhodeep-das/exam_seat_allocation_project/blob/main/backend/src/controllers/staffDashboard.controller.js"
click node_building_mgmt "https://github.com/shankhodeep-das/exam_seat_allocation_project/blob/main/backend/src/controllers/building.controller.js"
click node_orm "https://github.com/shankhodeep-das/exam_seat_allocation_project/blob/main/backend/src/config/prisma.js"
click node_seat_jobs "https://github.com/shankhodeep-das/exam_seat_allocation_project/tree/main/backend/src/scripts"
click node_web_staff "https://github.com/shankhodeep-das/exam_seat_allocation_project/blob/main/website/app/staff/dashboard/page.jsx"
click node_web_rooms "https://github.com/shankhodeep-das/exam_seat_allocation_project/blob/main/website/app/staff/room/AddBuildings.jsx"
click node_web_exam_rooms "https://github.com/shankhodeep-das/exam_seat_allocation_project/blob/main/website/app/staff/room/YourExamRooms.jsx"
click node_web_student "https://github.com/shankhodeep-das/exam_seat_allocation_project/blob/main/website/app/student/dashboard/page.jsx"
click node_web_auth "https://github.com/shankhodeep-das/exam_seat_allocation_project/blob/main/website/context/AuthContext.jsx"
click node_web_api "https://github.com/shankhodeep-das/exam_seat_allocation_project/blob/main/website/lib/api.js"
click node_mobile_auth "https://github.com/shankhodeep-das/exam_seat_allocation_project/blob/main/mobile/app/context/AuthContext.tsx"
click node_mobile_api "https://github.com/shankhodeep-das/exam_seat_allocation_project/blob/main/mobile/app/services/api.ts"
click node_mobile_home "https://github.com/shankhodeep-das/exam_seat_allocation_project/blob/main/mobile/app/(tabs)/index.tsx"

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_python_cli,node_students,node_student_search,node_capacity,node_seat_lookup,node_room_details,node_ct_allocation,node_semester_allocation,node_student_generator toneBlue
class node_api_app,node_auth_routes,node_building_routes,node_auth,node_auth_middleware,node_student_dash,node_staff_dash,node_building_mgmt,node_orm,node_database,node_seat_jobs toneAmber
class node_web_staff,node_web_rooms,node_web_exam_rooms,node_web_student,node_web_auth,node_web_api toneMint
class node_mobile_auth,node_mobile_api,node_mobile_home toneRose
class node_operator toneIndigo
```

## Components

### Terminal Exam Tools

- [Terminal Menu](https://github.com/shankhodeep-das/exam_seat_allocation_project/blob/main/main.py): `main.py`
- [Student Records](https://github.com/shankhodeep-das/exam_seat_allocation_project/tree/main/STUDENTS_SECTION): `STUDENTS_SECTION`
- [Student Search](https://github.com/shankhodeep-das/exam_seat_allocation_project/blob/main/STUDENTS_SECTION/Student_search.py): `STUDENTS_SECTION/Student_search.py`
- [Room Capacity](https://github.com/shankhodeep-das/exam_seat_allocation_project/blob/main/EXAM_SECTION/Check_capacity.py): `EXAM_SECTION/Check_capacity.py`
- [Seat Lookup](https://github.com/shankhodeep-das/exam_seat_allocation_project/blob/main/SEAT_SECTION/Student_Seat_position.py): `SEAT_SECTION/Student_Seat_position.py`
- [Room Details](https://github.com/shankhodeep-das/exam_seat_allocation_project/blob/main/SEAT_SECTION/View_Room_Details.py): `SEAT_SECTION/View_Room_Details.py`
- [CT Seating](https://github.com/shankhodeep-das/exam_seat_allocation_project/blob/main/SEAT_SECTION/Seating_arrangements_for_CT.py): `SEAT_SECTION/Seating_arrangements_for_CT.py`
- [Semester Seating](https://github.com/shankhodeep-das/exam_seat_allocation_project/blob/main/SEAT_SECTION/Seating_arrangements_for_semester.py): `SEAT_SECTION/Seating_arrangements_for_semester.py`
- [Student Data Generator](https://github.com/shankhodeep-das/exam_seat_allocation_project/blob/main/STUDENTS_SECTION/Student_data_generator.py): `STUDENTS_SECTION/Student_data_generator.py`

### API and Data

- [Express API](https://github.com/shankhodeep-das/exam_seat_allocation_project/blob/main/backend/src/app.js): `backend/src/app.js`
- [Auth Routes](https://github.com/shankhodeep-das/exam_seat_allocation_project/blob/main/backend/src/routes/auth.routes.js): `backend/src/routes/auth.routes.js`
- [Building Routes](https://github.com/shankhodeep-das/exam_seat_allocation_project/blob/main/backend/src/routes/building.routes.js): `backend/src/routes/building.routes.js`
- [Authentication](https://github.com/shankhodeep-das/exam_seat_allocation_project/blob/main/backend/src/controllers/auth.controller.js): `backend/src/controllers/auth.controller.js`
- [Token Authorization](https://github.com/shankhodeep-das/exam_seat_allocation_project/blob/main/backend/src/middleware/auth.middleware.js): `backend/src/middleware/auth.middleware.js`
- [Student Dashboard](https://github.com/shankhodeep-das/exam_seat_allocation_project/blob/main/backend/src/controllers/studentDashboard.controller.js): `backend/src/controllers/studentDashboard.controller.js`
- [Staff Dashboard](https://github.com/shankhodeep-das/exam_seat_allocation_project/blob/main/backend/src/controllers/staffDashboard.controller.js): `backend/src/controllers/staffDashboard.controller.js`
- [Building Management](https://github.com/shankhodeep-das/exam_seat_allocation_project/blob/main/backend/src/controllers/building.controller.js): `backend/src/controllers/building.controller.js`
- [Prisma Client](https://github.com/shankhodeep-das/exam_seat_allocation_project/blob/main/backend/src/config/prisma.js): `backend/src/config/prisma.js`
- **Neon Database**
- [Seat Allocation Jobs](https://github.com/shankhodeep-das/exam_seat_allocation_project/tree/main/backend/src/scripts): `backend/src/scripts`

### Web Portal

- [Staff Dashboard UI](https://github.com/shankhodeep-das/exam_seat_allocation_project/blob/main/website/app/staff/dashboard/page.jsx): `website/app/staff/dashboard/page.jsx`
- [Room Administration](https://github.com/shankhodeep-das/exam_seat_allocation_project/blob/main/website/app/staff/room/AddBuildings.jsx): `website/app/staff/room/AddBuildings.jsx`
- [Exam Room Views](https://github.com/shankhodeep-das/exam_seat_allocation_project/blob/main/website/app/staff/room/YourExamRooms.jsx): `website/app/staff/room/YourExamRooms.jsx`
- [Student Dashboard UI](https://github.com/shankhodeep-das/exam_seat_allocation_project/blob/main/website/app/student/dashboard/page.jsx): `website/app/student/dashboard/page.jsx`
- [Web Session Auth](https://github.com/shankhodeep-das/exam_seat_allocation_project/blob/main/website/context/AuthContext.jsx): `website/context/AuthContext.jsx`
- [Web API Client](https://github.com/shankhodeep-das/exam_seat_allocation_project/blob/main/website/lib/api.js): `website/lib/api.js`

### Mobile App

- [Mobile Session](https://github.com/shankhodeep-das/exam_seat_allocation_project/blob/main/mobile/app/context/AuthContext.tsx): `mobile/app/context/AuthContext.tsx`
- [Mobile API Client](https://github.com/shankhodeep-das/exam_seat_allocation_project/blob/main/mobile/app/services/api.ts): `mobile/app/services/api.ts`
- [Mobile Home](https://github.com/shankhodeep-das/exam_seat_allocation_project/blob/main/mobile/app/(tabs)/index.tsx): `mobile/app/(tabs)/index.tsx`

### Other components

- **Operator**

## Connections

- Operator → Terminal Menu: selects tasks (evidence: `main.py`)
- Terminal Menu → Student Records: dispatches CRUD (evidence: `main.py`)
- Terminal Menu → Student Search: dispatches search (evidence: `main.py`)
- Terminal Menu → Room Capacity: checks capacity (evidence: `main.py`)
- Terminal Menu → Seat Lookup: finds seat (evidence: `main.py`)
- Terminal Menu → Room Details: shows room (evidence: `main.py`)
- Staff Dashboard UI → Web API Client: requests data (evidence: `website/app/staff/dashboard/page.jsx`)
- Staff Dashboard UI → Web API Client: updates password (evidence: `website/app/staff/dashboard/page.jsx`)
- Web API Client → Auth Routes: calls dashboard API
- Room Administration → Web API Client: requests room API
- Exam Room Views → Web API Client: requests room API
- Student Dashboard UI → Web API Client: requests dashboard
- Web Session Auth → Web API Client: uses API
- Express API → Auth Routes: mounts routes (evidence: `backend/src/app.js`)
- Express API → Building Routes: mounts routes (evidence: `backend/src/app.js`)
- Auth Routes → Authentication: routes login (evidence: `backend/src/routes/auth.routes.js`)
- Auth Routes → Token Authorization: protects endpoints (evidence: `backend/src/routes/auth.routes.js`)
- Auth Routes → Student Dashboard: routes dashboard (evidence: `backend/src/routes/auth.routes.js`)
- Auth Routes → Staff Dashboard: routes dashboard (evidence: `backend/src/routes/auth.routes.js`)
- Building Routes → Token Authorization: protects endpoints (evidence: `backend/src/routes/building.routes.js`)
- Building Routes → Building Management: routes operations (evidence: `backend/src/routes/building.routes.js`)
- Authentication → Prisma Client: queries records (evidence: `backend/src/controllers/auth.controller.js`)
- Student Dashboard → Prisma Client: queries dashboard (evidence: `backend/src/controllers/studentDashboard.controller.js`)
- Staff Dashboard → Prisma Client: queries staff (evidence: `backend/src/controllers/staffDashboard.controller.js`)
- Building Management → Prisma Client: manages rooms (evidence: `backend/src/controllers/building.controller.js`)
- Token Authorization → Prisma Client: loads user (evidence: `backend/src/middleware/auth.middleware.js`)
- Prisma Client → Neon Database: connects through adapter (evidence: `backend/src/config/prisma.js`)
- Staff Dashboard → Seat Allocation Jobs: reads reports (evidence: `backend/src/controllers/staffDashboard.controller.js`)
- Seat Allocation Jobs → Staff Dashboard: produces reports
- Mobile Home → Mobile Session: uses session (evidence: `mobile/app/(tabs)/index.tsx`)
- Mobile Session → Mobile API Client: loads dashboard (evidence: `mobile/app/context/AuthContext.tsx`)
- Mobile API Client → Auth Routes: requests dashboard
