# sathishthirumurthy/fuellog architecture

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

- Interactive diagram: https://gitdiagram.com/sathishthirumurthy/fuellog
- Repository: https://github.com/sathishthirumurthy/fuellog

## Overview

FuelLog is a vehicle fuel, maintenance, and cost-tracking application. Users create and verify an account, log in, manage cars, record fuel and service entries, and review dashboards and reports. The React app calls an Express API; protected routes authenticate users and persist per-user records in PostgreSQL. The graph also shows unit formatting and browser storage. Some frontend wiring and several route implementations were not excerpted, so only relationships supported by excerpts or the SOURCE INDEX are shown.

Main entry points: [`fuellog-frontend/src/App.tsx`](https://github.com/sathishthirumurthy/fuellog/blob/main/fuellog-frontend/src/App.tsx) (App shell), [`fuellog-backend/server.js`](https://github.com/sathishthirumurthy/fuellog/blob/main/fuellog-backend/server.js) (Express server), [`fuellog-frontend/src/utils/api.ts`](https://github.com/sathishthirumurthy/fuellog/blob/main/fuellog-frontend/src/utils/api.ts) (API client), [`fuellog-backend/routes/auth.js`](https://github.com/sathishthirumurthy/fuellog/blob/main/fuellog-backend/routes/auth.js) (Account routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web application"]
  node_app["App shell<br/>[App.tsx]"]
  node_auth_ui["Account screens<br/>[Login.tsx]"]
  node_api_client["API client<br/>[api.ts]"]
  node_browser_store[("Browser storage<br/>[storage.ts]")]
end

subgraph group_domain["Vehicle tracking"]
  node_car_ui["Car management<br/>[Cars.tsx]"]
  node_fuel_ui["Fuel entries<br/>[AddEntry.tsx]"]
  node_service_ui["Service entries<br/>[Service.tsx]"]
  node_entries_ui["Entry history<br/>[Entries.tsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.tsx]"]
  node_reports_ui["Reports<br/>[Reports.tsx]"]
  node_units["Unit formatting<br/>[units.ts]"]
end

subgraph group_backend["API and identity"]
  node_server["Express server<br/>[server.js]"]
  node_auth_middleware["JWT middleware<br/>[auth.js]"]
  node_auth_routes["Account routes<br/>[auth.js]"]
  node_car_routes["Car routes<br/>[cars.js]"]
  node_fuel_routes["Fuel routes<br/>[fuel.js]"]
  node_service_routes["Service routes<br/>[service.js]"]
  node_report_routes["Report routes<br/>[reports.js]"]
end

subgraph group_persistence["Persistence"]
  node_postgres[("PostgreSQL")]
end

node_driver(("Driver"))
node_mail["Email service"]

node_driver -->|"uses"| node_app
node_app -->|"shows auth"| node_auth_ui
node_app -->|"renders"| node_dashboard
node_app -->|"renders"| node_entries_ui
node_app -->|"renders"| node_reports_ui
node_app -->|"loads data"| node_api_client
node_app -->|"reads and writes"| node_browser_store
node_fuel_ui -->|"calls"| node_api_client
node_service_ui -->|"calls"| node_api_client
node_dashboard -->|"formats values"| node_units
node_service_ui -->|"gets units"| node_units
node_api_client -->|"sends API requests"| node_server
node_server -->|"mounts"| node_auth_routes
node_server -->|"applies to protected routes"| node_auth_middleware
node_server -->|"mounts"| node_car_routes
node_server -->|"mounts"| node_fuel_routes
node_server -->|"mounts"| node_service_routes
node_server -->|"mounts"| node_report_routes
node_auth_routes -->|"queries"| node_postgres
node_auth_routes -->|"sends verification email"| node_mail
node_car_routes -->|"queries"| node_postgres
node_fuel_routes -->|"queries"| node_postgres
node_service_routes -->|"reads and writes"| node_postgres
node_report_routes -->|"queries"| node_postgres

click node_app "https://github.com/sathishthirumurthy/fuellog/blob/main/fuellog-frontend/src/App.tsx"
click node_auth_ui "https://github.com/sathishthirumurthy/fuellog/blob/main/fuellog-frontend/src/components/Login.tsx"
click node_api_client "https://github.com/sathishthirumurthy/fuellog/blob/main/fuellog-frontend/src/utils/api.ts"
click node_browser_store "https://github.com/sathishthirumurthy/fuellog/blob/main/fuellog-frontend/src/utils/storage.ts"
click node_car_ui "https://github.com/sathishthirumurthy/fuellog/blob/main/fuellog-frontend/src/components/Cars.tsx"
click node_fuel_ui "https://github.com/sathishthirumurthy/fuellog/blob/main/fuellog-frontend/src/components/AddEntry.tsx"
click node_service_ui "https://github.com/sathishthirumurthy/fuellog/blob/main/fuellog-frontend/src/components/Service.tsx"
click node_entries_ui "https://github.com/sathishthirumurthy/fuellog/blob/main/fuellog-frontend/src/components/Entries.tsx"
click node_dashboard "https://github.com/sathishthirumurthy/fuellog/blob/main/fuellog-frontend/src/components/Dashboard.tsx"
click node_reports_ui "https://github.com/sathishthirumurthy/fuellog/blob/main/fuellog-frontend/src/components/Reports.tsx"
click node_units "https://github.com/sathishthirumurthy/fuellog/blob/main/fuellog-frontend/src/utils/units.ts"
click node_server "https://github.com/sathishthirumurthy/fuellog/blob/main/fuellog-backend/server.js"
click node_auth_middleware "https://github.com/sathishthirumurthy/fuellog/blob/main/fuellog-backend/middleware/auth.js"
click node_auth_routes "https://github.com/sathishthirumurthy/fuellog/blob/main/fuellog-backend/routes/auth.js"
click node_car_routes "https://github.com/sathishthirumurthy/fuellog/blob/main/fuellog-backend/routes/cars.js"
click node_fuel_routes "https://github.com/sathishthirumurthy/fuellog/blob/main/fuellog-backend/routes/fuel.js"
click node_service_routes "https://github.com/sathishthirumurthy/fuellog/blob/main/fuellog-backend/routes/service.js"
click node_report_routes "https://github.com/sathishthirumurthy/fuellog/blob/main/fuellog-backend/routes/reports.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_app,node_auth_ui,node_api_client,node_browser_store toneBlue
class node_car_ui,node_fuel_ui,node_service_ui,node_entries_ui,node_dashboard,node_reports_ui,node_units toneAmber
class node_server,node_auth_middleware,node_auth_routes,node_car_routes,node_fuel_routes,node_service_routes,node_report_routes toneMint
class node_postgres toneRose
class node_driver,node_mail toneIndigo
```

## Components

### Web application

- [App shell](https://github.com/sathishthirumurthy/fuellog/blob/main/fuellog-frontend/src/App.tsx): `fuellog-frontend/src/App.tsx`
- [Account screens](https://github.com/sathishthirumurthy/fuellog/blob/main/fuellog-frontend/src/components/Login.tsx): `fuellog-frontend/src/components/Login.tsx`
- [API client](https://github.com/sathishthirumurthy/fuellog/blob/main/fuellog-frontend/src/utils/api.ts): `fuellog-frontend/src/utils/api.ts`
- [Browser storage](https://github.com/sathishthirumurthy/fuellog/blob/main/fuellog-frontend/src/utils/storage.ts): `fuellog-frontend/src/utils/storage.ts`

### Vehicle tracking

- [Car management](https://github.com/sathishthirumurthy/fuellog/blob/main/fuellog-frontend/src/components/Cars.tsx): `fuellog-frontend/src/components/Cars.tsx`
- [Fuel entries](https://github.com/sathishthirumurthy/fuellog/blob/main/fuellog-frontend/src/components/AddEntry.tsx): `fuellog-frontend/src/components/AddEntry.tsx`
- [Service entries](https://github.com/sathishthirumurthy/fuellog/blob/main/fuellog-frontend/src/components/Service.tsx): `fuellog-frontend/src/components/Service.tsx`
- [Entry history](https://github.com/sathishthirumurthy/fuellog/blob/main/fuellog-frontend/src/components/Entries.tsx): `fuellog-frontend/src/components/Entries.tsx`
- [Dashboard](https://github.com/sathishthirumurthy/fuellog/blob/main/fuellog-frontend/src/components/Dashboard.tsx): `fuellog-frontend/src/components/Dashboard.tsx`
- [Reports](https://github.com/sathishthirumurthy/fuellog/blob/main/fuellog-frontend/src/components/Reports.tsx): `fuellog-frontend/src/components/Reports.tsx`
- [Unit formatting](https://github.com/sathishthirumurthy/fuellog/blob/main/fuellog-frontend/src/utils/units.ts): `fuellog-frontend/src/utils/units.ts`

### API and identity

- [Express server](https://github.com/sathishthirumurthy/fuellog/blob/main/fuellog-backend/server.js): `fuellog-backend/server.js`
- [JWT middleware](https://github.com/sathishthirumurthy/fuellog/blob/main/fuellog-backend/middleware/auth.js): `fuellog-backend/middleware/auth.js`
- [Account routes](https://github.com/sathishthirumurthy/fuellog/blob/main/fuellog-backend/routes/auth.js): `fuellog-backend/routes/auth.js`
- [Car routes](https://github.com/sathishthirumurthy/fuellog/blob/main/fuellog-backend/routes/cars.js): `fuellog-backend/routes/cars.js`
- [Fuel routes](https://github.com/sathishthirumurthy/fuellog/blob/main/fuellog-backend/routes/fuel.js): `fuellog-backend/routes/fuel.js`
- [Service routes](https://github.com/sathishthirumurthy/fuellog/blob/main/fuellog-backend/routes/service.js): `fuellog-backend/routes/service.js`
- [Report routes](https://github.com/sathishthirumurthy/fuellog/blob/main/fuellog-backend/routes/reports.js): `fuellog-backend/routes/reports.js`

### Persistence

- **PostgreSQL**

### Other components

- **Driver**
- **Email service**

## Connections

- Driver → App shell: uses
- App shell → Account screens: shows auth (evidence: `fuellog-frontend/src/App.tsx`)
- App shell → Dashboard: renders (evidence: `fuellog-frontend/src/App.tsx`)
- App shell → Entry history: renders (evidence: `fuellog-frontend/src/App.tsx`)
- App shell → Reports: renders (evidence: `fuellog-frontend/src/App.tsx`)
- App shell → API client: loads data (evidence: `fuellog-frontend/src/App.tsx`)
- App shell → Browser storage: reads and writes (evidence: `fuellog-frontend/src/App.tsx`)
- Fuel entries → API client: calls (evidence: `fuellog-frontend/src/components/AddEntry.tsx`)
- Service entries → API client: calls (evidence: `fuellog-frontend/src/components/Service.tsx`)
- Dashboard → Unit formatting: formats values (evidence: `fuellog-frontend/src/components/Dashboard.tsx`)
- Service entries → Unit formatting: gets units (evidence: `fuellog-frontend/src/components/Service.tsx`)
- API client → Express server: sends API requests (evidence: `fuellog-frontend/src/utils/api.ts`)
- Express server → Account routes: mounts (evidence: `fuellog-backend/server.js`)
- Express server → JWT middleware: applies to protected routes (evidence: `fuellog-backend/server.js`)
- Express server → Car routes: mounts (evidence: `fuellog-backend/server.js`)
- Express server → Fuel routes: mounts (evidence: `fuellog-backend/server.js`)
- Express server → Service routes: mounts (evidence: `fuellog-backend/server.js`)
- Express server → Report routes: mounts (evidence: `fuellog-backend/server.js`)
- Account routes → PostgreSQL: queries (evidence: `fuellog-backend/routes/auth.js`)
- Account routes → Email service: sends verification email (evidence: `fuellog-backend/routes/auth.js`)
- Car routes → PostgreSQL: queries (evidence: `fuellog-backend/routes/cars.js`)
- Fuel routes → PostgreSQL: queries (evidence: `fuellog-backend/routes/fuel.js`)
- Service routes → PostgreSQL: reads and writes (evidence: `fuellog-backend/routes/service.js`)
- Report routes → PostgreSQL: queries (evidence: `fuellog-backend/routes/reports.js`)
