# ripon1995/car-management architecture

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

- Interactive diagram: https://gitdiagram.com/ripon1995/car-management
- Repository: https://github.com/ripon1995/car-management

## Overview

Car Management tracks fleet assets and their commercial and operating records. A user navigates protected React pages, which use API modules to manage records through a versioned FastAPI backend; the backend’s feature packages separate routing, business services, and persistence. The README identifies leases between owners’ cars and vendors, drivers assigned to cars, car-scoped maintenance, documents and payments, and dashboard revenue computed from payments. Several backend route registrations and most page-to-API calls were not shown, so those links are omitted or marked unverified.

Main entry points: [`backend/app/api.py`](https://github.com/ripon1995/car-management/blob/main/backend/app/api.py) (Versioned API router), [`frontend/src/App.tsx`](https://github.com/ripon1995/car-management/blob/main/frontend/src/App.tsx) (React app routes), [`backend/app/features/payments/service.py`](https://github.com/ripon1995/car-management/blob/main/backend/app/features/payments/service.py) (Payments), [`frontend/src/pages/PaymentsPage.tsx`](https://github.com/ripon1995/car-management/blob/main/frontend/src/pages/PaymentsPage.tsx) (Payments page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web application"]
  node_app["React app routes<br/>[App.tsx]"]
  node_payments_ui["Payments page<br/>[PaymentsPage.tsx]"]
  node_frontend_api["API client<br/>[client.ts]"]
  node_car_owners_ui["Owners page<br/>[CarOwnersPage.tsx]"]
  node_cars_ui["Cars page<br/>[CarsPage.tsx]"]
  node_leases_ui["Leases page<br/>[LeasesPage.tsx]"]
  node_income_ui["Income page<br/>[IncomePage.tsx]"]
  node_dashboard_ui["Dashboard page<br/>[DashboardPage.tsx]"]
  node_drivers_ui["Drivers page<br/>[DriversPage.tsx]"]
  node_vendors_ui["Vendors page<br/>[VendorsPage.tsx]"]
  node_maintenance_ui["Maintenance page"]
  node_fuel_ui["Fuel page<br/>[FuelPage.tsx]"]
  node_docs_ui["Car docs page<br/>[CarDocsPage.tsx]"]
end

subgraph group_backend["API and access"]
  node_api_service["FastAPI application<br/>[main.py]"]
  node_api_router["Versioned API router<br/>[api.py]"]
  node_db[("Postgres database<br/>[session.py]")]
end

subgraph group_fleet["Fleet records"]
  node_cars["Cars<br/>[service.py]"]
  node_owners["Car owners<br/>[service.py]"]
  node_drivers["Drivers<br/>[service.py]"]
  node_vendors["Vendors<br/>[service.py]"]
  node_leases["Leases<br/>[service.py]"]
end

subgraph group_operations["Operations and finance"]
  node_car_docs["Car documents<br/>[service.py]"]
  node_maintenance["Maintenance<br/>[service.py]"]
  node_fuel["Fuel records<br/>[service.py]"]
  node_payments["Payments<br/>[service.py]"]
  node_income["Lease income<br/>[service.py]"]
  node_revenue["Revenue dashboard<br/>[service.py]"]
end

node_user(("Fleet user"))
node_external_api{{"HTTP API"}}

node_user -->|"navigates"| node_app
node_app -->|"routes to"| node_payments_ui
node_app -->|"routes to"| node_cars_ui
node_app -->|"routes to"| node_car_owners_ui
node_app -->|"routes to"| node_leases_ui
node_app -->|"routes to"| node_income_ui
node_app -->|"routes to"| node_dashboard_ui
node_app -->|"routes to"| node_drivers_ui
node_app -->|"routes to"| node_vendors_ui
node_app -->|"routes to"| node_maintenance_ui
node_app -->|"routes to"| node_fuel_ui
node_app -->|"routes to"| node_docs_ui
node_payments_ui -.->|"uses API"| node_frontend_api
node_frontend_api -->|"sends requests"| node_external_api
node_api_service -->|"mounts"| node_api_router
node_external_api -.->|"serves requests"| node_api_router
node_api_router -.->|"dispatches"| node_cars
node_api_router -.->|"dispatches"| node_owners
node_api_router -.->|"dispatches"| node_drivers
node_api_router -.->|"dispatches"| node_vendors
node_api_router -.->|"dispatches"| node_leases
node_api_router -.->|"dispatches"| node_car_docs
node_api_router -.->|"dispatches"| node_maintenance
node_api_router -.->|"dispatches"| node_fuel
node_api_router -.->|"dispatches"| node_payments
node_api_router -.->|"dispatches"| node_income
node_api_router -.->|"dispatches"| node_revenue
node_fuel -->|"creates linked payment"| node_payments
node_leases -->|"generates income"| node_income
node_revenue -->|"reads records"| node_payments
node_revenue -->|"reads records"| node_income
node_payments_ui -.->|"manages payments"| node_external_api
node_cars -.->|"persists records"| node_db
node_payments -.->|"persists records"| node_db

click node_app "https://github.com/ripon1995/car-management/blob/main/frontend/src/App.tsx"
click node_payments_ui "https://github.com/ripon1995/car-management/blob/main/frontend/src/pages/PaymentsPage.tsx"
click node_frontend_api "https://github.com/ripon1995/car-management/blob/main/frontend/src/api/client.ts"
click node_api_service "https://github.com/ripon1995/car-management/blob/main/backend/app/main.py"
click node_api_router "https://github.com/ripon1995/car-management/blob/main/backend/app/api.py"
click node_db "https://github.com/ripon1995/car-management/blob/main/backend/app/db/session.py"
click node_cars "https://github.com/ripon1995/car-management/blob/main/backend/app/features/cars/service.py"
click node_owners "https://github.com/ripon1995/car-management/blob/main/backend/app/features/car_owners/service.py"
click node_drivers "https://github.com/ripon1995/car-management/blob/main/backend/app/features/drivers/service.py"
click node_vendors "https://github.com/ripon1995/car-management/blob/main/backend/app/features/vendors/service.py"
click node_leases "https://github.com/ripon1995/car-management/blob/main/backend/app/features/leases/service.py"
click node_car_docs "https://github.com/ripon1995/car-management/blob/main/backend/app/features/car_docs/service.py"
click node_maintenance "https://github.com/ripon1995/car-management/blob/main/backend/app/features/maintenance/service.py"
click node_fuel "https://github.com/ripon1995/car-management/blob/main/backend/app/features/fuel/service.py"
click node_payments "https://github.com/ripon1995/car-management/blob/main/backend/app/features/payments/service.py"
click node_income "https://github.com/ripon1995/car-management/blob/main/backend/app/features/income/service.py"
click node_revenue "https://github.com/ripon1995/car-management/blob/main/backend/app/features/revenue/service.py"
click node_car_owners_ui "https://github.com/ripon1995/car-management/blob/main/frontend/src/pages/CarOwnersPage.tsx"
click node_cars_ui "https://github.com/ripon1995/car-management/blob/main/frontend/src/pages/CarsPage.tsx"
click node_leases_ui "https://github.com/ripon1995/car-management/blob/main/frontend/src/pages/LeasesPage.tsx"
click node_income_ui "https://github.com/ripon1995/car-management/blob/main/frontend/src/pages/IncomePage.tsx"
click node_dashboard_ui "https://github.com/ripon1995/car-management/blob/main/frontend/src/pages/DashboardPage.tsx"
click node_drivers_ui "https://github.com/ripon1995/car-management/blob/main/frontend/src/pages/DriversPage.tsx"
click node_vendors_ui "https://github.com/ripon1995/car-management/blob/main/frontend/src/pages/VendorsPage.tsx"
click node_maintenance_ui "https://github.com/ripon1995/car-management/blob/main/frontend/src/pages/MaintenancePage.tsx"
click node_fuel_ui "https://github.com/ripon1995/car-management/blob/main/frontend/src/pages/FuelPage.tsx"
click node_docs_ui "https://github.com/ripon1995/car-management/blob/main/frontend/src/pages/CarDocsPage.tsx"

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_app,node_payments_ui,node_frontend_api,node_car_owners_ui,node_cars_ui,node_leases_ui,node_income_ui,node_dashboard_ui,node_drivers_ui,node_vendors_ui,node_maintenance_ui,node_fuel_ui,node_docs_ui,node_user toneBlue
class node_api_service,node_api_router,node_db toneAmber
class node_cars,node_owners,node_drivers,node_vendors,node_leases,node_external_api toneMint
class node_car_docs,node_maintenance,node_fuel,node_payments,node_income,node_revenue toneRose
```

## Components

### Web application

- [React app routes](https://github.com/ripon1995/car-management/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Payments page](https://github.com/ripon1995/car-management/blob/main/frontend/src/pages/PaymentsPage.tsx): `frontend/src/pages/PaymentsPage.tsx`
- [API client](https://github.com/ripon1995/car-management/blob/main/frontend/src/api/client.ts): `frontend/src/api/client.ts`
- [Owners page](https://github.com/ripon1995/car-management/blob/main/frontend/src/pages/CarOwnersPage.tsx): `frontend/src/pages/CarOwnersPage.tsx`
- [Cars page](https://github.com/ripon1995/car-management/blob/main/frontend/src/pages/CarsPage.tsx): `frontend/src/pages/CarsPage.tsx`
- [Leases page](https://github.com/ripon1995/car-management/blob/main/frontend/src/pages/LeasesPage.tsx): `frontend/src/pages/LeasesPage.tsx`
- [Income page](https://github.com/ripon1995/car-management/blob/main/frontend/src/pages/IncomePage.tsx): `frontend/src/pages/IncomePage.tsx`
- [Dashboard page](https://github.com/ripon1995/car-management/blob/main/frontend/src/pages/DashboardPage.tsx): `frontend/src/pages/DashboardPage.tsx`
- [Drivers page](https://github.com/ripon1995/car-management/blob/main/frontend/src/pages/DriversPage.tsx): `frontend/src/pages/DriversPage.tsx`
- [Vendors page](https://github.com/ripon1995/car-management/blob/main/frontend/src/pages/VendorsPage.tsx): `frontend/src/pages/VendorsPage.tsx`
- [Maintenance page](https://github.com/ripon1995/car-management/blob/main/frontend/src/pages/MaintenancePage.tsx): `frontend/src/pages/MaintenancePage.tsx`
- [Fuel page](https://github.com/ripon1995/car-management/blob/main/frontend/src/pages/FuelPage.tsx): `frontend/src/pages/FuelPage.tsx`
- [Car docs page](https://github.com/ripon1995/car-management/blob/main/frontend/src/pages/CarDocsPage.tsx): `frontend/src/pages/CarDocsPage.tsx`

### API and access

- [FastAPI application](https://github.com/ripon1995/car-management/blob/main/backend/app/main.py): `backend/app/main.py`
- [Versioned API router](https://github.com/ripon1995/car-management/blob/main/backend/app/api.py): `backend/app/api.py`
- [Postgres database](https://github.com/ripon1995/car-management/blob/main/backend/app/db/session.py): `backend/app/db/session.py`

### Fleet records

- [Cars](https://github.com/ripon1995/car-management/blob/main/backend/app/features/cars/service.py): `backend/app/features/cars/service.py`
- [Car owners](https://github.com/ripon1995/car-management/blob/main/backend/app/features/car_owners/service.py): `backend/app/features/car_owners/service.py`
- [Drivers](https://github.com/ripon1995/car-management/blob/main/backend/app/features/drivers/service.py): `backend/app/features/drivers/service.py`
- [Vendors](https://github.com/ripon1995/car-management/blob/main/backend/app/features/vendors/service.py): `backend/app/features/vendors/service.py`
- [Leases](https://github.com/ripon1995/car-management/blob/main/backend/app/features/leases/service.py): `backend/app/features/leases/service.py`

### Operations and finance

- [Car documents](https://github.com/ripon1995/car-management/blob/main/backend/app/features/car_docs/service.py): `backend/app/features/car_docs/service.py`
- [Maintenance](https://github.com/ripon1995/car-management/blob/main/backend/app/features/maintenance/service.py): `backend/app/features/maintenance/service.py`
- [Fuel records](https://github.com/ripon1995/car-management/blob/main/backend/app/features/fuel/service.py): `backend/app/features/fuel/service.py`
- [Payments](https://github.com/ripon1995/car-management/blob/main/backend/app/features/payments/service.py): `backend/app/features/payments/service.py`
- [Lease income](https://github.com/ripon1995/car-management/blob/main/backend/app/features/income/service.py): `backend/app/features/income/service.py`
- [Revenue dashboard](https://github.com/ripon1995/car-management/blob/main/backend/app/features/revenue/service.py): `backend/app/features/revenue/service.py`

### Other components

- **Fleet user**
- **HTTP API**

## Connections

- Fleet user → React app routes: navigates (evidence: `frontend/src/App.tsx`)
- React app routes → Payments page: routes to (evidence: `frontend/src/App.tsx`)
- React app routes → Cars page: routes to (evidence: `frontend/src/App.tsx`)
- React app routes → Owners page: routes to (evidence: `frontend/src/App.tsx`)
- React app routes → Leases page: routes to (evidence: `frontend/src/App.tsx`)
- React app routes → Income page: routes to (evidence: `frontend/src/App.tsx`)
- React app routes → Dashboard page: routes to (evidence: `frontend/src/App.tsx`)
- React app routes → Drivers page: routes to (evidence: `frontend/src/App.tsx`)
- React app routes → Vendors page: routes to (evidence: `frontend/src/App.tsx`)
- React app routes → Maintenance page: routes to (evidence: `frontend/src/App.tsx`)
- React app routes → Fuel page: routes to (evidence: `frontend/src/App.tsx`)
- React app routes → Car docs page: routes to (evidence: `frontend/src/App.tsx`)
- Payments page → API client: uses API
- API client → HTTP API: sends requests (evidence: `frontend/src/api/client.ts`)
- FastAPI application → Versioned API router: mounts (evidence: `backend/app/main.py`)
- HTTP API → Versioned API router: serves requests
- Versioned API router → Cars: dispatches
- Versioned API router → Car owners: dispatches
- Versioned API router → Drivers: dispatches
- Versioned API router → Vendors: dispatches
- Versioned API router → Leases: dispatches
- Versioned API router → Car documents: dispatches
- Versioned API router → Maintenance: dispatches
- Versioned API router → Fuel records: dispatches
- Versioned API router → Payments: dispatches
- Versioned API router → Lease income: dispatches
- Versioned API router → Revenue dashboard: dispatches
- Fuel records → Payments: creates linked payment (evidence: `backend/app/features/fuel/service.py`)
- Leases → Lease income: generates income (evidence: `backend/app/features/leases/service.py`)
- Revenue dashboard → Payments: reads records (evidence: `backend/app/features/revenue/service.py`)
- Revenue dashboard → Lease income: reads records (evidence: `backend/app/features/revenue/service.py`)
- Payments page → HTTP API: manages payments
- Cars → Postgres database: persists records
- Payments → Postgres database: persists records
