# hariprasath-prog/smartparkingsystem architecture

> Architecture diagram of the GitHub repository hariprasath-prog/smartparkingsystem, 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/hariprasath-prog/smartparkingsystem
- Repository: https://github.com/hariprasath-prog/smartparkingsystem

## Overview

This is a pure-Java console parking allocation and reservation system. Drivers use the console to request compatible spaces for a time interval; the controller ranks eligible lots by road travel time, reserves a selected space, or queues the request. Users and administrators can also manage reservation state, process expirations, and inspect status. The map separates console, allocation services, domain state, and routing. Relationship evidence is limited to the excerpts, README, and SOURCE INDEX; unsampled implementation details are not inferred.

Main entry points: [`src/service/ParkingOperationsController.java`](https://github.com/hariprasath-prog/smartparkingsystem/blob/main/src/service/ParkingOperationsController.java) (Operations controller), [`src/model/ParkingSpace.java`](https://github.com/hariprasath-prog/smartparkingsystem/blob/main/src/model/ParkingSpace.java) (Space state and compatibility), [`src/model/Reservation.java`](https://github.com/hariprasath-prog/smartparkingsystem/blob/main/src/model/Reservation.java) (Reservations and intervals), [`src/graph/WeightedGraph.java`](https://github.com/hariprasath-prog/smartparkingsystem/blob/main/src/graph/WeightedGraph.java) (Weighted road network)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_console["Console Interface"]
  node_main["Console menus<br/>[Main.java]"]
  node_sample_data["Demo and setup data<br/>[SampleData.java]"]
end

subgraph group_services["Allocation Services"]
  node_controller["Operations controller"]
  node_policy["Slot selection policy"]
  node_reservation_manager["Reservation manager"]
end

subgraph group_domain["Parking Domain"]
  node_requests["Waiting requests"]
  node_lots["Parking lots<br/>[ParkingLot.java]"]
  node_spaces["Space state and compatibility<br/>[ParkingSpace.java]"]
  node_accessible_space["Accessible spaces"]
  node_car_space["Car spaces<br/>[CarSpace.java]"]
  node_two_wheeler_space["Two-wheeler spaces"]
  node_vehicle["Vehicle and type<br/>[Vehicle.java]"]
  node_reservations["Reservations and intervals<br/>[Reservation.java]"]
  node_reservation_status["Reservation statuses"]
  node_space_status["Space statuses<br/>[SpaceStatus.java]"]
end

subgraph group_routing["Road Routing"]
  node_graph["Weighted road network<br/>[WeightedGraph.java]"]
  node_graph_nodes["Road nodes<br/>[GraphNode.java]"]
  node_edges["Weighted road links<br/>[Edge.java]"]
  node_dijkstra["Shortest-path engine"]
end

node_users(("Drivers and admins"))

node_users -->|"use menus"| node_main
node_main -->|"invoke operations"| node_controller
node_main -->|"load demo data"| node_sample_data
node_sample_data -->|"populate and exercise"| node_controller
node_sample_data -->|"build road network"| node_graph
node_controller -->|"check and select spaces"| node_policy
node_controller -->|"manage reservations"| node_reservation_manager
node_controller -->|"compute routes"| node_dijkstra
node_controller -->|"queue unavailable requests"| node_requests
node_controller -->|"inspect eligible lots"| node_lots
node_controller -->|"create and transition"| node_reservations
node_policy -->|"check compatibility"| node_spaces
node_spaces -->|"validate vehicle"| node_vehicle
node_lots -->|"contain spaces"| node_spaces
node_accessible_space -->|"extends state model"| node_spaces
node_car_space -->|"extends state model"| node_spaces
node_two_wheeler_space -->|"extends state model"| node_spaces
node_reservation_manager -->|"verify and expire"| node_reservations
node_reservations -->|"transition space state"| node_spaces
node_reservations -->|"track lifecycle"| node_reservation_status
node_spaces -->|"track availability"| node_space_status
node_graph -->|"store nodes"| node_graph_nodes
node_graph -->|"store connections"| node_edges
node_dijkstra -->|"read network"| node_graph

click node_main "https://github.com/hariprasath-prog/smartparkingsystem/blob/main/src/main/Main.java"
click node_sample_data "https://github.com/hariprasath-prog/smartparkingsystem/blob/main/src/util/SampleData.java"
click node_controller "https://github.com/hariprasath-prog/smartparkingsystem/blob/main/src/service/ParkingOperationsController.java"
click node_policy "https://github.com/hariprasath-prog/smartparkingsystem/blob/main/src/service/DefaultSlotSelectionPolicy.java"
click node_reservation_manager "https://github.com/hariprasath-prog/smartparkingsystem/blob/main/src/service/ReservationManager.java"
click node_requests "https://github.com/hariprasath-prog/smartparkingsystem/blob/main/src/model/ParkingRequest.java"
click node_lots "https://github.com/hariprasath-prog/smartparkingsystem/blob/main/src/model/ParkingLot.java"
click node_spaces "https://github.com/hariprasath-prog/smartparkingsystem/blob/main/src/model/ParkingSpace.java"
click node_accessible_space "https://github.com/hariprasath-prog/smartparkingsystem/blob/main/src/model/AccessibleSpace.java"
click node_car_space "https://github.com/hariprasath-prog/smartparkingsystem/blob/main/src/model/CarSpace.java"
click node_two_wheeler_space "https://github.com/hariprasath-prog/smartparkingsystem/blob/main/src/model/TwoWheelerSpace.java"
click node_vehicle "https://github.com/hariprasath-prog/smartparkingsystem/blob/main/src/model/Vehicle.java"
click node_reservations "https://github.com/hariprasath-prog/smartparkingsystem/blob/main/src/model/Reservation.java"
click node_reservation_status "https://github.com/hariprasath-prog/smartparkingsystem/blob/main/src/model/ReservationStatus.java"
click node_space_status "https://github.com/hariprasath-prog/smartparkingsystem/blob/main/src/model/SpaceStatus.java"
click node_graph "https://github.com/hariprasath-prog/smartparkingsystem/blob/main/src/graph/WeightedGraph.java"
click node_graph_nodes "https://github.com/hariprasath-prog/smartparkingsystem/blob/main/src/graph/GraphNode.java"
click node_edges "https://github.com/hariprasath-prog/smartparkingsystem/blob/main/src/graph/Edge.java"
click node_dijkstra "https://github.com/hariprasath-prog/smartparkingsystem/blob/main/src/graph/DijkstraAlgorithm.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_main,node_sample_data toneBlue
class node_controller,node_policy,node_reservation_manager toneAmber
class node_requests,node_lots,node_spaces,node_accessible_space,node_car_space,node_two_wheeler_space,node_vehicle,node_reservations,node_reservation_status,node_space_status toneMint
class node_graph,node_graph_nodes,node_edges,node_dijkstra toneRose
class node_users toneIndigo
```

## Components

### Console Interface

- [Console menus](https://github.com/hariprasath-prog/smartparkingsystem/blob/main/src/main/Main.java): `src/main/Main.java`
- [Demo and setup data](https://github.com/hariprasath-prog/smartparkingsystem/blob/main/src/util/SampleData.java): `src/util/SampleData.java`

### Allocation Services

- [Operations controller](https://github.com/hariprasath-prog/smartparkingsystem/blob/main/src/service/ParkingOperationsController.java): `src/service/ParkingOperationsController.java`
- [Slot selection policy](https://github.com/hariprasath-prog/smartparkingsystem/blob/main/src/service/DefaultSlotSelectionPolicy.java): `src/service/DefaultSlotSelectionPolicy.java`
- [Reservation manager](https://github.com/hariprasath-prog/smartparkingsystem/blob/main/src/service/ReservationManager.java): `src/service/ReservationManager.java`

### Parking Domain

- [Waiting requests](https://github.com/hariprasath-prog/smartparkingsystem/blob/main/src/model/ParkingRequest.java): `src/model/ParkingRequest.java`
- [Parking lots](https://github.com/hariprasath-prog/smartparkingsystem/blob/main/src/model/ParkingLot.java): `src/model/ParkingLot.java`
- [Space state and compatibility](https://github.com/hariprasath-prog/smartparkingsystem/blob/main/src/model/ParkingSpace.java): `src/model/ParkingSpace.java`
- [Accessible spaces](https://github.com/hariprasath-prog/smartparkingsystem/blob/main/src/model/AccessibleSpace.java): `src/model/AccessibleSpace.java`
- [Car spaces](https://github.com/hariprasath-prog/smartparkingsystem/blob/main/src/model/CarSpace.java): `src/model/CarSpace.java`
- [Two-wheeler spaces](https://github.com/hariprasath-prog/smartparkingsystem/blob/main/src/model/TwoWheelerSpace.java): `src/model/TwoWheelerSpace.java`
- [Vehicle and type](https://github.com/hariprasath-prog/smartparkingsystem/blob/main/src/model/Vehicle.java): `src/model/Vehicle.java`
- [Reservations and intervals](https://github.com/hariprasath-prog/smartparkingsystem/blob/main/src/model/Reservation.java): `src/model/Reservation.java`
- [Reservation statuses](https://github.com/hariprasath-prog/smartparkingsystem/blob/main/src/model/ReservationStatus.java): `src/model/ReservationStatus.java`
- [Space statuses](https://github.com/hariprasath-prog/smartparkingsystem/blob/main/src/model/SpaceStatus.java): `src/model/SpaceStatus.java`

### Road Routing

- [Weighted road network](https://github.com/hariprasath-prog/smartparkingsystem/blob/main/src/graph/WeightedGraph.java): `src/graph/WeightedGraph.java`
- [Road nodes](https://github.com/hariprasath-prog/smartparkingsystem/blob/main/src/graph/GraphNode.java): `src/graph/GraphNode.java`
- [Weighted road links](https://github.com/hariprasath-prog/smartparkingsystem/blob/main/src/graph/Edge.java): `src/graph/Edge.java`
- [Shortest-path engine](https://github.com/hariprasath-prog/smartparkingsystem/blob/main/src/graph/DijkstraAlgorithm.java): `src/graph/DijkstraAlgorithm.java`

### Other components

- **Drivers and admins**

## Connections

- Drivers and admins → Console menus: use menus (evidence: `README.md`)
- Console menus → Operations controller: invoke operations (evidence: `src/main/Main.java`)
- Console menus → Demo and setup data: load demo data (evidence: `src/main/Main.java`)
- Demo and setup data → Operations controller: populate and exercise (evidence: `src/util/SampleData.java`)
- Demo and setup data → Weighted road network: build road network (evidence: `src/util/SampleData.java`)
- Operations controller → Slot selection policy: check and select spaces (evidence: `src/service/ParkingOperationsController.java`)
- Operations controller → Reservation manager: manage reservations (evidence: `src/service/ParkingOperationsController.java`)
- Operations controller → Shortest-path engine: compute routes (evidence: `src/service/ParkingOperationsController.java`)
- Operations controller → Waiting requests: queue unavailable requests (evidence: `src/service/ParkingOperationsController.java`)
- Operations controller → Parking lots: inspect eligible lots (evidence: `src/service/ParkingOperationsController.java`)
- Operations controller → Reservations and intervals: create and transition (evidence: `src/service/ParkingOperationsController.java`)
- Slot selection policy → Space state and compatibility: check compatibility (evidence: `src/service/DefaultSlotSelectionPolicy.java`)
- Space state and compatibility → Vehicle and type: validate vehicle (evidence: `src/model/ParkingSpace.java`)
- Parking lots → Space state and compatibility: contain spaces (evidence: `src/model/ParkingLot.java`)
- Accessible spaces → Space state and compatibility: extends state model (evidence: `src/model/AccessibleSpace.java`)
- Car spaces → Space state and compatibility: extends state model (evidence: `src/model/CarSpace.java`)
- Two-wheeler spaces → Space state and compatibility: extends state model (evidence: `src/model/TwoWheelerSpace.java`)
- Reservation manager → Reservations and intervals: verify and expire (evidence: `src/service/ReservationManager.java`)
- Reservations and intervals → Space state and compatibility: transition space state (evidence: `src/model/Reservation.java`)
- Reservations and intervals → Reservation statuses: track lifecycle (evidence: `src/model/Reservation.java`)
- Space state and compatibility → Space statuses: track availability (evidence: `src/model/ParkingSpace.java`)
- Weighted road network → Road nodes: store nodes (evidence: `src/graph/WeightedGraph.java`)
- Weighted road network → Weighted road links: store connections (evidence: `src/graph/WeightedGraph.java`)
- Shortest-path engine → Weighted road network: read network (evidence: `src/graph/DijkstraAlgorithm.java`)
