# codewithnaveed01/parking-lot-system architecture

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

- Interactive diagram: https://gitdiagram.com/codewithnaveed01/parking-lot-system
- Repository: https://github.com/codewithnaveed01/parking-lot-system

## Overview

Orbit Park is a single-lot parking system with separate driver, gate-staff, and manager experiences. Its main workflow is online reservation, gate check-in, fee calculation, payment recording or transfer verification, and ticket closure. Walk-in parking, capacity and rate administration, audit/history, and signed receipts are additional product branches. The README documents capabilities beyond the sampled excerpts; those branches are shown at their documented subsystem paths, with uncertain internal wiring omitted.

Main entry points: [`src/com/parking/service/ParkingLotService.java`](https://github.com/codewithnaveed01/parking-lot-system/blob/main/src/com/parking/service/ParkingLotService.java) (Lot lifecycle), [`src/com/parking/api/ApiServer.java`](https://github.com/codewithnaveed01/parking-lot-system/blob/main/src/com/parking/api/ApiServer.java) (HTTP API), [`src/com/parking/repository/TicketRepository.java`](https://github.com/codewithnaveed01/parking-lot-system/blob/main/src/com/parking/repository/TicketRepository.java) (Ticket persistence), [`web/app.js`](https://github.com/codewithnaveed01/parking-lot-system/blob/main/web/app.js) (Driver portal)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experiences["User experiences"]
  node_driver_ui["Driver portal<br/>[app.js]"]
  node_gate_ui["Gate portal<br/>[gate.js]"]
  node_admin_ui["Admin portal<br/>[admin.js]"]
end

subgraph group_runtime["HTTP and services"]
  node_api["HTTP API<br/>[ApiServer.java]"]
  node_lot_service["Lot lifecycle"]
  node_pricing["Fee calculation<br/>[HourlyPricing.java]"]
  node_auth["Staff sessions"]
end

subgraph group_domain["Parking domain"]
  node_ticket["Ticket lifecycle<br/>[Ticket.java]"]
  node_vehicle_spot["Vehicles and bays<br/>[Vehicle.java]"]
  node_rates["Rate settings<br/>[RateTable.java]"]
  node_payment_config["Transfer destinations<br/>[PaymentConfig.java]"]
  node_receipts["Signed receipts<br/>[Crypto.java]"]
end

subgraph group_storage["State and security"]
  node_ticket_repository["Ticket persistence"]
  node_settings_repository["Settings persistence"]
  node_file_store[("File storage")]
  node_postgres_store[("PostgreSQL storage")]
end

node_drivers(("Drivers"))
node_gate_staff(("Gate staff"))
node_manager(("Manager"))
node_merchant_statement(("Merchant statement"))
node_wallet_bank(("Wallet or bank app"))

node_drivers -->|"use"| node_driver_ui
node_gate_staff -->|"use"| node_gate_ui
node_manager -->|"use"| node_admin_ui
node_driver_ui -->|"request booking"| node_api
node_gate_ui -->|"request gate actions"| node_api
node_admin_ui -->|"request management"| node_api
node_wallet_bank -.->|"send transfer"| node_drivers
node_drivers -->|"submit reference"| node_driver_ui
node_merchant_statement -.->|"check transfer"| node_manager
node_api -->|"dispatch parking actions"| node_lot_service
node_api -->|"validate staff sessions"| node_auth
node_lot_service -->|"load and save tickets"| node_ticket_repository
node_lot_service -->|"read settings"| node_settings_repository
node_lot_service -->|"calculate fees"| node_pricing
node_pricing -->|"read rates"| node_rates
node_rates -->|"load and save rates"| node_settings_repository
node_payment_config -->|"load and save destinations"| node_settings_repository
node_lot_service -->|"advance ticket lifecycle"| node_ticket
node_lot_service -->|"allocate bays"| node_vehicle_spot
node_api -->|"verify receipt signatures"| node_receipts
node_ticket_repository -.->|"file implementation"| node_file_store
node_ticket_repository -.->|"PostgreSQL implementation"| node_postgres_store

click node_driver_ui "https://github.com/codewithnaveed01/parking-lot-system/blob/main/web/app.js"
click node_gate_ui "https://github.com/codewithnaveed01/parking-lot-system/blob/main/web/gate.js"
click node_admin_ui "https://github.com/codewithnaveed01/parking-lot-system/blob/main/web/admin.js"
click node_api "https://github.com/codewithnaveed01/parking-lot-system/blob/main/src/com/parking/api/ApiServer.java"
click node_lot_service "https://github.com/codewithnaveed01/parking-lot-system/blob/main/src/com/parking/service/ParkingLotService.java"
click node_pricing "https://github.com/codewithnaveed01/parking-lot-system/blob/main/src/com/parking/service/HourlyPricing.java"
click node_auth "https://github.com/codewithnaveed01/parking-lot-system/blob/main/src/com/parking/service/AdminAuthService.java"
click node_ticket "https://github.com/codewithnaveed01/parking-lot-system/blob/main/src/com/parking/model/Ticket.java"
click node_vehicle_spot "https://github.com/codewithnaveed01/parking-lot-system/blob/main/src/com/parking/model/Vehicle.java"
click node_rates "https://github.com/codewithnaveed01/parking-lot-system/blob/main/src/com/parking/service/RateTable.java"
click node_payment_config "https://github.com/codewithnaveed01/parking-lot-system/blob/main/src/com/parking/service/PaymentConfig.java"
click node_receipts "https://github.com/codewithnaveed01/parking-lot-system/blob/main/src/com/parking/util/Crypto.java"
click node_ticket_repository "https://github.com/codewithnaveed01/parking-lot-system/blob/main/src/com/parking/repository/TicketRepository.java"
click node_settings_repository "https://github.com/codewithnaveed01/parking-lot-system/blob/main/src/com/parking/repository/SettingsRepository.java"
click node_file_store "https://github.com/codewithnaveed01/parking-lot-system/blob/main/src/com/parking/repository/FileTicketRepository.java"
click node_postgres_store "https://github.com/codewithnaveed01/parking-lot-system/blob/main/src/com/parking/repository/PostgresTicketRepository.java"

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_driver_ui,node_gate_ui,node_admin_ui toneBlue
class node_api,node_lot_service,node_pricing,node_auth toneAmber
class node_ticket,node_vehicle_spot,node_rates,node_payment_config,node_receipts toneMint
class node_ticket_repository,node_settings_repository,node_file_store,node_postgres_store toneRose
class node_drivers,node_gate_staff,node_manager,node_merchant_statement,node_wallet_bank toneIndigo
```

## Components

### User experiences

- [Driver portal](https://github.com/codewithnaveed01/parking-lot-system/blob/main/web/app.js): `web/app.js`
- [Gate portal](https://github.com/codewithnaveed01/parking-lot-system/blob/main/web/gate.js): `web/gate.js`
- [Admin portal](https://github.com/codewithnaveed01/parking-lot-system/blob/main/web/admin.js): `web/admin.js`

### HTTP and services

- [HTTP API](https://github.com/codewithnaveed01/parking-lot-system/blob/main/src/com/parking/api/ApiServer.java): `src/com/parking/api/ApiServer.java`
- [Lot lifecycle](https://github.com/codewithnaveed01/parking-lot-system/blob/main/src/com/parking/service/ParkingLotService.java): `src/com/parking/service/ParkingLotService.java`
- [Fee calculation](https://github.com/codewithnaveed01/parking-lot-system/blob/main/src/com/parking/service/HourlyPricing.java): `src/com/parking/service/HourlyPricing.java`
- [Staff sessions](https://github.com/codewithnaveed01/parking-lot-system/blob/main/src/com/parking/service/AdminAuthService.java): `src/com/parking/service/AdminAuthService.java`

### Parking domain

- [Ticket lifecycle](https://github.com/codewithnaveed01/parking-lot-system/blob/main/src/com/parking/model/Ticket.java): `src/com/parking/model/Ticket.java`
- [Vehicles and bays](https://github.com/codewithnaveed01/parking-lot-system/blob/main/src/com/parking/model/Vehicle.java): `src/com/parking/model/Vehicle.java`
- [Rate settings](https://github.com/codewithnaveed01/parking-lot-system/blob/main/src/com/parking/service/RateTable.java): `src/com/parking/service/RateTable.java`
- [Transfer destinations](https://github.com/codewithnaveed01/parking-lot-system/blob/main/src/com/parking/service/PaymentConfig.java): `src/com/parking/service/PaymentConfig.java`
- [Signed receipts](https://github.com/codewithnaveed01/parking-lot-system/blob/main/src/com/parking/util/Crypto.java): `src/com/parking/util/Crypto.java`

### State and security

- [Ticket persistence](https://github.com/codewithnaveed01/parking-lot-system/blob/main/src/com/parking/repository/TicketRepository.java): `src/com/parking/repository/TicketRepository.java`
- [Settings persistence](https://github.com/codewithnaveed01/parking-lot-system/blob/main/src/com/parking/repository/SettingsRepository.java): `src/com/parking/repository/SettingsRepository.java`
- [File storage](https://github.com/codewithnaveed01/parking-lot-system/blob/main/src/com/parking/repository/FileTicketRepository.java): `src/com/parking/repository/FileTicketRepository.java`
- [PostgreSQL storage](https://github.com/codewithnaveed01/parking-lot-system/blob/main/src/com/parking/repository/PostgresTicketRepository.java): `src/com/parking/repository/PostgresTicketRepository.java`

### Other components

- **Drivers**
- **Gate staff**
- **Manager**
- **Merchant statement**
- **Wallet or bank app**

## Connections

- Drivers → Driver portal: use
- Gate staff → Gate portal: use
- Manager → Admin portal: use
- Driver portal → HTTP API: request booking
- Gate portal → HTTP API: request gate actions
- Admin portal → HTTP API: request management
- Wallet or bank app → Drivers: send transfer
- Drivers → Driver portal: submit reference
- Merchant statement → Manager: check transfer
- HTTP API → Lot lifecycle: dispatch parking actions
- HTTP API → Staff sessions: validate staff sessions
- Lot lifecycle → Ticket persistence: load and save tickets
- Lot lifecycle → Settings persistence: read settings
- Lot lifecycle → Fee calculation: calculate fees
- Fee calculation → Rate settings: read rates
- Rate settings → Settings persistence: load and save rates
- Transfer destinations → Settings persistence: load and save destinations
- Lot lifecycle → Ticket lifecycle: advance ticket lifecycle
- Lot lifecycle → Vehicles and bays: allocate bays
- HTTP API → Signed receipts: verify receipt signatures
- Ticket persistence → File storage: file implementation
- Ticket persistence → PostgreSQL storage: PostgreSQL implementation
