# dykriooo/parking_lot_lld architecture

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

## Overview

This is a parking-lot management model: vehicles enter, receive a ticket for a compatible occupied spot, then calculate and pay a fee before the spot is released. ParkingLot owns the central workflow; floors and spots manage capacity, while pricing and payment strategies provide interchangeable policies. Gate and vehicle-factory capabilities are represented from the source index, but their full implementations were not excerpted. The README provides no additional capability details.

Main entry points: [`service/ParkingLot.py`](https://github.com/dykriooo/parking_lot_lld/blob/main/service/ParkingLot.py) (Parking lot), [`factory/PaymentStrategyFactory.py`](https://github.com/dykriooo/parking_lot_lld/blob/main/factory/PaymentStrategyFactory.py) (Payment factory), [`strategy/payment/PaymentStrategy.py`](https://github.com/dykriooo/parking_lot_lld/blob/main/strategy/payment/PaymentStrategy.py) (Payment contract), [`factory/PricingStrategyFactory.py`](https://github.com/dykriooo/parking_lot_lld/blob/main/factory/PricingStrategyFactory.py) (Pricing factory)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_operations["Parking operations"]
  node_entry["Entry gate<br/>[EntryGate.py]"]
  node_lot["Parking lot<br/>[ParkingLot.py]"]
  node_exit["Exit gate<br/>[ExitGate.py]"]
end

subgraph group_domain["Parking domain"]
  node_floor["Parking floor<br/>[ParkingFloor.py]"]
  node_spot["Parking spot<br/>[ParkingSpot.py]"]
  node_ticket["Parking ticket<br/>[Ticket.py]"]
  node_vehicle["Vehicle types<br/>[Vehicle.py]"]
  node_vehicle_factory["Vehicle factory<br/>[VehicleFactory.py]"]
  node_gates["Gate model<br/>[Gate.py]"]
  node_enums["Domain enums"]
end

subgraph group_pricing["Pricing"]
  node_pricing_factory["Pricing factory"]
  node_pricing_contract["Pricing contract<br/>[PricingStrategy.py]"]
  node_time_pricing["Time pricing"]
  node_event_pricing["Event pricing"]
end

subgraph group_payments["Payments and factories"]
  node_payment_factory["Payment factory"]
  node_payment_processor["Payment processor"]
  node_payment_contract["Payment contract<br/>[PaymentStrategy.py]"]
  node_cash["Cash payment<br/>[CashPayment.py]"]
  node_card["Card payment<br/>[CardPayment.py]"]
  node_upi["UPI payment<br/>[UPIPayment.py]"]
end

node_driver(("Parking user"))

node_entry -->|"parks through"| node_lot
node_exit -->|"exits through"| node_lot
node_lot -->|"searches floors"| node_floor
node_lot -->|"creates ticket"| node_ticket
node_lot -->|"selects pricing"| node_pricing_factory
node_lot -->|"calculates fee"| node_pricing_contract
node_lot -->|"selects payment"| node_payment_factory
node_lot -->|"processes payment"| node_payment_processor
node_lot -->|"vacates spot"| node_spot
node_floor -->|"finds available"| node_spot
node_pricing_factory -->|"creates strategy"| node_time_pricing
node_pricing_factory -->|"creates strategy"| node_event_pricing
node_time_pricing -->|"implements"| node_pricing_contract
node_event_pricing -->|"implements"| node_pricing_contract
node_payment_factory -->|"creates strategy"| node_cash
node_payment_factory -->|"creates strategy"| node_card
node_payment_factory -->|"creates strategy"| node_upi
node_payment_processor -->|"invokes payment"| node_payment_contract
node_cash -->|"implements"| node_payment_contract
node_card -->|"implements"| node_payment_contract
node_upi -->|"implements"| node_payment_contract
node_vehicle_factory -->|"creates vehicles"| node_vehicle
node_entry -->|"uses gate model"| node_gates
node_exit -->|"uses gate model"| node_gates
node_driver -.->|"initiates parking"| node_entry
node_driver -.->|"requests exit"| node_exit

click node_entry "https://github.com/dykriooo/parking_lot_lld/blob/main/model/EntryGate.py"
click node_lot "https://github.com/dykriooo/parking_lot_lld/blob/main/service/ParkingLot.py"
click node_exit "https://github.com/dykriooo/parking_lot_lld/blob/main/model/ExitGate.py"
click node_floor "https://github.com/dykriooo/parking_lot_lld/blob/main/model/ParkingFloor.py"
click node_spot "https://github.com/dykriooo/parking_lot_lld/blob/main/model/ParkingSpot.py"
click node_ticket "https://github.com/dykriooo/parking_lot_lld/blob/main/model/Ticket.py"
click node_vehicle "https://github.com/dykriooo/parking_lot_lld/blob/main/model/Vehicle.py"
click node_vehicle_factory "https://github.com/dykriooo/parking_lot_lld/blob/main/factory/VehicleFactory.py"
click node_gates "https://github.com/dykriooo/parking_lot_lld/blob/main/model/Gate.py"
click node_enums "https://github.com/dykriooo/parking_lot_lld/tree/main/enums"
click node_pricing_factory "https://github.com/dykriooo/parking_lot_lld/blob/main/factory/PricingStrategyFactory.py"
click node_pricing_contract "https://github.com/dykriooo/parking_lot_lld/blob/main/strategy/pricing/PricingStrategy.py"
click node_time_pricing "https://github.com/dykriooo/parking_lot_lld/blob/main/strategy/pricing/TimeBasedPricing.py"
click node_event_pricing "https://github.com/dykriooo/parking_lot_lld/blob/main/strategy/pricing/EventBasedPricing.py"
click node_payment_factory "https://github.com/dykriooo/parking_lot_lld/blob/main/factory/PaymentStrategyFactory.py"
click node_payment_processor "https://github.com/dykriooo/parking_lot_lld/blob/main/service/PaymentProcessor.py"
click node_payment_contract "https://github.com/dykriooo/parking_lot_lld/blob/main/strategy/payment/PaymentStrategy.py"
click node_cash "https://github.com/dykriooo/parking_lot_lld/blob/main/strategy/payment/CashPayment.py"
click node_card "https://github.com/dykriooo/parking_lot_lld/blob/main/strategy/payment/CardPayment.py"
click node_upi "https://github.com/dykriooo/parking_lot_lld/blob/main/strategy/payment/UPIPayment.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_entry,node_lot,node_exit,node_driver toneBlue
class node_floor,node_spot,node_ticket,node_vehicle,node_vehicle_factory,node_gates,node_enums toneAmber
class node_pricing_factory,node_pricing_contract,node_time_pricing,node_event_pricing toneMint
class node_payment_factory,node_payment_processor,node_payment_contract,node_cash,node_card,node_upi toneRose
```

## Components

### Parking operations

- [Entry gate](https://github.com/dykriooo/parking_lot_lld/blob/main/model/EntryGate.py): `model/EntryGate.py`
- [Parking lot](https://github.com/dykriooo/parking_lot_lld/blob/main/service/ParkingLot.py): `service/ParkingLot.py`
- [Exit gate](https://github.com/dykriooo/parking_lot_lld/blob/main/model/ExitGate.py): `model/ExitGate.py`

### Parking domain

- [Parking floor](https://github.com/dykriooo/parking_lot_lld/blob/main/model/ParkingFloor.py): `model/ParkingFloor.py`
- [Parking spot](https://github.com/dykriooo/parking_lot_lld/blob/main/model/ParkingSpot.py): `model/ParkingSpot.py`
- [Parking ticket](https://github.com/dykriooo/parking_lot_lld/blob/main/model/Ticket.py): `model/Ticket.py`
- [Vehicle types](https://github.com/dykriooo/parking_lot_lld/blob/main/model/Vehicle.py): `model/Vehicle.py`
- [Vehicle factory](https://github.com/dykriooo/parking_lot_lld/blob/main/factory/VehicleFactory.py): `factory/VehicleFactory.py`
- [Gate model](https://github.com/dykriooo/parking_lot_lld/blob/main/model/Gate.py): `model/Gate.py`
- [Domain enums](https://github.com/dykriooo/parking_lot_lld/tree/main/enums): `enums`

### Pricing

- [Pricing factory](https://github.com/dykriooo/parking_lot_lld/blob/main/factory/PricingStrategyFactory.py): `factory/PricingStrategyFactory.py`
- [Pricing contract](https://github.com/dykriooo/parking_lot_lld/blob/main/strategy/pricing/PricingStrategy.py): `strategy/pricing/PricingStrategy.py`
- [Time pricing](https://github.com/dykriooo/parking_lot_lld/blob/main/strategy/pricing/TimeBasedPricing.py): `strategy/pricing/TimeBasedPricing.py`
- [Event pricing](https://github.com/dykriooo/parking_lot_lld/blob/main/strategy/pricing/EventBasedPricing.py): `strategy/pricing/EventBasedPricing.py`

### Payments and factories

- [Payment factory](https://github.com/dykriooo/parking_lot_lld/blob/main/factory/PaymentStrategyFactory.py): `factory/PaymentStrategyFactory.py`
- [Payment processor](https://github.com/dykriooo/parking_lot_lld/blob/main/service/PaymentProcessor.py): `service/PaymentProcessor.py`
- [Payment contract](https://github.com/dykriooo/parking_lot_lld/blob/main/strategy/payment/PaymentStrategy.py): `strategy/payment/PaymentStrategy.py`
- [Cash payment](https://github.com/dykriooo/parking_lot_lld/blob/main/strategy/payment/CashPayment.py): `strategy/payment/CashPayment.py`
- [Card payment](https://github.com/dykriooo/parking_lot_lld/blob/main/strategy/payment/CardPayment.py): `strategy/payment/CardPayment.py`
- [UPI payment](https://github.com/dykriooo/parking_lot_lld/blob/main/strategy/payment/UPIPayment.py): `strategy/payment/UPIPayment.py`

### Other components

- **Parking user**

## Connections

- Entry gate → Parking lot: parks through (evidence: `model/EntryGate.py`)
- Exit gate → Parking lot: exits through (evidence: `model/ExitGate.py`)
- Parking lot → Parking floor: searches floors (evidence: `service/ParkingLot.py`)
- Parking lot → Parking ticket: creates ticket (evidence: `service/ParkingLot.py`)
- Parking lot → Pricing factory: selects pricing (evidence: `service/ParkingLot.py`)
- Parking lot → Pricing contract: calculates fee (evidence: `service/ParkingLot.py`)
- Parking lot → Payment factory: selects payment (evidence: `service/ParkingLot.py`)
- Parking lot → Payment processor: processes payment (evidence: `service/ParkingLot.py`)
- Parking lot → Parking spot: vacates spot (evidence: `service/ParkingLot.py`)
- Parking floor → Parking spot: finds available (evidence: `model/ParkingFloor.py`)
- Pricing factory → Time pricing: creates strategy (evidence: `factory/PricingStrategyFactory.py`)
- Pricing factory → Event pricing: creates strategy (evidence: `factory/PricingStrategyFactory.py`)
- Time pricing → Pricing contract: implements (evidence: `strategy/pricing/TimeBasedPricing.py`)
- Event pricing → Pricing contract: implements (evidence: `strategy/pricing/EventBasedPricing.py`)
- Payment factory → Cash payment: creates strategy (evidence: `factory/PaymentStrategyFactory.py`)
- Payment factory → Card payment: creates strategy (evidence: `factory/PaymentStrategyFactory.py`)
- Payment factory → UPI payment: creates strategy (evidence: `factory/PaymentStrategyFactory.py`)
- Payment processor → Payment contract: invokes payment (evidence: `service/PaymentProcessor.py`)
- Cash payment → Payment contract: implements (evidence: `strategy/payment/CashPayment.py`)
- Card payment → Payment contract: implements (evidence: `strategy/payment/CardPayment.py`)
- UPI payment → Payment contract: implements (evidence: `strategy/payment/UPIPayment.py`)
- Vehicle factory → Vehicle types: creates vehicles (evidence: `factory/VehicleFactory.py`)
- Entry gate → Gate model: uses gate model (evidence: `model/EntryGate.py`)
- Exit gate → Gate model: uses gate model (evidence: `model/ExitGate.py`)
- Parking user → Entry gate: initiates parking
- Parking user → Exit gate: requests exit
