# gsatish1012/parkinglot architecture

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

- Interactive diagram: https://gitdiagram.com/gsatish1012/parkinglot
- Repository: https://github.com/gsatish1012/parkinglot

## Overview

This is a parking-lot management application. The main workflow admits a vehicle, assigns a compatible available spot, and issues a ticket; at exit, it calculates a charge, processes payment, and removes the ticket. Building and floor management organize spot allocation, while billing and payment use selectable strategies. In-memory ticket, bill, and payment state is visible in the sampled sources. Some relationships are supported only by the SOURCE INDEX references, not inspected method bodies.

Main entry points: [`App.java`](https://github.com/gsatish1012/parkinglot/blob/main/App.java) (Application), [`Payment/PaymentManager.java`](https://github.com/gsatish1012/parkinglot/blob/main/Payment/PaymentManager.java) (Payment Manager), [`Building/ExitGate.java`](https://github.com/gsatish1012/parkinglot/blob/main/Building/ExitGate.java) (Exit Gate), [`Building/BuildingManager.java`](https://github.com/gsatish1012/parkinglot/blob/main/Building/BuildingManager.java) (Building Manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and Parking"]
  node_entrygate["Entry Gate<br/>[EntryGate.java]"]
  node_exitgate["Exit Gate<br/>[ExitGate.java]"]
  node_building["Building Manager"]
  node_floors["Floor Manager<br/>[FloorManager.java]"]
  node_spotfactory["Spot Factory"]
  node_spots["Parking Spots<br/>[ParkingSpot.java]"]
  node_spottypes["Spot Types"]
end

subgraph group_tickets["Ticketing"]
  node_ticketmanager["Ticket Manager<br/>[TicketManager.java]"]
  node_ticketrepo[("Ticket Repository")]
  node_ticket["Parking Ticket<br/>[Ticket.java]"]
end

subgraph group_billing["Billing"]
  node_billingmanager["Billing Manager"]
  node_billingservice["Billing Service"]
  node_billingfactory["Billing Strategy Factory"]
  node_billingstrategies["Hourly and Daily Rates"]
  node_bill["Bill<br/>[Bill.java]"]
end

subgraph group_payments["Payments"]
  node_paymentmanager["Payment Manager"]
  node_paymentservice["Payment Service"]
  node_paymentfactory["Payment Strategy Factory"]
  node_paymentstrategies["Payment Methods"]
  node_payment["Payment Record<br/>[Payment.java]"]
end

node_driver["Application<br/>[App.java]"]

node_driver -->|"starts entry"| node_entrygate
node_driver -->|"starts exit"| node_exitgate
node_driver -->|"configures"| node_building
node_driver -->|"configures"| node_ticketmanager
node_driver -->|"configures"| node_billingmanager
node_driver -->|"configures"| node_paymentmanager
node_entrygate -->|"requests allocation"| node_building
node_entrygate -->|"creates ticket"| node_ticketmanager
node_building -->|"delegates floor management"| node_floors
node_building -->|"references tickets"| node_ticketrepo
node_floors -->|"creates spots"| node_spotfactory
node_spotfactory -->|"selects spot type"| node_spottypes
node_ticketmanager -->|"stores tickets"| node_ticketrepo
node_ticketmanager -->|"creates ticket"| node_ticket
node_ticket -->|"records assigned spot"| node_spots
node_exitgate -->|"requests bill"| node_billingmanager
node_billingmanager -->|"calculates charge"| node_billingservice
node_billingmanager -->|"creates bill"| node_bill
node_billingservice -->|"selects strategy"| node_billingfactory
node_billingfactory -->|"creates rate strategy"| node_billingstrategies
node_billingservice -->|"reads ticket details"| node_ticket
node_exitgate -->|"submits payment"| node_paymentmanager
node_paymentmanager -->|"reads bill amount"| node_bill
node_paymentmanager -->|"processes payment"| node_paymentservice
node_paymentmanager -->|"records result"| node_payment
node_paymentservice -->|"selects strategy"| node_paymentfactory
node_paymentfactory -->|"creates method strategy"| node_paymentstrategies
node_exitgate -->|"references ticket store"| node_ticketrepo

click node_driver "https://github.com/gsatish1012/parkinglot/blob/main/App.java"
click node_entrygate "https://github.com/gsatish1012/parkinglot/blob/main/Building/EntryGate.java"
click node_exitgate "https://github.com/gsatish1012/parkinglot/blob/main/Building/ExitGate.java"
click node_building "https://github.com/gsatish1012/parkinglot/blob/main/Building/BuildingManager.java"
click node_floors "https://github.com/gsatish1012/parkinglot/blob/main/Building/FloorManager.java"
click node_spotfactory "https://github.com/gsatish1012/parkinglot/blob/main/Parking/ParkingSpotFactory.java"
click node_spots "https://github.com/gsatish1012/parkinglot/blob/main/Parking/ParkingSpot.java"
click node_spottypes "https://github.com/gsatish1012/parkinglot/blob/main/Parking/FourWheelerSpot.java"
click node_ticketmanager "https://github.com/gsatish1012/parkinglot/blob/main/Ticket/TicketManager.java"
click node_ticketrepo "https://github.com/gsatish1012/parkinglot/blob/main/Ticket/TicketRepository.java"
click node_ticket "https://github.com/gsatish1012/parkinglot/blob/main/Ticket/Ticket.java"
click node_billingmanager "https://github.com/gsatish1012/parkinglot/blob/main/Billing/BillingManager.java"
click node_billingservice "https://github.com/gsatish1012/parkinglot/blob/main/Billing/BillingService.java"
click node_billingfactory "https://github.com/gsatish1012/parkinglot/blob/main/Billing/BillingStrategyFactory.java"
click node_billingstrategies "https://github.com/gsatish1012/parkinglot/blob/main/Billing/HourlyBillingStrategy.java"
click node_bill "https://github.com/gsatish1012/parkinglot/blob/main/Billing/Bill.java"
click node_paymentmanager "https://github.com/gsatish1012/parkinglot/blob/main/Payment/PaymentManager.java"
click node_paymentservice "https://github.com/gsatish1012/parkinglot/blob/main/Payment/PaymentService.java"
click node_paymentfactory "https://github.com/gsatish1012/parkinglot/blob/main/Payment/PaymentStrategyFactory.java"
click node_paymentstrategies "https://github.com/gsatish1012/parkinglot/blob/main/Payment/CardPaymentStrategy.java"
click node_payment "https://github.com/gsatish1012/parkinglot/blob/main/Payment/Payment.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_entrygate,node_exitgate,node_building,node_floors,node_spotfactory,node_spots,node_spottypes toneBlue
class node_ticketmanager,node_ticketrepo,node_ticket toneAmber
class node_billingmanager,node_billingservice,node_billingfactory,node_billingstrategies,node_bill toneMint
class node_paymentmanager,node_paymentservice,node_paymentfactory,node_paymentstrategies,node_payment toneRose
class node_driver toneTeal
```

## Components

### Entry and Parking

- [Entry Gate](https://github.com/gsatish1012/parkinglot/blob/main/Building/EntryGate.java): `Building/EntryGate.java`
- [Exit Gate](https://github.com/gsatish1012/parkinglot/blob/main/Building/ExitGate.java): `Building/ExitGate.java`
- [Building Manager](https://github.com/gsatish1012/parkinglot/blob/main/Building/BuildingManager.java): `Building/BuildingManager.java`
- [Floor Manager](https://github.com/gsatish1012/parkinglot/blob/main/Building/FloorManager.java): `Building/FloorManager.java`
- [Spot Factory](https://github.com/gsatish1012/parkinglot/blob/main/Parking/ParkingSpotFactory.java): `Parking/ParkingSpotFactory.java`
- [Parking Spots](https://github.com/gsatish1012/parkinglot/blob/main/Parking/ParkingSpot.java): `Parking/ParkingSpot.java`
- [Spot Types](https://github.com/gsatish1012/parkinglot/blob/main/Parking/FourWheelerSpot.java): `Parking/FourWheelerSpot.java`

### Ticketing

- [Ticket Manager](https://github.com/gsatish1012/parkinglot/blob/main/Ticket/TicketManager.java): `Ticket/TicketManager.java`
- [Ticket Repository](https://github.com/gsatish1012/parkinglot/blob/main/Ticket/TicketRepository.java): `Ticket/TicketRepository.java`
- [Parking Ticket](https://github.com/gsatish1012/parkinglot/blob/main/Ticket/Ticket.java): `Ticket/Ticket.java`

### Billing

- [Billing Manager](https://github.com/gsatish1012/parkinglot/blob/main/Billing/BillingManager.java): `Billing/BillingManager.java`
- [Billing Service](https://github.com/gsatish1012/parkinglot/blob/main/Billing/BillingService.java): `Billing/BillingService.java`
- [Billing Strategy Factory](https://github.com/gsatish1012/parkinglot/blob/main/Billing/BillingStrategyFactory.java): `Billing/BillingStrategyFactory.java`
- [Hourly and Daily Rates](https://github.com/gsatish1012/parkinglot/blob/main/Billing/HourlyBillingStrategy.java): `Billing/HourlyBillingStrategy.java`
- [Bill](https://github.com/gsatish1012/parkinglot/blob/main/Billing/Bill.java): `Billing/Bill.java`

### Payments

- [Payment Manager](https://github.com/gsatish1012/parkinglot/blob/main/Payment/PaymentManager.java): `Payment/PaymentManager.java`
- [Payment Service](https://github.com/gsatish1012/parkinglot/blob/main/Payment/PaymentService.java): `Payment/PaymentService.java`
- [Payment Strategy Factory](https://github.com/gsatish1012/parkinglot/blob/main/Payment/PaymentStrategyFactory.java): `Payment/PaymentStrategyFactory.java`
- [Payment Methods](https://github.com/gsatish1012/parkinglot/blob/main/Payment/CardPaymentStrategy.java): `Payment/CardPaymentStrategy.java`
- [Payment Record](https://github.com/gsatish1012/parkinglot/blob/main/Payment/Payment.java): `Payment/Payment.java`

### Other components

- [Application](https://github.com/gsatish1012/parkinglot/blob/main/App.java): `App.java`

## Connections

- Application → Entry Gate: starts entry (evidence: `App.java`)
- Application → Exit Gate: starts exit (evidence: `App.java`)
- Application → Building Manager: configures (evidence: `App.java`)
- Application → Ticket Manager: configures (evidence: `App.java`)
- Application → Billing Manager: configures (evidence: `App.java`)
- Application → Payment Manager: configures (evidence: `App.java`)
- Entry Gate → Building Manager: requests allocation (evidence: `Building/EntryGate.java`)
- Entry Gate → Ticket Manager: creates ticket (evidence: `Building/EntryGate.java`)
- Building Manager → Floor Manager: delegates floor management (evidence: `Building/BuildingManager.java`)
- Building Manager → Ticket Repository: references tickets (evidence: `Building/BuildingManager.java`)
- Floor Manager → Spot Factory: creates spots (evidence: `Building/FloorManager.java`)
- Spot Factory → Spot Types: selects spot type (evidence: `Parking/ParkingSpotFactory.java`)
- Ticket Manager → Ticket Repository: stores tickets (evidence: `Ticket/TicketManager.java`)
- Ticket Manager → Parking Ticket: creates ticket (evidence: `Ticket/TicketManager.java`)
- Parking Ticket → Parking Spots: records assigned spot (evidence: `Ticket/Ticket.java`)
- Exit Gate → Billing Manager: requests bill (evidence: `Building/ExitGate.java`)
- Billing Manager → Billing Service: calculates charge (evidence: `Billing/BillingManager.java`)
- Billing Manager → Bill: creates bill (evidence: `Billing/BillingManager.java`)
- Billing Service → Billing Strategy Factory: selects strategy (evidence: `Billing/BillingService.java`)
- Billing Strategy Factory → Hourly and Daily Rates: creates rate strategy (evidence: `Billing/BillingStrategyFactory.java`)
- Billing Service → Parking Ticket: reads ticket details (evidence: `Billing/BillingService.java`)
- Exit Gate → Payment Manager: submits payment (evidence: `Building/ExitGate.java`)
- Payment Manager → Bill: reads bill amount (evidence: `Payment/PaymentManager.java`)
- Payment Manager → Payment Service: processes payment (evidence: `Payment/PaymentManager.java`)
- Payment Manager → Payment Record: records result (evidence: `Payment/PaymentManager.java`)
- Payment Service → Payment Strategy Factory: selects strategy (evidence: `Payment/PaymentService.java`)
- Payment Strategy Factory → Payment Methods: creates method strategy (evidence: `Payment/PaymentStrategyFactory.java`)
- Exit Gate → Ticket Repository: references ticket store (evidence: `Building/ExitGate.java`)
