# chiku7665/parking_system architecture

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

- Interactive diagram: https://gitdiagram.com/chiku7665/parking_system
- Repository: https://github.com/chiku7665/parking_system

## Overview

This is a small Express parking API. A client reaches the server, which connects to MongoDB and mounts booking and fee routes: booking requests save booking records, while fee requests look up fee data and calculate a charge. Parking and slot schemas are present, but the excerpts show no route using them. The map follows the shown wiring; it does not infer missing CRUD behavior or relationships for those models.

Main entry points: [`index.js`](https://github.com/chiku7665/parking_system/blob/main/index.js) (Express server), [`booking.js`](https://github.com/chiku7665/parking_system/blob/main/booking.js) (Booking route), [`fee_calculation.js`](https://github.com/chiku7665/parking_system/blob/main/fee_calculation.js) (Fee route), [`db_connect.js`](https://github.com/chiku7665/parking_system/blob/main/db_connect.js) (DB connector)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API runtime"]
  node_server["Express server<br/>[index.js]"]
  node_booking_route["Booking route<br/>[booking.js]"]
  node_fee_route["Fee route<br/>[fee_calculation.js]"]
end

subgraph group_domain["Parking domain"]
  node_booking_model["Booking model<br/>[booking_model.js]"]
  node_fee_model["Fee model<br/>[fee_model.js]"]
  node_parking_model["Parking model<br/>[parking_model.js]"]
  node_slot_model["Slot model<br/>[slot_model.js]"]
end

subgraph group_persistence["Persistence"]
  node_db_connector["DB connector<br/>[db_connect.js]"]
  node_mongodb[("MongoDB")]
end

node_client(("API client"))

node_client -->|"sends requests"| node_server
node_server -->|"mounts route"| node_booking_route
node_server -->|"mounts route"| node_fee_route
node_server -->|"connects database"| node_db_connector
node_booking_route -->|"saves booking"| node_booking_model
node_fee_route -->|"queries fees"| node_fee_model
node_db_connector -->|"connects"| node_mongodb

click node_server "https://github.com/chiku7665/parking_system/blob/main/index.js"
click node_booking_route "https://github.com/chiku7665/parking_system/blob/main/booking.js"
click node_fee_route "https://github.com/chiku7665/parking_system/blob/main/fee_calculation.js"
click node_booking_model "https://github.com/chiku7665/parking_system/blob/main/booking_model.js"
click node_fee_model "https://github.com/chiku7665/parking_system/blob/main/fee_model.js"
click node_parking_model "https://github.com/chiku7665/parking_system/blob/main/parking_model.js"
click node_slot_model "https://github.com/chiku7665/parking_system/blob/main/slot_model.js"
click node_db_connector "https://github.com/chiku7665/parking_system/blob/main/db_connect.js"

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_server,node_booking_route,node_fee_route,node_client toneBlue
class node_booking_model,node_fee_model,node_parking_model,node_slot_model toneAmber
class node_db_connector,node_mongodb toneMint
```

## Components

### API runtime

- [Express server](https://github.com/chiku7665/parking_system/blob/main/index.js): `index.js`
- [Booking route](https://github.com/chiku7665/parking_system/blob/main/booking.js): `booking.js`
- [Fee route](https://github.com/chiku7665/parking_system/blob/main/fee_calculation.js): `fee_calculation.js`

### Parking domain

- [Booking model](https://github.com/chiku7665/parking_system/blob/main/booking_model.js): `booking_model.js`
- [Fee model](https://github.com/chiku7665/parking_system/blob/main/fee_model.js): `fee_model.js`
- [Parking model](https://github.com/chiku7665/parking_system/blob/main/parking_model.js): `parking_model.js`
- [Slot model](https://github.com/chiku7665/parking_system/blob/main/slot_model.js): `slot_model.js`

### Persistence

- [DB connector](https://github.com/chiku7665/parking_system/blob/main/db_connect.js): `db_connect.js`
- **MongoDB**

### Other components

- **API client**

## Connections

- API client → Express server: sends requests (evidence: `index.js`)
- Express server → Booking route: mounts route (evidence: `index.js`)
- Express server → Fee route: mounts route (evidence: `index.js`)
- Express server → DB connector: connects database (evidence: `index.js`)
- Booking route → Booking model: saves booking (evidence: `booking.js`)
- Fee route → Fee model: queries fees (evidence: `fee_calculation.js`)
- DB connector → MongoDB: connects (evidence: `db_connect.js`)
