# prathamesh13-n/pbl-sem-iv- architecture

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

- Interactive diagram: https://gitdiagram.com/prathamesh13-n/pbl-sem-iv-
- Repository: https://github.com/prathamesh13-n/pbl-sem-iv-

## Overview

SmartPark Pro is a parking-session management application with user and admin workflows, vehicle and plan management, live slot information, and overtime fines/notifications. The principal workflow is a user registering or signing in, recording a parking session for a vehicle, then ending it or paying a fine; admins monitor sessions and can intervene. The backend excerpts show persistence, authentication, scheduled jobs, and WebSocket broadcasts. The frontend source was read but not excerpted, so its API connections are left unverified.

Main entry points: [`backend/main.py`](https://github.com/prathamesh13-n/pbl-sem-iv-/blob/main/backend/main.py) (FastAPI application), [`backend/database.py`](https://github.com/prathamesh13-n/pbl-sem-iv-/blob/main/backend/database.py) (SQLite database), [`backend/routes/auth.py`](https://github.com/prathamesh13-n/pbl-sem-iv-/blob/main/backend/routes/auth.py) (Accounts and login), [`backend/routes/parkings.py`](https://github.com/prathamesh13-n/pbl-sem-iv-/blob/main/backend/routes/parkings.py) (Parking sessions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client"]
  node_frontend["Web interface<br/>[app.js]"]
end

subgraph group_api["API workflows"]
  node_application["FastAPI application<br/>[main.py]"]
  node_account["Accounts and login<br/>[auth.py]"]
  node_vehicle["Vehicle management<br/>[vehicles.py]"]
  node_parking["Parking sessions<br/>[parkings.py]"]
  node_slotmap["Slot map<br/>[slots.py]"]
  node_admin["Admin operations<br/>[admin.py]"]
  node_plans["Premium and family plans<br/>[premium.py]"]
end

subgraph group_services["Shared services"]
  node_scheduler["Overtime jobs<br/>[scheduler.py]"]
  node_websocket["Live event manager<br/>[ws_manager.py]"]
  node_security["JWT and password security<br/>[auth.py]"]
  node_parkingrules["Overtime calculations<br/>[utils.py]"]
  node_schemas["Request and response models<br/>[schemas.py]"]
end

subgraph group_data["Domain and storage"]
  node_entities["Domain entities<br/>[models.py]"]
  node_database[("SQLite database<br/>[database.py]")]
end

node_driver(("Driver"))
node_administrator(("Administrator"))

node_driver -.->|"uses"| node_frontend
node_administrator -.->|"uses"| node_frontend
node_frontend -.->|"calls API"| node_application
node_application -->|"registers"| node_account
node_application -->|"registers"| node_vehicle
node_application -->|"registers"| node_parking
node_application -->|"registers"| node_slotmap
node_application -->|"registers"| node_admin
node_application -->|"registers"| node_plans
node_application -->|"schedules jobs"| node_scheduler
node_application -->|"creates tables"| node_entities
node_account -->|"creates tokens"| node_security
node_account -->|"queries users"| node_database
node_account -->|"uses users"| node_entities
node_parking -->|"queries sessions"| node_database
node_parking -->|"uses sessions"| node_entities
node_parking -->|"broadcasts events"| node_websocket
node_scheduler -->|"queries sessions"| node_database
node_scheduler -->|"calculates overtime"| node_parkingrules
node_scheduler -->|"broadcasts alerts"| node_websocket
node_entities -->|"uses ORM base"| node_database
node_application -->|"creates tables"| node_database
node_admin -->|"requires admin"| node_security
node_parking -->|"requires user"| node_security
node_account -->|"validates requests"| node_schemas
node_admin -->|"shapes responses"| node_schemas
node_plans -->|"updates plans"| node_database

click node_frontend "https://github.com/prathamesh13-n/pbl-sem-iv-/blob/main/frontend/app.js"
click node_application "https://github.com/prathamesh13-n/pbl-sem-iv-/blob/main/backend/main.py"
click node_account "https://github.com/prathamesh13-n/pbl-sem-iv-/blob/main/backend/routes/auth.py"
click node_vehicle "https://github.com/prathamesh13-n/pbl-sem-iv-/blob/main/backend/routes/vehicles.py"
click node_parking "https://github.com/prathamesh13-n/pbl-sem-iv-/blob/main/backend/routes/parkings.py"
click node_slotmap "https://github.com/prathamesh13-n/pbl-sem-iv-/blob/main/backend/routes/slots.py"
click node_admin "https://github.com/prathamesh13-n/pbl-sem-iv-/blob/main/backend/routes/admin.py"
click node_plans "https://github.com/prathamesh13-n/pbl-sem-iv-/blob/main/backend/routes/premium.py"
click node_scheduler "https://github.com/prathamesh13-n/pbl-sem-iv-/blob/main/backend/scheduler.py"
click node_websocket "https://github.com/prathamesh13-n/pbl-sem-iv-/blob/main/backend/ws_manager.py"
click node_security "https://github.com/prathamesh13-n/pbl-sem-iv-/blob/main/backend/auth.py"
click node_parkingrules "https://github.com/prathamesh13-n/pbl-sem-iv-/blob/main/backend/utils.py"
click node_schemas "https://github.com/prathamesh13-n/pbl-sem-iv-/blob/main/backend/schemas.py"
click node_entities "https://github.com/prathamesh13-n/pbl-sem-iv-/blob/main/backend/models.py"
click node_database "https://github.com/prathamesh13-n/pbl-sem-iv-/blob/main/backend/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_frontend toneBlue
class node_application,node_account,node_vehicle,node_parking,node_slotmap,node_admin,node_plans toneAmber
class node_scheduler,node_websocket,node_security,node_parkingrules,node_schemas toneMint
class node_entities,node_database toneRose
class node_driver,node_administrator toneIndigo
```

## Components

### Client

- [Web interface](https://github.com/prathamesh13-n/pbl-sem-iv-/blob/main/frontend/app.js): `frontend/app.js`

### API workflows

- [FastAPI application](https://github.com/prathamesh13-n/pbl-sem-iv-/blob/main/backend/main.py): `backend/main.py`
- [Accounts and login](https://github.com/prathamesh13-n/pbl-sem-iv-/blob/main/backend/routes/auth.py): `backend/routes/auth.py`
- [Vehicle management](https://github.com/prathamesh13-n/pbl-sem-iv-/blob/main/backend/routes/vehicles.py): `backend/routes/vehicles.py`
- [Parking sessions](https://github.com/prathamesh13-n/pbl-sem-iv-/blob/main/backend/routes/parkings.py): `backend/routes/parkings.py`
- [Slot map](https://github.com/prathamesh13-n/pbl-sem-iv-/blob/main/backend/routes/slots.py): `backend/routes/slots.py`
- [Admin operations](https://github.com/prathamesh13-n/pbl-sem-iv-/blob/main/backend/routes/admin.py): `backend/routes/admin.py`
- [Premium and family plans](https://github.com/prathamesh13-n/pbl-sem-iv-/blob/main/backend/routes/premium.py): `backend/routes/premium.py`

### Shared services

- [Overtime jobs](https://github.com/prathamesh13-n/pbl-sem-iv-/blob/main/backend/scheduler.py): `backend/scheduler.py`
- [Live event manager](https://github.com/prathamesh13-n/pbl-sem-iv-/blob/main/backend/ws_manager.py): `backend/ws_manager.py`
- [JWT and password security](https://github.com/prathamesh13-n/pbl-sem-iv-/blob/main/backend/auth.py): `backend/auth.py`
- [Overtime calculations](https://github.com/prathamesh13-n/pbl-sem-iv-/blob/main/backend/utils.py): `backend/utils.py`
- [Request and response models](https://github.com/prathamesh13-n/pbl-sem-iv-/blob/main/backend/schemas.py): `backend/schemas.py`

### Domain and storage

- [Domain entities](https://github.com/prathamesh13-n/pbl-sem-iv-/blob/main/backend/models.py): `backend/models.py`
- [SQLite database](https://github.com/prathamesh13-n/pbl-sem-iv-/blob/main/backend/database.py): `backend/database.py`

### Other components

- **Driver**
- **Administrator**

## Connections

- Driver → Web interface: uses
- Administrator → Web interface: uses
- Web interface → FastAPI application: calls API
- FastAPI application → Accounts and login: registers (evidence: `backend/main.py`)
- FastAPI application → Vehicle management: registers (evidence: `backend/main.py`)
- FastAPI application → Parking sessions: registers (evidence: `backend/main.py`)
- FastAPI application → Slot map: registers (evidence: `backend/main.py`)
- FastAPI application → Admin operations: registers (evidence: `backend/main.py`)
- FastAPI application → Premium and family plans: registers (evidence: `backend/main.py`)
- FastAPI application → Overtime jobs: schedules jobs (evidence: `backend/main.py`)
- FastAPI application → Domain entities: creates tables (evidence: `backend/main.py`)
- Accounts and login → JWT and password security: creates tokens (evidence: `backend/routes/auth.py`)
- Accounts and login → SQLite database: queries users (evidence: `backend/routes/auth.py`)
- Accounts and login → Domain entities: uses users (evidence: `backend/routes/auth.py`)
- Parking sessions → SQLite database: queries sessions (evidence: `backend/routes/parkings.py`)
- Parking sessions → Domain entities: uses sessions (evidence: `backend/routes/parkings.py`)
- Parking sessions → Live event manager: broadcasts events (evidence: `backend/routes/parkings.py`)
- Overtime jobs → SQLite database: queries sessions (evidence: `backend/scheduler.py`)
- Overtime jobs → Overtime calculations: calculates overtime (evidence: `backend/scheduler.py`)
- Overtime jobs → Live event manager: broadcasts alerts (evidence: `backend/scheduler.py`)
- Domain entities → SQLite database: uses ORM base (evidence: `backend/models.py`)
- FastAPI application → SQLite database: creates tables (evidence: `backend/main.py`)
- Admin operations → JWT and password security: requires admin (evidence: `backend/routes/admin.py`)
- Parking sessions → JWT and password security: requires user (evidence: `backend/routes/parkings.py`)
- Accounts and login → Request and response models: validates requests (evidence: `backend/routes/auth.py`)
- Admin operations → Request and response models: shapes responses (evidence: `backend/routes/admin.py`)
- Premium and family plans → SQLite database: updates plans (evidence: `backend/routes/premium.py`)
