# protonium04/hostel-accommodation-system architecture

> Architecture diagram of the GitHub repository protonium04/hostel-accommodation-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/protonium04/hostel-accommodation-system
- Repository: https://github.com/protonium04/hostel-accommodation-system

## Overview

This Streamlit hostel administration app lets an administrator review dashboard metrics and manage students, rooms, bookings, checkout, payments, complaints, and pending dues. Domain pages access MySQL through a shared database helper; several searchable lists also use a shared table filter. The README documents reset and analytics capabilities, and the SQL artifact supports database setup. For unsampled pages, connections are limited to references in the source index or explicit README statements.

Main entry points: [`utils/db.py`](https://github.com/protonium04/hostel-accommodation-system/blob/main/utils/db.py) (Database helper), [`utils/search.py`](https://github.com/protonium04/hostel-accommodation-system/blob/main/utils/search.py) (Searchable tables), [`pages/students.py`](https://github.com/protonium04/hostel-accommodation-system/blob/main/pages/students.py) (Student records), [`pages/rooms.py`](https://github.com/protonium04/hostel-accommodation-system/blob/main/pages/rooms.py) (Room availability)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Administration UI"]
  node_dashboard["Dashboard analytics<br/>[app.py]"]
  node_admin_reset["Admin reset<br/>[admin_rest.py]"]
end

subgraph group_accommodation["Accommodation"]
  node_students["Student records<br/>[students.py]"]
  node_rooms["Room availability<br/>[rooms.py]"]
  node_bookings["Room bookings<br/>[bookings.py]"]
  node_checkout["Booking checkout<br/>[checkout.py]"]
end

subgraph group_finance["Fees and payments"]
  node_payments["Payment records<br/>[payments.py]"]
  node_dues["Pending dues<br/>[pending_dues.py]"]
end

subgraph group_services["Student services"]
  node_complaints["Complaint handling<br/>[complaints.py]"]
end

subgraph group_shared["Shared infrastructure"]
  node_db_helper["Database helper<br/>[db.py]"]
  node_search["Searchable tables<br/>[search.py]"]
  node_schema["Database schema"]
end

node_admin(("Administrator"))
node_mysql[("MySQL database")]

node_admin -->|"opens app"| node_dashboard
node_dashboard -->|"queries metrics"| node_db_helper
node_students -->|"reads and updates"| node_db_helper
node_students -->|"filters list"| node_search
node_rooms -->|"reads and updates"| node_db_helper
node_rooms -->|"filters lists"| node_search
node_bookings -->|"reads and updates"| node_db_helper
node_bookings -->|"filters list"| node_search
node_checkout -->|"completes booking"| node_db_helper
node_payments -->|"reads and updates"| node_db_helper
node_payments -->|"filters list"| node_search
node_dues -->|"reads payment data"| node_db_helper
node_complaints -->|"reads and updates"| node_db_helper
node_complaints -->|"filters list"| node_search
node_admin_reset -->|"uses database"| node_db_helper
node_db_helper -->|"queries and writes"| node_mysql
node_schema -->|"sets up schema"| node_mysql

click node_dashboard "https://github.com/protonium04/hostel-accommodation-system/blob/main/app.py"
click node_students "https://github.com/protonium04/hostel-accommodation-system/blob/main/pages/students.py"
click node_rooms "https://github.com/protonium04/hostel-accommodation-system/blob/main/pages/rooms.py"
click node_bookings "https://github.com/protonium04/hostel-accommodation-system/blob/main/pages/bookings.py"
click node_checkout "https://github.com/protonium04/hostel-accommodation-system/blob/main/pages/checkout.py"
click node_payments "https://github.com/protonium04/hostel-accommodation-system/blob/main/pages/payments.py"
click node_dues "https://github.com/protonium04/hostel-accommodation-system/blob/main/pages/pending_dues.py"
click node_complaints "https://github.com/protonium04/hostel-accommodation-system/blob/main/pages/complaints.py"
click node_admin_reset "https://github.com/protonium04/hostel-accommodation-system/blob/main/pages/admin_rest.py"
click node_db_helper "https://github.com/protonium04/hostel-accommodation-system/blob/main/utils/db.py"
click node_search "https://github.com/protonium04/hostel-accommodation-system/blob/main/utils/search.py"
click node_schema "https://github.com/protonium04/hostel-accommodation-system/blob/main/HostelAccomodation.sql"

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_dashboard,node_admin_reset toneBlue
class node_students,node_rooms,node_bookings,node_checkout,node_mysql toneAmber
class node_payments,node_dues toneMint
class node_complaints toneRose
class node_db_helper,node_search,node_schema,node_admin toneIndigo
```

## Components

### Administration UI

- [Dashboard analytics](https://github.com/protonium04/hostel-accommodation-system/blob/main/app.py): `app.py`
- [Admin reset](https://github.com/protonium04/hostel-accommodation-system/blob/main/pages/admin_rest.py): `pages/admin_rest.py`

### Accommodation

- [Student records](https://github.com/protonium04/hostel-accommodation-system/blob/main/pages/students.py): `pages/students.py`
- [Room availability](https://github.com/protonium04/hostel-accommodation-system/blob/main/pages/rooms.py): `pages/rooms.py`
- [Room bookings](https://github.com/protonium04/hostel-accommodation-system/blob/main/pages/bookings.py): `pages/bookings.py`
- [Booking checkout](https://github.com/protonium04/hostel-accommodation-system/blob/main/pages/checkout.py): `pages/checkout.py`

### Fees and payments

- [Payment records](https://github.com/protonium04/hostel-accommodation-system/blob/main/pages/payments.py): `pages/payments.py`
- [Pending dues](https://github.com/protonium04/hostel-accommodation-system/blob/main/pages/pending_dues.py): `pages/pending_dues.py`

### Student services

- [Complaint handling](https://github.com/protonium04/hostel-accommodation-system/blob/main/pages/complaints.py): `pages/complaints.py`

### Shared infrastructure

- [Database helper](https://github.com/protonium04/hostel-accommodation-system/blob/main/utils/db.py): `utils/db.py`
- [Searchable tables](https://github.com/protonium04/hostel-accommodation-system/blob/main/utils/search.py): `utils/search.py`
- [Database schema](https://github.com/protonium04/hostel-accommodation-system/blob/main/HostelAccomodation.sql): `HostelAccomodation.sql`

### Other components

- **Administrator**
- **MySQL database**

## Connections

- Administrator → Dashboard analytics: opens app (evidence: `README.md`)
- Dashboard analytics → Database helper: queries metrics (evidence: `app.py`)
- Student records → Database helper: reads and updates (evidence: `pages/students.py`)
- Student records → Searchable tables: filters list (evidence: `pages/students.py`)
- Room availability → Database helper: reads and updates (evidence: `pages/rooms.py`)
- Room availability → Searchable tables: filters lists (evidence: `pages/rooms.py`)
- Room bookings → Database helper: reads and updates (evidence: `pages/bookings.py`)
- Room bookings → Searchable tables: filters list (evidence: `pages/bookings.py`)
- Booking checkout → Database helper: completes booking (evidence: `pages/checkout.py`)
- Payment records → Database helper: reads and updates (evidence: `pages/payments.py`)
- Payment records → Searchable tables: filters list (evidence: `pages/payments.py`)
- Pending dues → Database helper: reads payment data (evidence: `pages/pending_dues.py`)
- Complaint handling → Database helper: reads and updates (evidence: `pages/complaints.py`)
- Complaint handling → Searchable tables: filters list (evidence: `pages/complaints.py`)
- Admin reset → Database helper: uses database (evidence: `pages/admin_rest.py`)
- Database helper → MySQL database: queries and writes (evidence: `utils/db.py`)
- Database schema → MySQL database: sets up schema (evidence: `README.md`)
