# sakshamjain4999-web/bridge-cursor architecture

> Architecture diagram of the GitHub repository sakshamjain4999-web/bridge-cursor, 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/sakshamjain4999-web/bridge-cursor
- Repository: https://github.com/sakshamjain4999-web/bridge-cursor

## Overview

TransportAI is a transport-operations dashboard: users sign in, review business metrics, and manage trips, fleet, drivers, parties, expenses, and invoices. The main workflow is dashboard pages reading operational records from Supabase and presenting them for review or editing; browser forms also support record creation and updates. Trip detail covers trip actions, expenses, and payments, while invoices include PDF generation and download. These connections are based on sampled excerpts and SOURCE INDEX references; several page and component implementations were not sampled, so uncertain interactions are omitted.

Main entry points: [`src/lib/supabase/server.ts`](https://github.com/sakshamjain4999-web/bridge-cursor/blob/refactor/data-contract/src/lib/supabase/server.ts) (Server data client), [`src/app/(dashboard)/fleet/page.tsx`](https://github.com/sakshamjain4999-web/bridge-cursor/blob/refactor/data-contract/src/app/(dashboard)/fleet/page.tsx) (Fleet management), [`src/app/(dashboard)/trips/page.tsx`](https://github.com/sakshamjain4999-web/bridge-cursor/blob/refactor/data-contract/src/app/(dashboard)/trips/page.tsx) (Trip list), [`src/app/(dashboard)/parties/page.tsx`](https://github.com/sakshamjain4999-web/bridge-cursor/blob/refactor/data-contract/src/app/(dashboard)/parties/page.tsx) (Party directory)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and shell"]
  node_auth["Sign in / signup<br/>[page.tsx]"]
  node_dashboard["Business overview<br/>[page.tsx]"]
  node_nav["Dashboard navigation<br/>[Sidebar.tsx]"]
end

subgraph group_operations["Fleet operations"]
  node_trips["Trip list<br/>[page.tsx]"]
  node_tripdetail["Trip detail<br/>[page.tsx]"]
  node_tripactions["Trip actions<br/>[TripActions.tsx]"]
  node_tripforms["Trip entry<br/>[AddTripButton.tsx]"]
  node_drivers["Driver management<br/>[page.tsx]"]
  node_driveredit["Driver editing<br/>[EditDriverForm.tsx]"]
  node_fleet["Fleet management<br/>[page.tsx]"]
  node_vehicleedit["Vehicle editing"]
  node_expiry["Expiry warnings<br/>[ExpiryBanner.tsx]"]
end

subgraph group_finance["Finance and billing"]
  node_parties["Party directory<br/>[page.tsx]"]
  node_partydetail["Party ledger<br/>[PartyTabs.tsx]"]
  node_expenses["Expense tracking<br/>[page.tsx]"]
  node_invoices["Invoice management<br/>[page.tsx]"]
  node_invoicepdf["Invoice PDF<br/>[buildInvoicePDF.ts]"]
end

subgraph group_platform["Data and services"]
  node_serverclient["Server data client<br/>[server.ts]"]
  node_browserclient["Browser data client<br/>[client.ts]"]
  node_supabase[("Supabase")]
  node_perf["Request diagnostics"]
end

node_operator(("Transport operator"))

node_operator -->|"signs in"| node_auth
node_operator -->|"views operations"| node_dashboard
node_dashboard -->|"creates client"| node_serverclient
node_dashboard -->|"reads trips"| node_supabase
node_nav -.->|"links to"| node_trips
node_trips -->|"creates client"| node_serverclient
node_trips -->|"queries trips"| node_supabase
node_trips -->|"renders"| node_tripforms
node_trips -.->|"links to"| node_tripdetail
node_tripdetail -->|"renders"| node_tripactions
node_tripdetail -->|"reads and writes"| node_supabase
node_drivers -->|"creates client"| node_serverclient
node_drivers -->|"opens editor"| node_driveredit
node_driveredit -->|"creates client"| node_browserclient
node_fleet -->|"creates client"| node_serverclient
node_fleet -->|"queries vehicles"| node_supabase
node_fleet -->|"renders warnings"| node_expiry
node_fleet -.->|"opens editor"| node_vehicleedit
node_parties -->|"creates client"| node_serverclient
node_parties -->|"queries parties"| node_supabase
node_parties -->|"links to ledger"| node_partydetail
node_expenses -->|"creates client"| node_serverclient
node_expenses -->|"queries expenses"| node_supabase
node_invoices -->|"creates client"| node_serverclient
node_invoices -->|"generates PDF"| node_invoicepdf
node_auth -->|"creates client"| node_browserclient
node_browserclient -.->|"auth and data access"| node_supabase
node_serverclient -.->|"server data access"| node_supabase
node_fleet -->|"logs timings"| node_perf

click node_auth "https://github.com/sakshamjain4999-web/bridge-cursor/blob/refactor/data-contract/src/app/(auth)/signup/page.tsx"
click node_dashboard "https://github.com/sakshamjain4999-web/bridge-cursor/blob/refactor/data-contract/src/app/(dashboard)/page.tsx"
click node_nav "https://github.com/sakshamjain4999-web/bridge-cursor/blob/refactor/data-contract/src/components/layout/Sidebar.tsx"
click node_trips "https://github.com/sakshamjain4999-web/bridge-cursor/blob/refactor/data-contract/src/app/(dashboard)/trips/page.tsx"
click node_tripdetail "https://github.com/sakshamjain4999-web/bridge-cursor/blob/refactor/data-contract/src/app/(dashboard)/trips/%5Bid%5D/page.tsx"
click node_tripactions "https://github.com/sakshamjain4999-web/bridge-cursor/blob/refactor/data-contract/src/app/(dashboard)/trips/%5Bid%5D/TripActions.tsx"
click node_tripforms "https://github.com/sakshamjain4999-web/bridge-cursor/blob/refactor/data-contract/src/app/(dashboard)/trips/AddTripButton.tsx"
click node_drivers "https://github.com/sakshamjain4999-web/bridge-cursor/blob/refactor/data-contract/src/app/(dashboard)/drivers/page.tsx"
click node_driveredit "https://github.com/sakshamjain4999-web/bridge-cursor/blob/refactor/data-contract/src/app/(dashboard)/drivers/%5Bid%5D/EditDriverForm.tsx"
click node_fleet "https://github.com/sakshamjain4999-web/bridge-cursor/blob/refactor/data-contract/src/app/(dashboard)/fleet/page.tsx"
click node_vehicleedit "https://github.com/sakshamjain4999-web/bridge-cursor/blob/refactor/data-contract/src/app/(dashboard)/fleet/%5Bid%5D/EditVehicleForm.tsx"
click node_expiry "https://github.com/sakshamjain4999-web/bridge-cursor/blob/refactor/data-contract/src/app/(dashboard)/fleet/ExpiryBanner.tsx"
click node_parties "https://github.com/sakshamjain4999-web/bridge-cursor/blob/refactor/data-contract/src/app/(dashboard)/parties/page.tsx"
click node_partydetail "https://github.com/sakshamjain4999-web/bridge-cursor/blob/refactor/data-contract/src/app/(dashboard)/parties/%5Bid%5D/PartyTabs.tsx"
click node_expenses "https://github.com/sakshamjain4999-web/bridge-cursor/blob/refactor/data-contract/src/app/(dashboard)/expenses/page.tsx"
click node_invoices "https://github.com/sakshamjain4999-web/bridge-cursor/blob/refactor/data-contract/src/app/(dashboard)/invoices/page.tsx"
click node_invoicepdf "https://github.com/sakshamjain4999-web/bridge-cursor/blob/refactor/data-contract/src/app/(dashboard)/invoices/buildInvoicePDF.ts"
click node_serverclient "https://github.com/sakshamjain4999-web/bridge-cursor/blob/refactor/data-contract/src/lib/supabase/server.ts"
click node_browserclient "https://github.com/sakshamjain4999-web/bridge-cursor/blob/refactor/data-contract/src/lib/supabase/client.ts"
click node_perf "https://github.com/sakshamjain4999-web/bridge-cursor/blob/refactor/data-contract/src/lib/performance-diagnostics.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_auth,node_dashboard,node_nav toneBlue
class node_trips,node_tripdetail,node_tripactions,node_tripforms,node_drivers,node_driveredit,node_fleet,node_vehicleedit,node_expiry toneAmber
class node_parties,node_partydetail,node_expenses,node_invoices,node_invoicepdf toneMint
class node_serverclient,node_browserclient,node_supabase,node_perf toneRose
class node_operator toneIndigo
```

## Components

### Access and shell

- [Sign in / signup](https://github.com/sakshamjain4999-web/bridge-cursor/blob/refactor/data-contract/src/app/(auth)/signup/page.tsx): `src/app/(auth)/signup/page.tsx`
- [Business overview](https://github.com/sakshamjain4999-web/bridge-cursor/blob/refactor/data-contract/src/app/(dashboard)/page.tsx): `src/app/(dashboard)/page.tsx`
- [Dashboard navigation](https://github.com/sakshamjain4999-web/bridge-cursor/blob/refactor/data-contract/src/components/layout/Sidebar.tsx): `src/components/layout/Sidebar.tsx`

### Fleet operations

- [Trip list](https://github.com/sakshamjain4999-web/bridge-cursor/blob/refactor/data-contract/src/app/(dashboard)/trips/page.tsx): `src/app/(dashboard)/trips/page.tsx`
- [Trip detail](https://github.com/sakshamjain4999-web/bridge-cursor/blob/refactor/data-contract/src/app/(dashboard)/trips/%5Bid%5D/page.tsx): `src/app/(dashboard)/trips/[id]/page.tsx`
- [Trip actions](https://github.com/sakshamjain4999-web/bridge-cursor/blob/refactor/data-contract/src/app/(dashboard)/trips/%5Bid%5D/TripActions.tsx): `src/app/(dashboard)/trips/[id]/TripActions.tsx`
- [Trip entry](https://github.com/sakshamjain4999-web/bridge-cursor/blob/refactor/data-contract/src/app/(dashboard)/trips/AddTripButton.tsx): `src/app/(dashboard)/trips/AddTripButton.tsx`
- [Driver management](https://github.com/sakshamjain4999-web/bridge-cursor/blob/refactor/data-contract/src/app/(dashboard)/drivers/page.tsx): `src/app/(dashboard)/drivers/page.tsx`
- [Driver editing](https://github.com/sakshamjain4999-web/bridge-cursor/blob/refactor/data-contract/src/app/(dashboard)/drivers/%5Bid%5D/EditDriverForm.tsx): `src/app/(dashboard)/drivers/[id]/EditDriverForm.tsx`
- [Fleet management](https://github.com/sakshamjain4999-web/bridge-cursor/blob/refactor/data-contract/src/app/(dashboard)/fleet/page.tsx): `src/app/(dashboard)/fleet/page.tsx`
- [Vehicle editing](https://github.com/sakshamjain4999-web/bridge-cursor/blob/refactor/data-contract/src/app/(dashboard)/fleet/%5Bid%5D/EditVehicleForm.tsx): `src/app/(dashboard)/fleet/[id]/EditVehicleForm.tsx`
- [Expiry warnings](https://github.com/sakshamjain4999-web/bridge-cursor/blob/refactor/data-contract/src/app/(dashboard)/fleet/ExpiryBanner.tsx): `src/app/(dashboard)/fleet/ExpiryBanner.tsx`

### Finance and billing

- [Party directory](https://github.com/sakshamjain4999-web/bridge-cursor/blob/refactor/data-contract/src/app/(dashboard)/parties/page.tsx): `src/app/(dashboard)/parties/page.tsx`
- [Party ledger](https://github.com/sakshamjain4999-web/bridge-cursor/blob/refactor/data-contract/src/app/(dashboard)/parties/%5Bid%5D/PartyTabs.tsx): `src/app/(dashboard)/parties/[id]/PartyTabs.tsx`
- [Expense tracking](https://github.com/sakshamjain4999-web/bridge-cursor/blob/refactor/data-contract/src/app/(dashboard)/expenses/page.tsx): `src/app/(dashboard)/expenses/page.tsx`
- [Invoice management](https://github.com/sakshamjain4999-web/bridge-cursor/blob/refactor/data-contract/src/app/(dashboard)/invoices/page.tsx): `src/app/(dashboard)/invoices/page.tsx`
- [Invoice PDF](https://github.com/sakshamjain4999-web/bridge-cursor/blob/refactor/data-contract/src/app/(dashboard)/invoices/buildInvoicePDF.ts): `src/app/(dashboard)/invoices/buildInvoicePDF.ts`

### Data and services

- [Server data client](https://github.com/sakshamjain4999-web/bridge-cursor/blob/refactor/data-contract/src/lib/supabase/server.ts): `src/lib/supabase/server.ts`
- [Browser data client](https://github.com/sakshamjain4999-web/bridge-cursor/blob/refactor/data-contract/src/lib/supabase/client.ts): `src/lib/supabase/client.ts`
- **Supabase**
- [Request diagnostics](https://github.com/sakshamjain4999-web/bridge-cursor/blob/refactor/data-contract/src/lib/performance-diagnostics.ts): `src/lib/performance-diagnostics.ts`

### Other components

- **Transport operator**

## Connections

- Transport operator → Sign in / signup: signs in (evidence: `src/app/(auth)/signup/page.tsx`)
- Transport operator → Business overview: views operations (evidence: `src/app/(dashboard)/page.tsx`)
- Business overview → Server data client: creates client (evidence: `src/app/(dashboard)/page.tsx`)
- Business overview → Supabase: reads trips (evidence: `src/app/(dashboard)/page.tsx`)
- Dashboard navigation → Trip list: links to
- Trip list → Server data client: creates client (evidence: `src/app/(dashboard)/trips/page.tsx`)
- Trip list → Supabase: queries trips (evidence: `src/app/(dashboard)/trips/page.tsx`)
- Trip list → Trip entry: renders (evidence: `src/app/(dashboard)/trips/page.tsx`)
- Trip list → Trip detail: links to
- Trip detail → Trip actions: renders (evidence: `src/app/(dashboard)/trips/[id]/page.tsx`)
- Trip detail → Supabase: reads and writes (evidence: `src/app/(dashboard)/trips/[id]/page.tsx`)
- Driver management → Server data client: creates client (evidence: `src/app/(dashboard)/drivers/page.tsx`)
- Driver management → Driver editing: opens editor
- Driver editing → Browser data client: creates client (evidence: `src/app/(dashboard)/drivers/[id]/EditDriverForm.tsx`)
- Fleet management → Server data client: creates client (evidence: `src/app/(dashboard)/fleet/page.tsx`)
- Fleet management → Supabase: queries vehicles (evidence: `src/app/(dashboard)/fleet/page.tsx`)
- Fleet management → Expiry warnings: renders warnings (evidence: `src/app/(dashboard)/fleet/page.tsx`)
- Fleet management → Vehicle editing: opens editor
- Party directory → Server data client: creates client (evidence: `src/app/(dashboard)/parties/page.tsx`)
- Party directory → Supabase: queries parties (evidence: `src/app/(dashboard)/parties/page.tsx`)
- Party directory → Party ledger: links to ledger (evidence: `src/app/(dashboard)/parties/page.tsx`)
- Expense tracking → Server data client: creates client (evidence: `src/app/(dashboard)/expenses/page.tsx`)
- Expense tracking → Supabase: queries expenses (evidence: `src/app/(dashboard)/expenses/page.tsx`)
- Invoice management → Server data client: creates client (evidence: `src/app/(dashboard)/invoices/page.tsx`)
- Invoice management → Invoice PDF: generates PDF
- Sign in / signup → Browser data client: creates client (evidence: `src/app/(auth)/signup/page.tsx`)
- Browser data client → Supabase: auth and data access
- Server data client → Supabase: server data access
- Fleet management → Request diagnostics: logs timings (evidence: `src/app/(dashboard)/fleet/page.tsx`)
