# ayyappan1221/fleet-tracking-platform architecture

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

- Interactive diagram: https://gitdiagram.com/ayyappan1221/fleet-tracking-platform
- Repository: https://github.com/ayyappan1221/fleet-tracking-platform

## Overview

This is a fleet-monitoring web platform: users authenticate in the React client, then manage vehicles, routes, GPS locations, geofences, alerts, maintenance, and dashboard summaries through FastAPI. The route workflow is shown in detail: a manager submits stops, the API delegates planning and status changes to route services, and those services persist route and stop state. README capabilities preserve the unsampled domain branches; their exact service/API interactions are not asserted beyond documented endpoints. Source evidence is sampled, so some links are omitted.

Main entry points: [`app/core/database.py`](https://github.com/ayyappan1221/fleet-tracking-platform/blob/main/app/core/database.py) (SQL database), [`frontend/src/App.jsx`](https://github.com/ayyappan1221/fleet-tracking-platform/blob/main/frontend/src/App.jsx) (React app), [`app/main.py`](https://github.com/ayyappan1221/fleet-tracking-platform/blob/main/app/main.py) (FastAPI app), [`frontend/src/api.js`](https://github.com/ayyappan1221/fleet-tracking-platform/blob/main/frontend/src/api.js) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Fleet web client"]
  node_web["React app<br/>[App.jsx]"]
  node_authpage["Sign-in<br/>[AuthPage.jsx]"]
  node_routepage["Route planning<br/>[RoutesPage.jsx]"]
  node_clientapi["API client<br/>[api.js]"]
  node_fleetpages["Fleet pages"]
end

subgraph group_api["REST API"]
  node_server["FastAPI app<br/>[main.py]"]
  node_authapi["Auth endpoints<br/>[auth.py]"]
  node_routeapi["Route endpoints<br/>[routes.py]"]
  node_otherapi["Fleet endpoints"]
end

subgraph group_domain["Fleet operations"]
  node_routework["Route planning<br/>[route_service.py]"]
  node_vehiclework["Vehicle management<br/>[vehicle_service.py]"]
  node_locationwork["GPS tracking"]
  node_geofencework["Geofence alerts"]
  node_maintenancework["Maintenance scheduling"]
  node_otherwork["Alerts and reports"]
end

subgraph group_identity["Identity"]
  node_security["Token security<br/>[security.py]"]
end

subgraph group_storage["Persistence"]
  node_users["User records<br/>[user.py]"]
  node_vehicles["Vehicle records<br/>[vehicle.py]"]
  node_routes["Routes and stops<br/>[route.py]"]
  node_locations["Location records<br/>[location.py]"]
  node_geofences["Geofence records<br/>[geofence.py]"]
  node_maintenance["Maintenance records<br/>[maintenance.py]"]
  node_alerts["Alert records<br/>[alert.py]"]
  node_database[("SQL database<br/>[database.py]")]
end

node_manager(("Fleet user"))

node_manager -->|"uses"| node_web
node_web -->|"routes to"| node_authpage
node_web -->|"routes to"| node_routepage
node_web -->|"routes to"| node_fleetpages
node_authpage -->|"requests"| node_clientapi
node_routepage -->|"requests"| node_clientapi
node_fleetpages -.->|"requests"| node_clientapi
node_clientapi -->|"calls API"| node_server
node_server -->|"registers"| node_authapi
node_server -->|"registers"| node_routeapi
node_server -->|"registers"| node_otherapi
node_authapi -->|"hashes and signs"| node_security
node_authapi -->|"reads and writes"| node_users
node_routeapi -->|"delegates"| node_routework
node_routework -->|"checks vehicle"| node_vehicles
node_routework -->|"creates and updates"| node_routes
node_vehiclework -->|"manages"| node_vehicles
node_locationwork -.->|"records GPS"| node_locations
node_geofencework -->|"manages"| node_geofences
node_maintenancework -->|"manages"| node_maintenance
node_otherwork -.->|"manages"| node_alerts
node_database -->|"stores"| node_vehicles
node_database -->|"stores"| node_routes
node_database -->|"stores"| node_users
node_database -->|"stores"| node_locations
node_database -->|"stores"| node_geofences
node_database -->|"stores"| node_maintenance
node_database -.->|"stores"| node_alerts

click node_web "https://github.com/ayyappan1221/fleet-tracking-platform/blob/main/frontend/src/App.jsx"
click node_authpage "https://github.com/ayyappan1221/fleet-tracking-platform/blob/main/frontend/src/pages/AuthPage.jsx"
click node_routepage "https://github.com/ayyappan1221/fleet-tracking-platform/blob/main/frontend/src/pages/RoutesPage.jsx"
click node_clientapi "https://github.com/ayyappan1221/fleet-tracking-platform/blob/main/frontend/src/api.js"
click node_fleetpages "https://github.com/ayyappan1221/fleet-tracking-platform/tree/main/frontend/src/pages"
click node_server "https://github.com/ayyappan1221/fleet-tracking-platform/blob/main/app/main.py"
click node_authapi "https://github.com/ayyappan1221/fleet-tracking-platform/blob/main/app/api/v1/auth.py"
click node_routeapi "https://github.com/ayyappan1221/fleet-tracking-platform/blob/main/app/api/v1/routes.py"
click node_otherapi "https://github.com/ayyappan1221/fleet-tracking-platform/tree/main/app/api/v1"
click node_routework "https://github.com/ayyappan1221/fleet-tracking-platform/blob/main/app/services/route_service.py"
click node_vehiclework "https://github.com/ayyappan1221/fleet-tracking-platform/blob/main/app/services/vehicle_service.py"
click node_locationwork "https://github.com/ayyappan1221/fleet-tracking-platform/blob/main/app/services/location_service.py"
click node_geofencework "https://github.com/ayyappan1221/fleet-tracking-platform/blob/main/app/services/geofence_service.py"
click node_maintenancework "https://github.com/ayyappan1221/fleet-tracking-platform/blob/main/app/services/maintenance_service.py"
click node_otherwork "https://github.com/ayyappan1221/fleet-tracking-platform/tree/main/app/services"
click node_security "https://github.com/ayyappan1221/fleet-tracking-platform/blob/main/app/core/security.py"
click node_users "https://github.com/ayyappan1221/fleet-tracking-platform/blob/main/app/models/user.py"
click node_vehicles "https://github.com/ayyappan1221/fleet-tracking-platform/blob/main/app/models/vehicle.py"
click node_routes "https://github.com/ayyappan1221/fleet-tracking-platform/blob/main/app/models/route.py"
click node_locations "https://github.com/ayyappan1221/fleet-tracking-platform/blob/main/app/models/location.py"
click node_geofences "https://github.com/ayyappan1221/fleet-tracking-platform/blob/main/app/models/geofence.py"
click node_maintenance "https://github.com/ayyappan1221/fleet-tracking-platform/blob/main/app/models/maintenance.py"
click node_alerts "https://github.com/ayyappan1221/fleet-tracking-platform/blob/main/app/models/alert.py"
click node_database "https://github.com/ayyappan1221/fleet-tracking-platform/blob/main/app/core/database.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_web,node_authpage,node_routepage,node_clientapi,node_fleetpages,node_manager toneBlue
class node_server,node_authapi,node_routeapi,node_otherapi toneAmber
class node_routework,node_vehiclework,node_locationwork,node_geofencework,node_maintenancework,node_otherwork toneMint
class node_security toneRose
class node_users,node_vehicles,node_routes,node_locations,node_geofences,node_maintenance,node_alerts,node_database toneIndigo
```

## Components

### Fleet web client

- [React app](https://github.com/ayyappan1221/fleet-tracking-platform/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Sign-in](https://github.com/ayyappan1221/fleet-tracking-platform/blob/main/frontend/src/pages/AuthPage.jsx): `frontend/src/pages/AuthPage.jsx`
- [Route planning](https://github.com/ayyappan1221/fleet-tracking-platform/blob/main/frontend/src/pages/RoutesPage.jsx): `frontend/src/pages/RoutesPage.jsx`
- [API client](https://github.com/ayyappan1221/fleet-tracking-platform/blob/main/frontend/src/api.js): `frontend/src/api.js`
- [Fleet pages](https://github.com/ayyappan1221/fleet-tracking-platform/tree/main/frontend/src/pages): `frontend/src/pages`

### REST API

- [FastAPI app](https://github.com/ayyappan1221/fleet-tracking-platform/blob/main/app/main.py): `app/main.py`
- [Auth endpoints](https://github.com/ayyappan1221/fleet-tracking-platform/blob/main/app/api/v1/auth.py): `app/api/v1/auth.py`
- [Route endpoints](https://github.com/ayyappan1221/fleet-tracking-platform/blob/main/app/api/v1/routes.py): `app/api/v1/routes.py`
- [Fleet endpoints](https://github.com/ayyappan1221/fleet-tracking-platform/tree/main/app/api/v1): `app/api/v1`

### Fleet operations

- [Route planning](https://github.com/ayyappan1221/fleet-tracking-platform/blob/main/app/services/route_service.py): `app/services/route_service.py`
- [Vehicle management](https://github.com/ayyappan1221/fleet-tracking-platform/blob/main/app/services/vehicle_service.py): `app/services/vehicle_service.py`
- [GPS tracking](https://github.com/ayyappan1221/fleet-tracking-platform/blob/main/app/services/location_service.py): `app/services/location_service.py`
- [Geofence alerts](https://github.com/ayyappan1221/fleet-tracking-platform/blob/main/app/services/geofence_service.py): `app/services/geofence_service.py`
- [Maintenance scheduling](https://github.com/ayyappan1221/fleet-tracking-platform/blob/main/app/services/maintenance_service.py): `app/services/maintenance_service.py`
- [Alerts and reports](https://github.com/ayyappan1221/fleet-tracking-platform/tree/main/app/services): `app/services`

### Identity

- [Token security](https://github.com/ayyappan1221/fleet-tracking-platform/blob/main/app/core/security.py): `app/core/security.py`

### Persistence

- [User records](https://github.com/ayyappan1221/fleet-tracking-platform/blob/main/app/models/user.py): `app/models/user.py`
- [Vehicle records](https://github.com/ayyappan1221/fleet-tracking-platform/blob/main/app/models/vehicle.py): `app/models/vehicle.py`
- [Routes and stops](https://github.com/ayyappan1221/fleet-tracking-platform/blob/main/app/models/route.py): `app/models/route.py`
- [Location records](https://github.com/ayyappan1221/fleet-tracking-platform/blob/main/app/models/location.py): `app/models/location.py`
- [Geofence records](https://github.com/ayyappan1221/fleet-tracking-platform/blob/main/app/models/geofence.py): `app/models/geofence.py`
- [Maintenance records](https://github.com/ayyappan1221/fleet-tracking-platform/blob/main/app/models/maintenance.py): `app/models/maintenance.py`
- [Alert records](https://github.com/ayyappan1221/fleet-tracking-platform/blob/main/app/models/alert.py): `app/models/alert.py`
- [SQL database](https://github.com/ayyappan1221/fleet-tracking-platform/blob/main/app/core/database.py): `app/core/database.py`

### Other components

- **Fleet user**

## Connections

- Fleet user → React app: uses (evidence: `README.md`)
- React app → Sign-in: routes to (evidence: `frontend/src/App.jsx`)
- React app → Route planning: routes to (evidence: `frontend/src/App.jsx`)
- React app → Fleet pages: routes to (evidence: `frontend/src/App.jsx`)
- Sign-in → API client: requests (evidence: `frontend/src/pages/AuthPage.jsx`)
- Route planning → API client: requests (evidence: `frontend/src/pages/RoutesPage.jsx`)
- Fleet pages → API client: requests (evidence: `frontend/src/pages/RoutesPage.jsx`)
- API client → FastAPI app: calls API (evidence: `README.md`)
- FastAPI app → Auth endpoints: registers
- FastAPI app → Route endpoints: registers
- FastAPI app → Fleet endpoints: registers (evidence: `app/api/v1/__init__.py`)
- Auth endpoints → Token security: hashes and signs (evidence: `app/api/v1/auth.py`)
- Auth endpoints → User records: reads and writes (evidence: `app/api/v1/auth.py`)
- Route endpoints → Route planning: delegates (evidence: `app/api/v1/routes.py`)
- Route planning → Vehicle records: checks vehicle (evidence: `app/services/route_service.py`)
- Route planning → Routes and stops: creates and updates (evidence: `app/services/route_service.py`)
- Vehicle management → Vehicle records: manages (evidence: `app/services/vehicle_service.py`)
- GPS tracking → Location records: records GPS (evidence: `app/services/location_service.py`)
- Geofence alerts → Geofence records: manages (evidence: `app/services/geofence_service.py`)
- Maintenance scheduling → Maintenance records: manages (evidence: `app/services/maintenance_service.py`)
- Alerts and reports → Alert records: manages
- SQL database → Vehicle records: stores (evidence: `app/models/vehicle.py`)
- SQL database → Routes and stops: stores (evidence: `app/models/route.py`)
- SQL database → User records: stores (evidence: `app/models/user.py`)
- SQL database → Location records: stores (evidence: `app/models/location.py`)
- SQL database → Geofence records: stores (evidence: `app/models/geofence.py`)
- SQL database → Maintenance records: stores (evidence: `app/models/maintenance.py`)
- SQL database → Alert records: stores
