# sivaraam-official/studenthub architecture

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

- Interactive diagram: https://gitdiagram.com/sivaraam-official/studenthub
- Repository: https://github.com/sivaraam-official/studenthub

## Overview

StudentHub is a student-records management application: staff use a browser dashboard to register, search, inspect, update, and delete students, and view course statistics and system health. The frontend calls FastAPI endpoints; request schemas validate records, CRUD functions perform queries and persistence, and SQLAlchemy maps student records to SQLite. The README documents pagination, filtering, profile and confirmation modals, and dashboard analytics. Some frontend and health-handler details are only partially excerpted, so the graph omits unverified internal links.

Main entry points: [`app/routers/students.py`](https://github.com/sivaraam-official/studenthub/blob/main/app/routers/students.py) (Student endpoints), [`app/routers/stats.py`](https://github.com/sivaraam-official/studenthub/blob/main/app/routers/stats.py) (Stats and health), [`app/crud.py`](https://github.com/sivaraam-official/studenthub/blob/main/app/crud.py) (Student operations), [`app/database.py`](https://github.com/sivaraam-official/studenthub/blob/main/app/database.py) (Database sessions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Dashboard"]
  node_dashboard["Dashboard UI<br/>[index.html]"]
  node_ui_logic["Dashboard behavior<br/>[app.js]"]
  node_api_client["API client<br/>[api.js]"]
  node_api_config["API configuration<br/>[config.js]"]
end

subgraph group_api["API"]
  node_app["FastAPI app<br/>[main.py]"]
  node_student_routes["Student endpoints<br/>[students.py]"]
  node_stats_routes["Stats and health<br/>[stats.py]"]
end

subgraph group_domain["Student Domain"]
  node_validation["Request schemas<br/>[schemas.py]"]
  node_student_crud["Student operations<br/>[crud.py]"]
  node_student_model["Student ORM model<br/>[models.py]"]
end

subgraph group_persistence["Persistence"]
  node_db_config["Database sessions<br/>[database.py]"]
  node_sqlite[("SQLite database")]
end

node_staff(("Staff user"))

node_staff -->|"uses"| node_dashboard
node_dashboard -->|"hosts"| node_ui_logic
node_ui_logic -->|"calls"| node_api_client
node_api_client -.->|"uses"| node_api_config
node_api_client -->|"requests students"| node_student_routes
node_api_client -->|"requests stats and health"| node_stats_routes
node_app -->|"registers"| node_student_routes
node_app -->|"registers"| node_stats_routes
node_app -->|"initializes database"| node_db_config
node_app -->|"seeds records"| node_student_crud
node_student_routes -->|"calls"| node_student_crud
node_student_routes -->|"validates and serializes"| node_validation
node_stats_routes -->|"gets statistics"| node_student_crud
node_stats_routes -->|"counts records"| node_student_model
node_student_routes -->|"gets sessions"| node_db_config
node_stats_routes -->|"gets sessions"| node_db_config
node_student_crud -->|"queries and mutates"| node_student_model
node_student_model -->|"inherits mapping base"| node_db_config
node_db_config -->|"configures engine"| node_sqlite
node_student_crud -->|"reads and writes"| node_sqlite

click node_dashboard "https://github.com/sivaraam-official/studenthub/blob/main/frontend/index.html"
click node_ui_logic "https://github.com/sivaraam-official/studenthub/blob/main/frontend/js/app.js"
click node_api_client "https://github.com/sivaraam-official/studenthub/blob/main/frontend/js/api.js"
click node_api_config "https://github.com/sivaraam-official/studenthub/blob/main/frontend/js/config.js"
click node_app "https://github.com/sivaraam-official/studenthub/blob/main/app/main.py"
click node_student_routes "https://github.com/sivaraam-official/studenthub/blob/main/app/routers/students.py"
click node_stats_routes "https://github.com/sivaraam-official/studenthub/blob/main/app/routers/stats.py"
click node_validation "https://github.com/sivaraam-official/studenthub/blob/main/app/schemas.py"
click node_student_crud "https://github.com/sivaraam-official/studenthub/blob/main/app/crud.py"
click node_student_model "https://github.com/sivaraam-official/studenthub/blob/main/app/models.py"
click node_db_config "https://github.com/sivaraam-official/studenthub/blob/main/app/database.py"

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_ui_logic,node_api_client,node_api_config,node_staff toneBlue
class node_app,node_student_routes,node_stats_routes toneAmber
class node_validation,node_student_crud,node_student_model toneMint
class node_db_config,node_sqlite toneRose
```

## Components

### Dashboard

- [Dashboard UI](https://github.com/sivaraam-official/studenthub/blob/main/frontend/index.html): `frontend/index.html`
- [Dashboard behavior](https://github.com/sivaraam-official/studenthub/blob/main/frontend/js/app.js): `frontend/js/app.js`
- [API client](https://github.com/sivaraam-official/studenthub/blob/main/frontend/js/api.js): `frontend/js/api.js`
- [API configuration](https://github.com/sivaraam-official/studenthub/blob/main/frontend/js/config.js): `frontend/js/config.js`

### API

- [FastAPI app](https://github.com/sivaraam-official/studenthub/blob/main/app/main.py): `app/main.py`
- [Student endpoints](https://github.com/sivaraam-official/studenthub/blob/main/app/routers/students.py): `app/routers/students.py`
- [Stats and health](https://github.com/sivaraam-official/studenthub/blob/main/app/routers/stats.py): `app/routers/stats.py`

### Student Domain

- [Request schemas](https://github.com/sivaraam-official/studenthub/blob/main/app/schemas.py): `app/schemas.py`
- [Student operations](https://github.com/sivaraam-official/studenthub/blob/main/app/crud.py): `app/crud.py`
- [Student ORM model](https://github.com/sivaraam-official/studenthub/blob/main/app/models.py): `app/models.py`

### Persistence

- [Database sessions](https://github.com/sivaraam-official/studenthub/blob/main/app/database.py): `app/database.py`
- **SQLite database**

### Other components

- **Staff user**

## Connections

- Staff user → Dashboard UI: uses (evidence: `README.md`)
- Dashboard UI → Dashboard behavior: hosts (evidence: `README.md`)
- Dashboard behavior → API client: calls (evidence: `frontend/js/app.js`)
- API client → API configuration: uses
- API client → Student endpoints: requests students (evidence: `frontend/js/api.js`)
- API client → Stats and health: requests stats and health (evidence: `frontend/js/api.js`)
- FastAPI app → Student endpoints: registers (evidence: `app/main.py`)
- FastAPI app → Stats and health: registers (evidence: `app/main.py`)
- FastAPI app → Database sessions: initializes database (evidence: `app/main.py`)
- FastAPI app → Student operations: seeds records (evidence: `app/main.py`)
- Student endpoints → Student operations: calls (evidence: `app/routers/students.py`)
- Student endpoints → Request schemas: validates and serializes (evidence: `app/routers/students.py`)
- Stats and health → Student operations: gets statistics (evidence: `app/routers/stats.py`)
- Stats and health → Student ORM model: counts records (evidence: `app/routers/stats.py`)
- Student endpoints → Database sessions: gets sessions (evidence: `app/routers/students.py`)
- Stats and health → Database sessions: gets sessions (evidence: `app/routers/stats.py`)
- Student operations → Student ORM model: queries and mutates (evidence: `app/crud.py`)
- Student ORM model → Database sessions: inherits mapping base (evidence: `app/models.py`)
- Database sessions → SQLite database: configures engine (evidence: `app/database.py`)
- Student operations → SQLite database: reads and writes (evidence: `app/crud.py`)
