# unwtr/24ct2-nguyenminhvuong architecture

> Architecture diagram of the GitHub repository unwtr/24ct2-nguyenminhvuong, 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/unwtr/24ct2-nguyenminhvuong
- Repository: https://github.com/unwtr/24ct2-nguyenminhvuong

## Overview

Smart Parking AI is a Streamlit parking-management application with AI license-plate recognition, parking-session and slot management, user accounts, and payments. The main workflow routes a signed-in user to role-specific screens; camera input can pass through vehicle and plate recognition, while vehicle services manage check-in/out, slots, and fees. Admin screens additionally manage parking, users, approvals, payments, and settings; user screens cover profiles, vehicles, history, and payments. SQLite backs the services. Several UI relationships are supported by the SOURCE INDEX, but unsampled implementations were not inspected.

Main entry points: [`smart-parking/backend/services/vehicle_service.py`](https://github.com/unwtr/24ct2-nguyenminhvuong/blob/main/smart-parking/backend/services/vehicle_service.py) (Vehicle sessions), [`smart-parking/ui/admin/dashboard.py`](https://github.com/unwtr/24ct2-nguyenminhvuong/blob/main/smart-parking/ui/admin/dashboard.py) (Admin dashboard), [`smart-parking/ui/user/dashboard.py`](https://github.com/unwtr/24ct2-nguyenminhvuong/blob/main/smart-parking/ui/user/dashboard.py) (User dashboard), [`smart-parking/backend/database/db.py`](https://github.com/unwtr/24ct2-nguyenminhvuong/blob/main/smart-parking/backend/database/db.py) (Parking SQLite)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application routing"]
  node_app_entry["Streamlit entry<br/>[app.py]"]
  node_admin_ui["Admin dashboard<br/>[dashboard.py]"]
  node_admin_ops["Admin management<br/>[vehicles.py]"]
  node_user_ui["User dashboard<br/>[dashboard.py]"]
end

subgraph group_operations["Parking operations"]
  node_camera_ui["Camera capture<br/>[camera.py]"]
  node_ai_pipeline["Recognition pipeline<br/>[pipeline.py]"]
  node_vehicle_detect["Vehicle detection"]
  node_plate_detect["Plate detection<br/>[plate_detector.py]"]
  node_plate_ocr["Plate OCR<br/>[ocr.py]"]
  node_vehicle_service["Vehicle sessions<br/>[vehicle_service.py]"]
  node_parking_service["Slots and availability<br/>[parking_service.py]"]
  node_slot_view["Parking map<br/>[parking_slots.py]"]
end

subgraph group_accounts["Accounts and payments"]
  node_auth_ui["Login and signup<br/>[login.py]"]
  node_auth_service["Authentication<br/>[auth_service.py]"]
  node_user_service["User management<br/>[user_service.py]"]
  node_payment_service["Fees and payments<br/>[payment_service.py]"]
  node_user_pages["User account pages<br/>[profile.py]"]
  node_admin_pages["Admin account pages<br/>[approvals.py]"]
end

subgraph group_storage["Persistence"]
  node_database[("Parking SQLite<br/>[db.py]")]
end

node_operator(("Operator"))

node_operator -->|"opens"| node_app_entry
node_app_entry -->|"routes unauthenticated"| node_auth_ui
node_app_entry -->|"routes admin"| node_admin_ui
node_app_entry -->|"routes user"| node_user_ui
node_auth_ui -->|"authenticates"| node_auth_service
node_camera_ui -->|"processes frames"| node_ai_pipeline
node_ai_pipeline -->|"detects vehicles"| node_vehicle_detect
node_ai_pipeline -->|"detects plates"| node_plate_detect
node_ai_pipeline -->|"reads plate text"| node_plate_ocr
node_camera_ui -->|"records vehicle"| node_vehicle_service
node_admin_ui -->|"displays camera"| node_camera_ui
node_admin_ui -->|"displays slots"| node_slot_view
node_admin_ui -->|"manages sessions"| node_vehicle_service
node_admin_ui -->|"shows payments"| node_payment_service
node_admin_ops -->|"checks vehicles in/out"| node_vehicle_service
node_user_ui -->|"loads vehicle data"| node_vehicle_service
node_user_ui -->|"loads parking data"| node_parking_service
node_user_ui -->|"loads payment data"| node_payment_service
node_user_ui -->|"shows slots"| node_slot_view
node_slot_view -->|"reads slot groups"| node_parking_service
node_vehicle_service -->|"finds and updates slots"| node_parking_service
node_vehicle_service -->|"calculates and records fees"| node_payment_service
node_user_pages -->|"manages profile"| node_user_service
node_admin_pages -->|"reviews accounts"| node_user_service
node_auth_service -->|"queries users"| node_database
node_user_service -->|"reads and updates users"| node_database
node_parking_service -->|"reads and updates slots"| node_database
node_payment_service -->|"reads and records payments"| node_database
node_vehicle_service -->|"persists sessions"| node_database

click node_app_entry "https://github.com/unwtr/24ct2-nguyenminhvuong/blob/main/smart-parking/app.py"
click node_auth_ui "https://github.com/unwtr/24ct2-nguyenminhvuong/blob/main/smart-parking/ui/auth/login.py"
click node_admin_ui "https://github.com/unwtr/24ct2-nguyenminhvuong/blob/main/smart-parking/ui/admin/dashboard.py"
click node_admin_ops "https://github.com/unwtr/24ct2-nguyenminhvuong/blob/main/smart-parking/ui/admin/vehicles.py"
click node_user_ui "https://github.com/unwtr/24ct2-nguyenminhvuong/blob/main/smart-parking/ui/user/dashboard.py"
click node_camera_ui "https://github.com/unwtr/24ct2-nguyenminhvuong/blob/main/smart-parking/components/camera.py"
click node_ai_pipeline "https://github.com/unwtr/24ct2-nguyenminhvuong/blob/main/smart-parking/ai/pipeline.py"
click node_vehicle_detect "https://github.com/unwtr/24ct2-nguyenminhvuong/blob/main/smart-parking/ai/vehicle_detector.py"
click node_plate_detect "https://github.com/unwtr/24ct2-nguyenminhvuong/blob/main/smart-parking/ai/plate_detector.py"
click node_plate_ocr "https://github.com/unwtr/24ct2-nguyenminhvuong/blob/main/smart-parking/ai/ocr.py"
click node_vehicle_service "https://github.com/unwtr/24ct2-nguyenminhvuong/blob/main/smart-parking/backend/services/vehicle_service.py"
click node_parking_service "https://github.com/unwtr/24ct2-nguyenminhvuong/blob/main/smart-parking/backend/services/parking_service.py"
click node_slot_view "https://github.com/unwtr/24ct2-nguyenminhvuong/blob/main/smart-parking/components/parking_slots.py"
click node_auth_service "https://github.com/unwtr/24ct2-nguyenminhvuong/blob/main/smart-parking/backend/services/auth_service.py"
click node_user_service "https://github.com/unwtr/24ct2-nguyenminhvuong/blob/main/smart-parking/backend/services/user_service.py"
click node_payment_service "https://github.com/unwtr/24ct2-nguyenminhvuong/blob/main/smart-parking/backend/services/payment_service.py"
click node_user_pages "https://github.com/unwtr/24ct2-nguyenminhvuong/blob/main/smart-parking/ui/user/profile.py"
click node_admin_pages "https://github.com/unwtr/24ct2-nguyenminhvuong/blob/main/smart-parking/ui/admin/approvals.py"
click node_database "https://github.com/unwtr/24ct2-nguyenminhvuong/blob/main/smart-parking/backend/database/db.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_entry,node_admin_ui,node_admin_ops,node_user_ui toneBlue
class node_camera_ui,node_ai_pipeline,node_vehicle_detect,node_plate_detect,node_plate_ocr,node_vehicle_service,node_parking_service,node_slot_view toneAmber
class node_auth_ui,node_auth_service,node_user_service,node_payment_service,node_user_pages,node_admin_pages toneMint
class node_database toneRose
class node_operator toneIndigo
```

## Components

### Application routing

- [Streamlit entry](https://github.com/unwtr/24ct2-nguyenminhvuong/blob/main/smart-parking/app.py): `smart-parking/app.py`
- [Admin dashboard](https://github.com/unwtr/24ct2-nguyenminhvuong/blob/main/smart-parking/ui/admin/dashboard.py): `smart-parking/ui/admin/dashboard.py`
- [Admin management](https://github.com/unwtr/24ct2-nguyenminhvuong/blob/main/smart-parking/ui/admin/vehicles.py): `smart-parking/ui/admin/vehicles.py`
- [User dashboard](https://github.com/unwtr/24ct2-nguyenminhvuong/blob/main/smart-parking/ui/user/dashboard.py): `smart-parking/ui/user/dashboard.py`

### Parking operations

- [Camera capture](https://github.com/unwtr/24ct2-nguyenminhvuong/blob/main/smart-parking/components/camera.py): `smart-parking/components/camera.py`
- [Recognition pipeline](https://github.com/unwtr/24ct2-nguyenminhvuong/blob/main/smart-parking/ai/pipeline.py): `smart-parking/ai/pipeline.py`
- [Vehicle detection](https://github.com/unwtr/24ct2-nguyenminhvuong/blob/main/smart-parking/ai/vehicle_detector.py): `smart-parking/ai/vehicle_detector.py`
- [Plate detection](https://github.com/unwtr/24ct2-nguyenminhvuong/blob/main/smart-parking/ai/plate_detector.py): `smart-parking/ai/plate_detector.py`
- [Plate OCR](https://github.com/unwtr/24ct2-nguyenminhvuong/blob/main/smart-parking/ai/ocr.py): `smart-parking/ai/ocr.py`
- [Vehicle sessions](https://github.com/unwtr/24ct2-nguyenminhvuong/blob/main/smart-parking/backend/services/vehicle_service.py): `smart-parking/backend/services/vehicle_service.py`
- [Slots and availability](https://github.com/unwtr/24ct2-nguyenminhvuong/blob/main/smart-parking/backend/services/parking_service.py): `smart-parking/backend/services/parking_service.py`
- [Parking map](https://github.com/unwtr/24ct2-nguyenminhvuong/blob/main/smart-parking/components/parking_slots.py): `smart-parking/components/parking_slots.py`

### Accounts and payments

- [Login and signup](https://github.com/unwtr/24ct2-nguyenminhvuong/blob/main/smart-parking/ui/auth/login.py): `smart-parking/ui/auth/login.py`
- [Authentication](https://github.com/unwtr/24ct2-nguyenminhvuong/blob/main/smart-parking/backend/services/auth_service.py): `smart-parking/backend/services/auth_service.py`
- [User management](https://github.com/unwtr/24ct2-nguyenminhvuong/blob/main/smart-parking/backend/services/user_service.py): `smart-parking/backend/services/user_service.py`
- [Fees and payments](https://github.com/unwtr/24ct2-nguyenminhvuong/blob/main/smart-parking/backend/services/payment_service.py): `smart-parking/backend/services/payment_service.py`
- [User account pages](https://github.com/unwtr/24ct2-nguyenminhvuong/blob/main/smart-parking/ui/user/profile.py): `smart-parking/ui/user/profile.py`
- [Admin account pages](https://github.com/unwtr/24ct2-nguyenminhvuong/blob/main/smart-parking/ui/admin/approvals.py): `smart-parking/ui/admin/approvals.py`

### Persistence

- [Parking SQLite](https://github.com/unwtr/24ct2-nguyenminhvuong/blob/main/smart-parking/backend/database/db.py): `smart-parking/backend/database/db.py`

### Other components

- **Operator**

## Connections

- Operator → Streamlit entry: opens (evidence: `smart-parking/app.py`)
- Streamlit entry → Login and signup: routes unauthenticated (evidence: `smart-parking/app.py`)
- Streamlit entry → Admin dashboard: routes admin (evidence: `smart-parking/app.py`)
- Streamlit entry → User dashboard: routes user (evidence: `smart-parking/app.py`)
- Login and signup → Authentication: authenticates (evidence: `smart-parking/ui/auth/login.py`)
- Camera capture → Recognition pipeline: processes frames (evidence: `smart-parking/components/camera.py`)
- Recognition pipeline → Vehicle detection: detects vehicles (evidence: `smart-parking/ai/pipeline.py`)
- Recognition pipeline → Plate detection: detects plates (evidence: `smart-parking/ai/pipeline.py`)
- Recognition pipeline → Plate OCR: reads plate text (evidence: `smart-parking/ai/pipeline.py`)
- Camera capture → Vehicle sessions: records vehicle (evidence: `smart-parking/components/camera.py`)
- Admin dashboard → Camera capture: displays camera (evidence: `smart-parking/ui/admin/dashboard.py`)
- Admin dashboard → Parking map: displays slots (evidence: `smart-parking/ui/admin/dashboard.py`)
- Admin dashboard → Vehicle sessions: manages sessions (evidence: `smart-parking/ui/admin/dashboard.py`)
- Admin dashboard → Fees and payments: shows payments (evidence: `smart-parking/ui/admin/dashboard.py`)
- Admin management → Vehicle sessions: checks vehicles in/out (evidence: `smart-parking/ui/admin/vehicles.py`)
- User dashboard → Vehicle sessions: loads vehicle data (evidence: `smart-parking/ui/user/dashboard.py`)
- User dashboard → Slots and availability: loads parking data (evidence: `smart-parking/ui/user/dashboard.py`)
- User dashboard → Fees and payments: loads payment data (evidence: `smart-parking/ui/user/dashboard.py`)
- User dashboard → Parking map: shows slots (evidence: `smart-parking/ui/user/dashboard.py`)
- Parking map → Slots and availability: reads slot groups (evidence: `smart-parking/components/parking_slots.py`)
- Vehicle sessions → Slots and availability: finds and updates slots (evidence: `smart-parking/backend/services/vehicle_service.py`)
- Vehicle sessions → Fees and payments: calculates and records fees (evidence: `smart-parking/backend/services/vehicle_service.py`)
- User account pages → User management: manages profile (evidence: `smart-parking/ui/user/profile.py`)
- Admin account pages → User management: reviews accounts (evidence: `smart-parking/ui/admin/approvals.py`)
- Authentication → Parking SQLite: queries users (evidence: `smart-parking/backend/services/auth_service.py`)
- User management → Parking SQLite: reads and updates users (evidence: `smart-parking/backend/services/user_service.py`)
- Slots and availability → Parking SQLite: reads and updates slots (evidence: `smart-parking/backend/services/parking_service.py`)
- Fees and payments → Parking SQLite: reads and records payments (evidence: `smart-parking/backend/services/payment_service.py`)
- Vehicle sessions → Parking SQLite: persists sessions (evidence: `smart-parking/backend/services/vehicle_service.py`)
