# blesson7777/tripmate architecture

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

## Overview

TripMate is a transport-operations platform: drivers and transporters use separate mobile apps, while operators also work through a Django-rendered admin console. The main operational flow covers account access, driver/vehicle allocation, daily attendance and run sessions, then vehicle-fuel or tower-diesel logging and reporting; salary, notifications, and app releases are supporting capabilities. The tree contains no Flutter Dart application sources, so mobile clients are represented as external actors. Some subsystem links reflect README documentation because their implementation files were not sampled.

Main entry points: [`tripmate/urls.py`](https://github.com/blesson7777/tripmate/blob/main/tripmate/urls.py) (REST API), [`tripmate/admin_dashboard_views.py`](https://github.com/blesson7777/tripmate/blob/main/tripmate/admin_dashboard_views.py) (Admin console), [`diesel/views.py`](https://github.com/blesson7777/tripmate/blob/main/diesel/views.py) (Tower diesel), [`users/views.py`](https://github.com/blesson7777/tripmate/blob/main/users/views.py) (Accounts and OTP)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Accounts and operations"]
  node_admin["Admin console"]
  node_api["REST API<br/>[urls.py]"]
  node_accounts["Accounts and OTP<br/>[views.py]"]
end

subgraph group_runs["Run operations"]
  node_drivers["Driver profiles<br/>[models.py]"]
  node_vehicles["Vehicle records<br/>[models.py]"]
  node_attendance[("Attendance<br/>[models.py]")]
  node_trips[("Run sessions<br/>[models.py]")]
end

subgraph group_fuel["Fuel and routing"]
  node_vehicle_fuel[("Vehicle fuel<br/>[models.py]")]
  node_fuel_analytics["Fuel analytics<br/>[analytics.py]"]
  node_tower_diesel["Tower diesel<br/>[views.py]"]
  node_tower_sites[("Tower sites<br/>[models.py]")]
  node_site_rules["Site validation<br/>[site_utils.py]"]
  node_route_plan["Diesel route planning<br/>[route_planner.py]"]
  node_route_optimizer["Route optimizer<br/>[route_optimizer.py]"]
end

subgraph group_support["Business support"]
  node_salary["Salary processing<br/>[views.py]"]
  node_reports["Reports and PDFs<br/>[views.py]"]
  node_bill_pdf["Vehicle bill PDF"]
  node_notifications["Notifications"]
  node_push["Push delivery<br/>[push_service.py]"]
  node_releases[("App releases<br/>[models.py]")]
end

node_driver_app(("Driver app"))
node_transporter_app(("Transporter app"))
node_postgres[("PostgreSQL")]
node_fcm["Firebase messaging"]
node_email["Email service"]

node_driver_app -->|"uses API"| node_api
node_transporter_app -->|"uses API"| node_api
node_admin -->|"manages accounts"| node_accounts
node_api -->|"serves account flows"| node_accounts
node_admin -->|"allocates drivers"| node_drivers
node_admin -->|"manages vehicles"| node_vehicles
node_api -->|"marks attendance"| node_attendance
node_api -->|"opens and closes"| node_trips
node_attendance -->|"associates sessions"| node_trips
node_api -->|"records fills"| node_vehicle_fuel
node_vehicle_fuel -->|"feeds metrics"| node_fuel_analytics
node_api -->|"serves diesel flows"| node_tower_diesel
node_tower_diesel -->|"uses site records"| node_tower_sites
node_tower_diesel -->|"validates sites"| node_site_rules
node_api -->|"dispatches optimization"| node_route_optimizer
node_tower_diesel -->|"optimizes stops"| node_route_optimizer
node_api -->|"serves salary flows"| node_salary
node_api -->|"serves report requests"| node_reports
node_reports -->|"builds bill PDFs"| node_bill_pdf
node_admin -->|"supports reporting"| node_reports
node_api -->|"serves notification feeds"| node_notifications
node_notifications -.->|"sends push notices"| node_push
node_push -->|"delivers messages"| node_fcm
node_accounts -->|"emails OTPs"| node_email
node_admin -->|"publishes releases"| node_releases
node_api -.->|"reads and writes"| node_postgres

click node_admin "https://github.com/blesson7777/tripmate/blob/main/tripmate/admin_dashboard_views.py"
click node_api "https://github.com/blesson7777/tripmate/blob/main/tripmate/urls.py"
click node_accounts "https://github.com/blesson7777/tripmate/blob/main/users/views.py"
click node_drivers "https://github.com/blesson7777/tripmate/blob/main/drivers/models.py"
click node_vehicles "https://github.com/blesson7777/tripmate/blob/main/vehicles/models.py"
click node_attendance "https://github.com/blesson7777/tripmate/blob/main/attendance/models.py"
click node_trips "https://github.com/blesson7777/tripmate/blob/main/trips/models.py"
click node_vehicle_fuel "https://github.com/blesson7777/tripmate/blob/main/fuel/models.py"
click node_fuel_analytics "https://github.com/blesson7777/tripmate/blob/main/fuel/analytics.py"
click node_tower_diesel "https://github.com/blesson7777/tripmate/blob/main/diesel/views.py"
click node_tower_sites "https://github.com/blesson7777/tripmate/blob/main/diesel/models.py"
click node_site_rules "https://github.com/blesson7777/tripmate/blob/main/diesel/site_utils.py"
click node_route_plan "https://github.com/blesson7777/tripmate/blob/main/diesel/route_planner.py"
click node_route_optimizer "https://github.com/blesson7777/tripmate/blob/main/services/route_optimizer.py"
click node_salary "https://github.com/blesson7777/tripmate/blob/main/salary/views.py"
click node_reports "https://github.com/blesson7777/tripmate/blob/main/reports/views.py"
click node_bill_pdf "https://github.com/blesson7777/tripmate/blob/main/reports/vehicle_bill_pdf.py"
click node_notifications "https://github.com/blesson7777/tripmate/blob/main/users/notification_utils.py"
click node_push "https://github.com/blesson7777/tripmate/blob/main/users/push_service.py"
click node_releases "https://github.com/blesson7777/tripmate/blob/main/users/models.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_admin,node_api,node_accounts toneBlue
class node_drivers,node_vehicles,node_attendance,node_trips,node_postgres toneAmber
class node_vehicle_fuel,node_fuel_analytics,node_tower_diesel,node_tower_sites,node_site_rules,node_route_plan,node_route_optimizer toneMint
class node_salary,node_reports,node_bill_pdf,node_notifications,node_push,node_releases toneRose
class node_driver_app,node_transporter_app,node_fcm,node_email toneIndigo
```

## Components

### Accounts and operations

- [Admin console](https://github.com/blesson7777/tripmate/blob/main/tripmate/admin_dashboard_views.py): `tripmate/admin_dashboard_views.py`
- [REST API](https://github.com/blesson7777/tripmate/blob/main/tripmate/urls.py): `tripmate/urls.py`
- [Accounts and OTP](https://github.com/blesson7777/tripmate/blob/main/users/views.py): `users/views.py`

### Run operations

- [Driver profiles](https://github.com/blesson7777/tripmate/blob/main/drivers/models.py): `drivers/models.py`
- [Vehicle records](https://github.com/blesson7777/tripmate/blob/main/vehicles/models.py): `vehicles/models.py`
- [Attendance](https://github.com/blesson7777/tripmate/blob/main/attendance/models.py): `attendance/models.py`
- [Run sessions](https://github.com/blesson7777/tripmate/blob/main/trips/models.py): `trips/models.py`

### Fuel and routing

- [Vehicle fuel](https://github.com/blesson7777/tripmate/blob/main/fuel/models.py): `fuel/models.py`
- [Fuel analytics](https://github.com/blesson7777/tripmate/blob/main/fuel/analytics.py): `fuel/analytics.py`
- [Tower diesel](https://github.com/blesson7777/tripmate/blob/main/diesel/views.py): `diesel/views.py`
- [Tower sites](https://github.com/blesson7777/tripmate/blob/main/diesel/models.py): `diesel/models.py`
- [Site validation](https://github.com/blesson7777/tripmate/blob/main/diesel/site_utils.py): `diesel/site_utils.py`
- [Diesel route planning](https://github.com/blesson7777/tripmate/blob/main/diesel/route_planner.py): `diesel/route_planner.py`
- [Route optimizer](https://github.com/blesson7777/tripmate/blob/main/services/route_optimizer.py): `services/route_optimizer.py`

### Business support

- [Salary processing](https://github.com/blesson7777/tripmate/blob/main/salary/views.py): `salary/views.py`
- [Reports and PDFs](https://github.com/blesson7777/tripmate/blob/main/reports/views.py): `reports/views.py`
- [Vehicle bill PDF](https://github.com/blesson7777/tripmate/blob/main/reports/vehicle_bill_pdf.py): `reports/vehicle_bill_pdf.py`
- [Notifications](https://github.com/blesson7777/tripmate/blob/main/users/notification_utils.py): `users/notification_utils.py`
- [Push delivery](https://github.com/blesson7777/tripmate/blob/main/users/push_service.py): `users/push_service.py`
- [App releases](https://github.com/blesson7777/tripmate/blob/main/users/models.py): `users/models.py`

### Other components

- **Driver app**
- **Transporter app**
- **PostgreSQL**
- **Firebase messaging**
- **Email service**

## Connections

- Driver app → REST API: uses API
- Transporter app → REST API: uses API
- Admin console → Accounts and OTP: manages accounts
- REST API → Accounts and OTP: serves account flows
- Admin console → Driver profiles: allocates drivers (evidence: `tripmate/admin_dashboard_views.py`)
- Admin console → Vehicle records: manages vehicles (evidence: `tripmate/admin_dashboard_views.py`)
- REST API → Attendance: marks attendance
- REST API → Run sessions: opens and closes
- Attendance → Run sessions: associates sessions
- REST API → Vehicle fuel: records fills
- Vehicle fuel → Fuel analytics: feeds metrics (evidence: `fuel/analytics.py`)
- REST API → Tower diesel: serves diesel flows
- Tower diesel → Tower sites: uses site records (evidence: `diesel/views.py`)
- Tower diesel → Site validation: validates sites (evidence: `diesel/views.py`)
- REST API → Route optimizer: dispatches optimization
- Tower diesel → Route optimizer: optimizes stops (evidence: `diesel/views.py`)
- REST API → Salary processing: serves salary flows
- REST API → Reports and PDFs: serves report requests
- Reports and PDFs → Vehicle bill PDF: builds bill PDFs (evidence: `reports/views.py`)
- Admin console → Reports and PDFs: supports reporting
- REST API → Notifications: serves notification feeds
- Notifications → Push delivery: sends push notices
- Push delivery → Firebase messaging: delivers messages (evidence: `users/push_service.py`)
- Accounts and OTP → Email service: emails OTPs
- Admin console → App releases: publishes releases (evidence: `tripmate/admin_dashboard_views.py`)
- REST API → PostgreSQL: reads and writes
