# samueldevadass/smart-parking-management-system architecture

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

- Interactive diagram: https://gitdiagram.com/samueldevadass/smart-parking-management-system
- Repository: https://github.com/samueldevadass/smart-parking-management-system

## Overview

This is a distributed smart-parking web app: staff select a wing and spot, detect or enter a plate, record owner and entry/exit details, then retrieve a bill. The browser sends camera frames through the Go API layer to a FastAPI detection service; parking operations and persistence are documented in Go and PostgreSQL, with capture images stored in Supabase. The README documents the Go API’s database and proxy roles, but sampled Go handlers do not expose their internal call wiring, so those details are not asserted.

Main entry points: [`frontend/src/App.jsx`](https://github.com/samueldevadass/smart-parking-management-system/blob/main/frontend/src/App.jsx) (Workflow Shell), [`backend_go/handlers`](https://github.com/samueldevadass/smart-parking-management-system/tree/main/backend_go/handlers) (Parking Handlers), [`backend_go/main.go`](https://github.com/samueldevadass/smart-parking-management-system/blob/main/backend_go/main.go) (REST API), [`backend/services/detection.py`](https://github.com/samueldevadass/smart-parking-management-system/blob/main/backend/services/detection.py) (Detection State)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_browser["Parking Console"]
  node_app["Workflow Shell<br/>[App.jsx]"]
  node_wing["Wing Selection<br/>[SelectWingPage.jsx]"]
  node_spots["Spot Availability<br/>[EmptySpotsPage.jsx]"]
  node_detectpage["Plate Detection<br/>[DetectionPage.jsx]"]
  node_platechip["Plate Display<br/>[PlateChip.jsx]"]
  node_owner["Owner Details"]
  node_entryexit["Entry Exit<br/>[EntryExitPage.jsx]"]
  node_billing["Billing<br/>[BillingPage.jsx]"]
  node_stepbar["Progress Steps<br/>[StepBar.jsx]"]
  node_api_client["API Client<br/>[client.js]"]
end

subgraph group_api["Go API"]
  node_goapi["REST API<br/>[main.go]"]
  node_handlers["Parking Handlers"]
  node_models["Request Models<br/>[models.go]"]
  node_billing_service["Billing Service<br/>[billing.go]"]
  node_fastapi["AI Reverse Proxy<br/>[detection.go]"]
end

subgraph group_ai["Detection Service"]
  node_pyapp["FastAPI App<br/>[main.py]"]
  node_det_routes["Detection Routes<br/>[detection.py]"]
  node_video_routes["Video Route<br/>[video.py]"]
  node_detection_service["Detection State<br/>[detection.py]"]
  node_detector["YOLO OCR Pipeline"]
  node_folder_service["Capture Uploads"]
end

subgraph group_data["Persistence"]
  node_repository["Database Repository<br/>[db.go]"]
  node_blob_service["Capture Blob Service<br/>[blob_service_s3.go]"]
  node_database[("PostgreSQL")]
  node_supabase[("Supabase Blob Storage")]
end

node_staff(("Parking Staff"))

node_staff -->|"uses"| node_app
node_app -->|"renders"| node_wing
node_app -->|"renders"| node_spots
node_app -->|"renders"| node_detectpage
node_app -->|"renders"| node_owner
node_app -->|"renders"| node_entryexit
node_app -->|"renders"| node_billing
node_app -->|"renders"| node_stepbar
node_detectpage -->|"calls"| node_api_client
node_detectpage -->|"renders"| node_platechip
node_api_client -->|"requests"| node_goapi
node_goapi -->|"routes"| node_handlers
node_goapi -->|"proxies AI"| node_fastapi
node_handlers -.->|"uses models"| node_models
node_handlers -.->|"accesses data"| node_repository
node_handlers -.->|"billing operations"| node_billing_service
node_handlers -.->|"capture storage"| node_blob_service
node_goapi -->|"uses PGX"| node_database
node_blob_service -->|"stores captures"| node_supabase
node_pyapp -->|"registers"| node_det_routes
node_pyapp -->|"registers"| node_video_routes
node_det_routes -->|"calls"| node_detection_service
node_det_routes -->|"uploads via"| node_folder_service
node_video_routes -->|"reads frames"| node_detection_service
node_detection_service -->|"delegates"| node_detector
node_folder_service -->|"reads status"| node_detection_service
node_folder_service -->|"uploads images"| node_supabase

click node_app "https://github.com/samueldevadass/smart-parking-management-system/blob/main/frontend/src/App.jsx"
click node_wing "https://github.com/samueldevadass/smart-parking-management-system/blob/main/frontend/src/pages/SelectWingPage.jsx"
click node_spots "https://github.com/samueldevadass/smart-parking-management-system/blob/main/frontend/src/pages/EmptySpotsPage.jsx"
click node_detectpage "https://github.com/samueldevadass/smart-parking-management-system/blob/main/frontend/src/pages/DetectionPage.jsx"
click node_platechip "https://github.com/samueldevadass/smart-parking-management-system/blob/main/frontend/src/components/PlateChip.jsx"
click node_owner "https://github.com/samueldevadass/smart-parking-management-system/blob/main/frontend/src/pages/OwnerDetailsPage.jsx"
click node_entryexit "https://github.com/samueldevadass/smart-parking-management-system/blob/main/frontend/src/pages/EntryExitPage.jsx"
click node_billing "https://github.com/samueldevadass/smart-parking-management-system/blob/main/frontend/src/pages/BillingPage.jsx"
click node_stepbar "https://github.com/samueldevadass/smart-parking-management-system/blob/main/frontend/src/components/StepBar.jsx"
click node_api_client "https://github.com/samueldevadass/smart-parking-management-system/blob/main/frontend/src/api/client.js"
click node_goapi "https://github.com/samueldevadass/smart-parking-management-system/blob/main/backend_go/main.go"
click node_handlers "https://github.com/samueldevadass/smart-parking-management-system/tree/main/backend_go/handlers"
click node_models "https://github.com/samueldevadass/smart-parking-management-system/blob/main/backend_go/models/models.go"
click node_repository "https://github.com/samueldevadass/smart-parking-management-system/blob/main/backend_go/repositories/db.go"
click node_billing_service "https://github.com/samueldevadass/smart-parking-management-system/blob/main/backend_go/services/billing.go"
click node_blob_service "https://github.com/samueldevadass/smart-parking-management-system/blob/main/backend_go/services/blob_service_s3.go"
click node_fastapi "https://github.com/samueldevadass/smart-parking-management-system/blob/main/backend_go/handlers/detection.go"
click node_pyapp "https://github.com/samueldevadass/smart-parking-management-system/blob/main/backend/main.py"
click node_det_routes "https://github.com/samueldevadass/smart-parking-management-system/blob/main/backend/routers/detection.py"
click node_video_routes "https://github.com/samueldevadass/smart-parking-management-system/blob/main/backend/routers/video.py"
click node_detection_service "https://github.com/samueldevadass/smart-parking-management-system/blob/main/backend/services/detection.py"
click node_detector "https://github.com/samueldevadass/smart-parking-management-system/blob/main/backend/LicensePlateDetector.py"
click node_folder_service "https://github.com/samueldevadass/smart-parking-management-system/blob/main/backend/services/folder_path_service.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_app,node_wing,node_spots,node_detectpage,node_platechip,node_owner,node_entryexit,node_billing,node_stepbar,node_api_client toneBlue
class node_goapi,node_handlers,node_models,node_billing_service,node_fastapi toneAmber
class node_pyapp,node_det_routes,node_video_routes,node_detection_service,node_detector,node_folder_service toneMint
class node_repository,node_blob_service,node_database,node_supabase toneRose
class node_staff toneIndigo
```

## Components

### Parking Console

- [Workflow Shell](https://github.com/samueldevadass/smart-parking-management-system/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Wing Selection](https://github.com/samueldevadass/smart-parking-management-system/blob/main/frontend/src/pages/SelectWingPage.jsx): `frontend/src/pages/SelectWingPage.jsx`
- [Spot Availability](https://github.com/samueldevadass/smart-parking-management-system/blob/main/frontend/src/pages/EmptySpotsPage.jsx): `frontend/src/pages/EmptySpotsPage.jsx`
- [Plate Detection](https://github.com/samueldevadass/smart-parking-management-system/blob/main/frontend/src/pages/DetectionPage.jsx): `frontend/src/pages/DetectionPage.jsx`
- [Plate Display](https://github.com/samueldevadass/smart-parking-management-system/blob/main/frontend/src/components/PlateChip.jsx): `frontend/src/components/PlateChip.jsx`
- [Owner Details](https://github.com/samueldevadass/smart-parking-management-system/blob/main/frontend/src/pages/OwnerDetailsPage.jsx): `frontend/src/pages/OwnerDetailsPage.jsx`
- [Entry Exit](https://github.com/samueldevadass/smart-parking-management-system/blob/main/frontend/src/pages/EntryExitPage.jsx): `frontend/src/pages/EntryExitPage.jsx`
- [Billing](https://github.com/samueldevadass/smart-parking-management-system/blob/main/frontend/src/pages/BillingPage.jsx): `frontend/src/pages/BillingPage.jsx`
- [Progress Steps](https://github.com/samueldevadass/smart-parking-management-system/blob/main/frontend/src/components/StepBar.jsx): `frontend/src/components/StepBar.jsx`
- [API Client](https://github.com/samueldevadass/smart-parking-management-system/blob/main/frontend/src/api/client.js): `frontend/src/api/client.js`

### Go API

- [REST API](https://github.com/samueldevadass/smart-parking-management-system/blob/main/backend_go/main.go): `backend_go/main.go`
- [Parking Handlers](https://github.com/samueldevadass/smart-parking-management-system/tree/main/backend_go/handlers): `backend_go/handlers`
- [Request Models](https://github.com/samueldevadass/smart-parking-management-system/blob/main/backend_go/models/models.go): `backend_go/models/models.go`
- [Billing Service](https://github.com/samueldevadass/smart-parking-management-system/blob/main/backend_go/services/billing.go): `backend_go/services/billing.go`
- [AI Reverse Proxy](https://github.com/samueldevadass/smart-parking-management-system/blob/main/backend_go/handlers/detection.go): `backend_go/handlers/detection.go`

### Detection Service

- [FastAPI App](https://github.com/samueldevadass/smart-parking-management-system/blob/main/backend/main.py): `backend/main.py`
- [Detection Routes](https://github.com/samueldevadass/smart-parking-management-system/blob/main/backend/routers/detection.py): `backend/routers/detection.py`
- [Video Route](https://github.com/samueldevadass/smart-parking-management-system/blob/main/backend/routers/video.py): `backend/routers/video.py`
- [Detection State](https://github.com/samueldevadass/smart-parking-management-system/blob/main/backend/services/detection.py): `backend/services/detection.py`
- [YOLO OCR Pipeline](https://github.com/samueldevadass/smart-parking-management-system/blob/main/backend/LicensePlateDetector.py): `backend/LicensePlateDetector.py`
- [Capture Uploads](https://github.com/samueldevadass/smart-parking-management-system/blob/main/backend/services/folder_path_service.py): `backend/services/folder_path_service.py`

### Persistence

- [Database Repository](https://github.com/samueldevadass/smart-parking-management-system/blob/main/backend_go/repositories/db.go): `backend_go/repositories/db.go`
- [Capture Blob Service](https://github.com/samueldevadass/smart-parking-management-system/blob/main/backend_go/services/blob_service_s3.go): `backend_go/services/blob_service_s3.go`
- **PostgreSQL**
- **Supabase Blob Storage**

### Other components

- **Parking Staff**

## Connections

- Parking Staff → Workflow Shell: uses
- Workflow Shell → Wing Selection: renders (evidence: `frontend/src/App.jsx`)
- Workflow Shell → Spot Availability: renders (evidence: `frontend/src/App.jsx`)
- Workflow Shell → Plate Detection: renders (evidence: `frontend/src/App.jsx`)
- Workflow Shell → Owner Details: renders (evidence: `frontend/src/App.jsx`)
- Workflow Shell → Entry Exit: renders (evidence: `frontend/src/App.jsx`)
- Workflow Shell → Billing: renders (evidence: `frontend/src/App.jsx`)
- Workflow Shell → Progress Steps: renders (evidence: `frontend/src/App.jsx`)
- Plate Detection → API Client: calls (evidence: `frontend/src/pages/DetectionPage.jsx`)
- Plate Detection → Plate Display: renders (evidence: `frontend/src/pages/DetectionPage.jsx`)
- API Client → REST API: requests (evidence: `README.md`)
- REST API → Parking Handlers: routes (evidence: `README.md`)
- REST API → AI Reverse Proxy: proxies AI (evidence: `README.md`)
- Parking Handlers → Request Models: uses models
- Parking Handlers → Database Repository: accesses data
- Parking Handlers → Billing Service: billing operations
- Parking Handlers → Capture Blob Service: capture storage
- REST API → PostgreSQL: uses PGX (evidence: `README.md`)
- Capture Blob Service → Supabase Blob Storage: stores captures (evidence: `README.md`)
- FastAPI App → Detection Routes: registers (evidence: `backend/main.py`)
- FastAPI App → Video Route: registers (evidence: `backend/main.py`)
- Detection Routes → Detection State: calls (evidence: `backend/routers/detection.py`)
- Detection Routes → Capture Uploads: uploads via (evidence: `backend/routers/detection.py`)
- Video Route → Detection State: reads frames (evidence: `backend/routers/video.py`)
- Detection State → YOLO OCR Pipeline: delegates (evidence: `backend/services/detection.py`)
- Capture Uploads → Detection State: reads status (evidence: `backend/services/folder_path_service.py`)
- Capture Uploads → Supabase Blob Storage: uploads images (evidence: `backend/services/folder_path_service.py`)
