# sofianesmoun/fleet-manager-pro-v1- architecture

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

- Interactive diagram: https://gitdiagram.com/sofianesmoun/fleet-manager-pro-v1-
- Repository: https://github.com/sofianesmoun/fleet-manager-pro-v1-

## Overview

FleetManager Pro is a fleet-management web application for Algerian SMEs. Users sign in, then work with vehicles, rentals, clients and garages through role-restricted pages; requests pass through Express routes to domain handlers and services that access PostgreSQL. The README also documents audit logs, backups, and authentication flows. Several backend services and frontend pages are unsampled, so their presence is represented where documented, but unverified connections are omitted or marked dashed.

Main entry points: [`frontend/src/App.tsx`](https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/frontend/src/App.tsx) (Route application), [`backend/src/app.ts`](https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/backend/src/app.ts) (Express API), [`backend/src/lib/prisma.ts`](https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/backend/src/lib/prisma.ts) (PostgreSQL), [`backend/src/routes/auth.routes.ts`](https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/backend/src/routes/auth.routes.ts) (Auth routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["Route application<br/>[App.tsx]"]
  node_login["Sign in<br/>[LoginPage.tsx]"]
  node_dashboard["Dashboard<br/>[DashboardPage.tsx]"]
  node_vehicles_ui["Vehicle fleet<br/>[FlottePage.tsx]"]
  node_vehicle_detail["Vehicle detail"]
  node_rentals_ui["Rentals<br/>[LocationsPage.tsx]"]
  node_clients_ui["Clients<br/>[ClientsPage.tsx]"]
  node_client_detail["Client detail"]
  node_garages_ui["Garages<br/>[GaragesPage.tsx]"]
  node_assurance_ui["Insurance pages"]
end

subgraph group_api["API and access"]
  node_api_app["Express API<br/>[app.ts]"]
  node_auth_routes["Auth routes<br/>[auth.routes.ts]"]
  node_auth_service["Authentication<br/>[auth.service.ts]"]
end

subgraph group_fleet["Fleet operations"]
  node_vehicle_routes["Vehicle routes<br/>[vehicles.routes.ts]"]
  node_vehicle_controller["Vehicle handling"]
  node_vehicle_service["Vehicle operations<br/>[vehicleService.ts]"]
  node_client_routes["Client routes<br/>[clients.routes.ts]"]
  node_client_service["Client operations<br/>[clientService.ts]"]
  node_rental_routes["Rental routes<br/>[rentals.routes.ts]"]
  node_rental_service["Rental operations<br/>[rentalService.ts]"]
  node_garage_routes["Garage routes<br/>[garages.routes.ts]"]
  node_garage_controller["Garage handling"]
  node_garage_service["Garage operations<br/>[garageService.ts]"]
end

subgraph group_platform["Shared services"]
  node_audit["Audit logging<br/>[auditLog.ts]"]
  node_backup["Backups<br/>[backupService.ts]"]
  node_database[("PostgreSQL<br/>[prisma.ts]")]
  node_drive["Google Drive<br/>[googleDrive.ts]"]
end

node_user(("Fleet staff"))

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_vehicles_ui
node_app -->|"routes to"| node_vehicle_detail
node_app -->|"routes to"| node_rentals_ui
node_app -->|"routes to"| node_clients_ui
node_app -->|"routes to"| node_client_detail
node_app -->|"routes to"| node_garages_ui
node_app -->|"routes to"| node_assurance_ui
node_app -.->|"requests API"| node_api_app
node_api_app -->|"mounts"| node_auth_routes
node_api_app -->|"mounts"| node_vehicle_routes
node_api_app -->|"mounts"| node_client_routes
node_api_app -->|"mounts"| node_rental_routes
node_api_app -->|"mounts"| node_garage_routes
node_api_app -->|"mounts backup route"| node_backup
node_auth_routes -->|"delegates"| node_auth_service
node_vehicle_routes -->|"dispatches"| node_vehicle_controller
node_vehicle_controller -->|"calls"| node_vehicle_service
node_client_routes -.->|"delegates"| node_client_service
node_rental_routes -.->|"delegates"| node_rental_service
node_garage_routes -->|"dispatches"| node_garage_controller
node_garage_controller -->|"calls"| node_garage_service
node_garage_service -->|"reads and writes"| node_database
node_vehicle_service -->|"uses"| node_database
node_auth_service -->|"uses"| node_database
node_audit -->|"writes audit events"| node_database
node_backup -.->|"stores backups"| node_drive

click node_app "https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/frontend/src/App.tsx"
click node_login "https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/frontend/src/pages/LoginPage.tsx"
click node_dashboard "https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/frontend/src/pages/DashboardPage.tsx"
click node_vehicles_ui "https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/frontend/src/pages/FlottePage.tsx"
click node_vehicle_detail "https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/frontend/src/pages/VehicleDetailPage.tsx"
click node_rentals_ui "https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/frontend/src/pages/LocationsPage.tsx"
click node_clients_ui "https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/frontend/src/pages/ClientsPage.tsx"
click node_client_detail "https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/frontend/src/pages/ClientDetailPage.tsx"
click node_garages_ui "https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/frontend/src/pages/GaragesPage.tsx"
click node_assurance_ui "https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/frontend/src/pages/PlaceholderPage.tsx"
click node_api_app "https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/backend/src/app.ts"
click node_auth_routes "https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/backend/src/routes/auth.routes.ts"
click node_auth_service "https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/backend/src/services/auth.service.ts"
click node_vehicle_routes "https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/backend/src/routes/vehicles.routes.ts"
click node_vehicle_controller "https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/backend/src/controllers/vehicle.controller.ts"
click node_vehicle_service "https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/backend/src/services/vehicleService.ts"
click node_client_routes "https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/backend/src/routes/clients.routes.ts"
click node_client_service "https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/backend/src/services/clientService.ts"
click node_rental_routes "https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/backend/src/routes/rentals.routes.ts"
click node_rental_service "https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/backend/src/services/rentalService.ts"
click node_garage_routes "https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/backend/src/routes/garages.routes.ts"
click node_garage_controller "https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/backend/src/controllers/garage.controller.ts"
click node_garage_service "https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/backend/src/services/garageService.ts"
click node_audit "https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/backend/src/middleware/auditLog.ts"
click node_backup "https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/backend/src/services/backupService.ts"
click node_database "https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/backend/src/lib/prisma.ts"
click node_drive "https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/backend/src/lib/googleDrive.ts"

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_login,node_dashboard,node_vehicles_ui,node_vehicle_detail,node_rentals_ui,node_clients_ui,node_client_detail,node_garages_ui,node_assurance_ui toneBlue
class node_api_app,node_auth_routes,node_auth_service toneAmber
class node_vehicle_routes,node_vehicle_controller,node_vehicle_service,node_client_routes,node_client_service,node_rental_routes,node_rental_service,node_garage_routes,node_garage_controller,node_garage_service toneMint
class node_audit,node_backup,node_database,node_drive toneRose
class node_user toneIndigo
```

## Components

### Web application

- [Route application](https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Sign in](https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/frontend/src/pages/LoginPage.tsx): `frontend/src/pages/LoginPage.tsx`
- [Dashboard](https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/frontend/src/pages/DashboardPage.tsx): `frontend/src/pages/DashboardPage.tsx`
- [Vehicle fleet](https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/frontend/src/pages/FlottePage.tsx): `frontend/src/pages/FlottePage.tsx`
- [Vehicle detail](https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/frontend/src/pages/VehicleDetailPage.tsx): `frontend/src/pages/VehicleDetailPage.tsx`
- [Rentals](https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/frontend/src/pages/LocationsPage.tsx): `frontend/src/pages/LocationsPage.tsx`
- [Clients](https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/frontend/src/pages/ClientsPage.tsx): `frontend/src/pages/ClientsPage.tsx`
- [Client detail](https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/frontend/src/pages/ClientDetailPage.tsx): `frontend/src/pages/ClientDetailPage.tsx`
- [Garages](https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/frontend/src/pages/GaragesPage.tsx): `frontend/src/pages/GaragesPage.tsx`
- [Insurance pages](https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/frontend/src/pages/PlaceholderPage.tsx): `frontend/src/pages/PlaceholderPage.tsx`

### API and access

- [Express API](https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/backend/src/app.ts): `backend/src/app.ts`
- [Auth routes](https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/backend/src/routes/auth.routes.ts): `backend/src/routes/auth.routes.ts`
- [Authentication](https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/backend/src/services/auth.service.ts): `backend/src/services/auth.service.ts`

### Fleet operations

- [Vehicle routes](https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/backend/src/routes/vehicles.routes.ts): `backend/src/routes/vehicles.routes.ts`
- [Vehicle handling](https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/backend/src/controllers/vehicle.controller.ts): `backend/src/controllers/vehicle.controller.ts`
- [Vehicle operations](https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/backend/src/services/vehicleService.ts): `backend/src/services/vehicleService.ts`
- [Client routes](https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/backend/src/routes/clients.routes.ts): `backend/src/routes/clients.routes.ts`
- [Client operations](https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/backend/src/services/clientService.ts): `backend/src/services/clientService.ts`
- [Rental routes](https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/backend/src/routes/rentals.routes.ts): `backend/src/routes/rentals.routes.ts`
- [Rental operations](https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/backend/src/services/rentalService.ts): `backend/src/services/rentalService.ts`
- [Garage routes](https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/backend/src/routes/garages.routes.ts): `backend/src/routes/garages.routes.ts`
- [Garage handling](https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/backend/src/controllers/garage.controller.ts): `backend/src/controllers/garage.controller.ts`
- [Garage operations](https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/backend/src/services/garageService.ts): `backend/src/services/garageService.ts`

### Shared services

- [Audit logging](https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/backend/src/middleware/auditLog.ts): `backend/src/middleware/auditLog.ts`
- [Backups](https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/backend/src/services/backupService.ts): `backend/src/services/backupService.ts`
- [PostgreSQL](https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/backend/src/lib/prisma.ts): `backend/src/lib/prisma.ts`
- [Google Drive](https://github.com/sofianesmoun/fleet-manager-pro-v1-/blob/main/backend/src/lib/googleDrive.ts): `backend/src/lib/googleDrive.ts`

### Other components

- **Fleet staff**

## Connections

- Fleet staff → Route application: uses (evidence: `frontend/src/App.tsx`)
- Route application → Sign in: routes to (evidence: `frontend/src/App.tsx`)
- Route application → Dashboard: routes to (evidence: `frontend/src/App.tsx`)
- Route application → Vehicle fleet: routes to (evidence: `frontend/src/App.tsx`)
- Route application → Vehicle detail: routes to (evidence: `frontend/src/App.tsx`)
- Route application → Rentals: routes to (evidence: `frontend/src/App.tsx`)
- Route application → Clients: routes to (evidence: `frontend/src/App.tsx`)
- Route application → Client detail: routes to (evidence: `frontend/src/App.tsx`)
- Route application → Garages: routes to (evidence: `frontend/src/App.tsx`)
- Route application → Insurance pages: routes to (evidence: `frontend/src/App.tsx`)
- Route application → Express API: requests API
- Express API → Auth routes: mounts (evidence: `backend/src/app.ts`)
- Express API → Vehicle routes: mounts (evidence: `backend/src/app.ts`)
- Express API → Client routes: mounts (evidence: `backend/src/app.ts`)
- Express API → Rental routes: mounts (evidence: `backend/src/app.ts`)
- Express API → Garage routes: mounts (evidence: `backend/src/app.ts`)
- Express API → Backups: mounts backup route (evidence: `backend/src/app.ts`)
- Auth routes → Authentication: delegates
- Vehicle routes → Vehicle handling: dispatches (evidence: `backend/src/routes/vehicles.routes.ts`)
- Vehicle handling → Vehicle operations: calls (evidence: `backend/src/controllers/vehicle.controller.ts`)
- Client routes → Client operations: delegates
- Rental routes → Rental operations: delegates
- Garage routes → Garage handling: dispatches (evidence: `backend/src/routes/garages.routes.ts`)
- Garage handling → Garage operations: calls (evidence: `backend/src/controllers/garage.controller.ts`)
- Garage operations → PostgreSQL: reads and writes (evidence: `backend/src/services/garageService.ts`)
- Vehicle operations → PostgreSQL: uses (evidence: `backend/src/services/vehicleService.ts`)
- Authentication → PostgreSQL: uses (evidence: `backend/src/services/auth.service.ts`)
- Audit logging → PostgreSQL: writes audit events (evidence: `backend/src/middleware/auditLog.ts`)
- Backups → Google Drive: stores backups
