# sumithatagaledata/ai-based-smart-parking architecture

> Architecture diagram of the GitHub repository sumithatagaledata/ai-based-smart-parking, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sumithatagaledata/ai-based-smart-parking
- Repository: https://github.com/sumithatagaledata/ai-based-smart-parking

## Overview

Smart Parking Management System is a FastAPI/SQLite application with a browser SPA. The principal journey is customer sign-in, slot discovery and advance reservation, followed by route guidance to the assigned bay; administrators manage parking operations and monitor bookings. The backend also supports vehicle entry/exit, allocation, search, road-network routing and a DSA learning lab. Edges reflect calls documented in excerpts or README claims; UI-to-API wiring and several unsampled endpoint details are not asserted.

Main entry points: [`main.py`](https://github.com/sumithatagaledata/ai-based-smart-parking/blob/main/main.py) (FastAPI routes), [`services/parking_service.py`](https://github.com/sumithatagaledata/ai-based-smart-parking/blob/main/services/parking_service.py) (Parking operations), [`database/db.py`](https://github.com/sumithatagaledata/ai-based-smart-parking/blob/main/database/db.py) (SQLite store), [`static/js/app.js`](https://github.com/sumithatagaledata/ai-based-smart-parking/blob/main/static/js/app.js) (Parking SPA)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Browser experience"]
  node_spa["Parking SPA<br/>[app.js]"]
  node_ui_components["UI components<br/>[components.js]"]
  node_map["Parking map<br/>[parking_map.js]"]
  node_lab_ui["Algorithm lab UI<br/>[algo_lab.js]"]
  node_api_client["API client<br/>[api.js]"]
end

subgraph group_api["API and services"]
  node_server["FastAPI routes<br/>[main.py]"]
  node_auth["Authentication<br/>[auth_service.py]"]
  node_security["Security primitives<br/>[security.py]"]
  node_booking["Advance bookings<br/>[booking_service.py]"]
  node_parking["Parking operations<br/>[parking_service.py]"]
  node_search["Search indexing<br/>[search_service.py]"]
  node_routing["Navigation service<br/>[graph_service.py]"]
  node_lab["DSA lab service<br/>[lab_service.py]"]
end

subgraph group_state["Persistent state"]
  node_sqlite[("SQLite store<br/>[db.py]")]
  node_seed["Demo data<br/>[seed_data.py]"]
end

subgraph group_dsa["DSA capabilities"]
  node_linear["Linear structures<br/>[linear.py]"]
  node_trees["Trees and heaps<br/>[trees.py]"]
  node_hash["Hash table<br/>[hash_table.py]"]
  node_algorithms["Algorithms<br/>[algorithms.py]"]
  node_graph["Weighted graph<br/>[graph.py]"]
  node_complexity["Complexity analysis<br/>[complexity.py]"]
end

node_customer(("Customer / admin"))

node_customer -.->|"uses"| node_spa
node_spa -.->|"renders"| node_ui_components
node_spa -.->|"requests"| node_api_client
node_spa -.->|"shows routes"| node_map
node_spa -.->|"opens lab"| node_lab_ui
node_api_client -.->|"calls API"| node_server
node_server -->|"calls"| node_auth
node_server -->|"calls"| node_booking
node_server -->|"calls"| node_parking
node_server -->|"rebuilds indices"| node_search
node_server -->|"calls"| node_routing
node_server -.->|"dispatches"| node_lab
node_auth -->|"uses"| node_security
node_auth -->|"reads/writes"| node_sqlite
node_security -->|"stores sessions"| node_sqlite
node_booking -->|"reads/writes"| node_sqlite
node_booking -->|"gets directions"| node_routing
node_parking -->|"reads/writes"| node_sqlite
node_parking -.->|"uses"| node_linear
node_parking -.->|"uses"| node_trees
node_parking -.->|"uses"| node_algorithms
node_parking -.->|"uses"| node_graph
node_search -->|"loads records"| node_sqlite
node_search -->|"indexes"| node_hash
node_search -->|"indexes"| node_trees
node_routing -->|"loads network"| node_sqlite
node_routing -->|"routes on"| node_graph
node_lab -.->|"runs"| node_algorithms
node_lab -.->|"analyzes"| node_complexity
node_seed -->|"populates"| node_sqlite

click node_spa "https://github.com/sumithatagaledata/ai-based-smart-parking/blob/main/static/js/app.js"
click node_ui_components "https://github.com/sumithatagaledata/ai-based-smart-parking/blob/main/static/js/components.js"
click node_map "https://github.com/sumithatagaledata/ai-based-smart-parking/blob/main/static/js/parking_map.js"
click node_lab_ui "https://github.com/sumithatagaledata/ai-based-smart-parking/blob/main/static/js/algo_lab.js"
click node_api_client "https://github.com/sumithatagaledata/ai-based-smart-parking/blob/main/static/js/api.js"
click node_server "https://github.com/sumithatagaledata/ai-based-smart-parking/blob/main/main.py"
click node_auth "https://github.com/sumithatagaledata/ai-based-smart-parking/blob/main/services/auth_service.py"
click node_security "https://github.com/sumithatagaledata/ai-based-smart-parking/blob/main/services/security.py"
click node_booking "https://github.com/sumithatagaledata/ai-based-smart-parking/blob/main/services/booking_service.py"
click node_parking "https://github.com/sumithatagaledata/ai-based-smart-parking/blob/main/services/parking_service.py"
click node_search "https://github.com/sumithatagaledata/ai-based-smart-parking/blob/main/services/search_service.py"
click node_routing "https://github.com/sumithatagaledata/ai-based-smart-parking/blob/main/services/graph_service.py"
click node_lab "https://github.com/sumithatagaledata/ai-based-smart-parking/blob/main/services/lab_service.py"
click node_sqlite "https://github.com/sumithatagaledata/ai-based-smart-parking/blob/main/database/db.py"
click node_seed "https://github.com/sumithatagaledata/ai-based-smart-parking/blob/main/database/seed_data.py"
click node_linear "https://github.com/sumithatagaledata/ai-based-smart-parking/blob/main/dsa/linear.py"
click node_trees "https://github.com/sumithatagaledata/ai-based-smart-parking/blob/main/dsa/trees.py"
click node_hash "https://github.com/sumithatagaledata/ai-based-smart-parking/blob/main/dsa/hash_table.py"
click node_algorithms "https://github.com/sumithatagaledata/ai-based-smart-parking/blob/main/dsa/algorithms.py"
click node_graph "https://github.com/sumithatagaledata/ai-based-smart-parking/blob/main/dsa/graph.py"
click node_complexity "https://github.com/sumithatagaledata/ai-based-smart-parking/blob/main/dsa/complexity.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_spa,node_ui_components,node_map,node_lab_ui,node_api_client toneBlue
class node_server,node_auth,node_security,node_booking,node_parking,node_search,node_routing,node_lab toneAmber
class node_sqlite,node_seed toneMint
class node_linear,node_trees,node_hash,node_algorithms,node_graph,node_complexity toneRose
class node_customer toneIndigo
```

## Components

### Browser experience

- [Parking SPA](https://github.com/sumithatagaledata/ai-based-smart-parking/blob/main/static/js/app.js): `static/js/app.js`
- [UI components](https://github.com/sumithatagaledata/ai-based-smart-parking/blob/main/static/js/components.js): `static/js/components.js`
- [Parking map](https://github.com/sumithatagaledata/ai-based-smart-parking/blob/main/static/js/parking_map.js): `static/js/parking_map.js`
- [Algorithm lab UI](https://github.com/sumithatagaledata/ai-based-smart-parking/blob/main/static/js/algo_lab.js): `static/js/algo_lab.js`
- [API client](https://github.com/sumithatagaledata/ai-based-smart-parking/blob/main/static/js/api.js): `static/js/api.js`

### API and services

- [FastAPI routes](https://github.com/sumithatagaledata/ai-based-smart-parking/blob/main/main.py): `main.py`
- [Authentication](https://github.com/sumithatagaledata/ai-based-smart-parking/blob/main/services/auth_service.py): `services/auth_service.py`
- [Security primitives](https://github.com/sumithatagaledata/ai-based-smart-parking/blob/main/services/security.py): `services/security.py`
- [Advance bookings](https://github.com/sumithatagaledata/ai-based-smart-parking/blob/main/services/booking_service.py): `services/booking_service.py`
- [Parking operations](https://github.com/sumithatagaledata/ai-based-smart-parking/blob/main/services/parking_service.py): `services/parking_service.py`
- [Search indexing](https://github.com/sumithatagaledata/ai-based-smart-parking/blob/main/services/search_service.py): `services/search_service.py`
- [Navigation service](https://github.com/sumithatagaledata/ai-based-smart-parking/blob/main/services/graph_service.py): `services/graph_service.py`
- [DSA lab service](https://github.com/sumithatagaledata/ai-based-smart-parking/blob/main/services/lab_service.py): `services/lab_service.py`

### Persistent state

- [SQLite store](https://github.com/sumithatagaledata/ai-based-smart-parking/blob/main/database/db.py): `database/db.py`
- [Demo data](https://github.com/sumithatagaledata/ai-based-smart-parking/blob/main/database/seed_data.py): `database/seed_data.py`

### DSA capabilities

- [Linear structures](https://github.com/sumithatagaledata/ai-based-smart-parking/blob/main/dsa/linear.py): `dsa/linear.py`
- [Trees and heaps](https://github.com/sumithatagaledata/ai-based-smart-parking/blob/main/dsa/trees.py): `dsa/trees.py`
- [Hash table](https://github.com/sumithatagaledata/ai-based-smart-parking/blob/main/dsa/hash_table.py): `dsa/hash_table.py`
- [Algorithms](https://github.com/sumithatagaledata/ai-based-smart-parking/blob/main/dsa/algorithms.py): `dsa/algorithms.py`
- [Weighted graph](https://github.com/sumithatagaledata/ai-based-smart-parking/blob/main/dsa/graph.py): `dsa/graph.py`
- [Complexity analysis](https://github.com/sumithatagaledata/ai-based-smart-parking/blob/main/dsa/complexity.py): `dsa/complexity.py`

### Other components

- **Customer / admin**

## Connections

- Customer / admin → Parking SPA: uses (evidence: `README.md`)
- Parking SPA → UI components: renders
- Parking SPA → API client: requests
- Parking SPA → Parking map: shows routes
- Parking SPA → Algorithm lab UI: opens lab
- API client → FastAPI routes: calls API
- FastAPI routes → Authentication: calls (evidence: `main.py`)
- FastAPI routes → Advance bookings: calls (evidence: `main.py`)
- FastAPI routes → Parking operations: calls (evidence: `main.py`)
- FastAPI routes → Search indexing: rebuilds indices (evidence: `main.py`)
- FastAPI routes → Navigation service: calls (evidence: `main.py`)
- FastAPI routes → DSA lab service: dispatches (evidence: `main.py`)
- Authentication → Security primitives: uses (evidence: `services/auth_service.py`)
- Authentication → SQLite store: reads/writes (evidence: `services/auth_service.py`)
- Security primitives → SQLite store: stores sessions (evidence: `services/security.py`)
- Advance bookings → SQLite store: reads/writes (evidence: `services/booking_service.py`)
- Advance bookings → Navigation service: gets directions (evidence: `README.md`)
- Parking operations → SQLite store: reads/writes (evidence: `services/parking_service.py`)
- Parking operations → Linear structures: uses (evidence: `services/parking_service.py`)
- Parking operations → Trees and heaps: uses (evidence: `services/parking_service.py`)
- Parking operations → Algorithms: uses (evidence: `services/parking_service.py`)
- Parking operations → Weighted graph: uses (evidence: `services/parking_service.py`)
- Search indexing → SQLite store: loads records (evidence: `services/search_service.py`)
- Search indexing → Hash table: indexes (evidence: `services/search_service.py`)
- Search indexing → Trees and heaps: indexes (evidence: `services/search_service.py`)
- Navigation service → SQLite store: loads network (evidence: `services/graph_service.py`)
- Navigation service → Weighted graph: routes on (evidence: `services/graph_service.py`)
- DSA lab service → Algorithms: runs (evidence: `services/lab_service.py`)
- DSA lab service → Complexity analysis: analyzes
- Demo data → SQLite store: populates (evidence: `database/seed_data.py`)
