# saiteja-yelamareddy/go-grand architecture

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

- Interactive diagram: https://gitdiagram.com/saiteja-yelamareddy/go-grand
- Repository: https://github.com/saiteja-yelamareddy/go-grand

## Overview

GO GRAND is a car-wash and detailing operations app for owners and staff. Users select a role, authenticate, and enter job-entry or vehicle-management views; owners also manage staff, services, message templates, payment settings, and WhatsApp configuration. Job and business settings use browser storage and Supabase-backed utilities, while the server provides WhatsApp/backend endpoints, authentication, backups, and PDF generation. Relationships below are limited to routes and dependencies visible in excerpts or the source index; unsampled implementations are represented only where the tree supports them.

Main entry points: [`src/App.tsx`](https://github.com/saiteja-yelamareddy/go-grand/blob/main/src/App.tsx) (Application routes), [`src/config/supabaseClient.ts`](https://github.com/saiteja-yelamareddy/go-grand/blob/main/src/config/supabaseClient.ts) (Supabase client), [`src/components/JobSheet.tsx`](https://github.com/saiteja-yelamareddy/go-grand/blob/main/src/components/JobSheet.tsx) (Job entry), [`src/config/authConfig.ts`](https://github.com/saiteja-yelamareddy/go-grand/blob/main/src/config/authConfig.ts) (Auth and sessions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and navigation"]
  node_app["Application routes<br/>[App.tsx]"]
  node_ownerlogin["Owner login<br/>[OwnerLogin.tsx]"]
  node_stafflogin["Staff login<br/>[StaffLogin.tsx]"]
  node_auth["Auth and sessions<br/>[authConfig.ts]"]
  node_protected["Route guards<br/>[ProtectedRoute.tsx]"]
end

subgraph group_operations["Wash operations"]
  node_jobsheet["Job entry<br/>[JobSheet.tsx]"]
  node_today["Today's vehicles<br/>[TodaysVehicles.tsx]"]
  node_vehicles["Vehicle records<br/>[TotalVehicles.tsx]"]
  node_invoice["Invoice utilities<br/>[invoiceUtils.ts]"]
end

subgraph group_owner["Owner management"]
  node_staffmgmt["Staff management<br/>[OwnerStaff.tsx]"]
  node_servicemgmt["Service management<br/>[OwnerServices.tsx]"]
  node_messages["Message templates<br/>[OwnerMessages.tsx]"]
  node_whatsapp["WhatsApp settings"]
  node_whatsappcontext["WhatsApp integration"]
end

subgraph group_persistence["Data and settings"]
  node_jobdata["Job record storage<br/>[draftStorage.ts]"]
  node_staffdata["Staff storage<br/>[staffStorage.ts]"]
  node_servicedata["Service storage<br/>[serviceStorage.ts]"]
  node_templatedata["Template storage<br/>[templateStorage.ts]"]
  node_upi["UPI settings<br/>[upiStorage.ts]"]
  node_supabase["Supabase client<br/>[supabaseClient.ts]"]
end

subgraph group_backend["Backend services"]
  node_api["WhatsApp API config<br/>[apiConfig.ts]"]
  node_server["Backend API<br/>[index.js]"]
  node_serverauth["Backend authentication<br/>[supabaseAuth.js]"]
  node_backup["Backup service<br/>[backupService.js]"]
  node_pdf["PDF generation<br/>[pdfGenerator.js]"]
end

node_user(("Owner or staff"))
node_db[("Supabase database")]
node_whatsappservice["WhatsApp backend"]

node_user -->|"opens"| node_app
node_app -->|"routes to"| node_ownerlogin
node_app -->|"routes to"| node_stafflogin
node_app -->|"guards pages"| node_protected
node_app -->|"routes to"| node_jobsheet
node_app -->|"routes to"| node_today
node_app -->|"routes to"| node_vehicles
node_app -->|"routes to"| node_staffmgmt
node_app -->|"routes to"| node_servicemgmt
node_app -->|"routes to"| node_messages
node_ownerlogin -->|"authenticates via"| node_auth
node_stafflogin -->|"checks staff"| node_staffdata
node_stafflogin -->|"uses sessions"| node_auth
node_protected -->|"checks session"| node_auth
node_jobsheet -->|"reads and writes"| node_jobdata
node_today -->|"reads records"| node_jobdata
node_vehicles -->|"reads records"| node_jobdata
node_jobsheet -->|"uses"| node_invoice
node_jobsheet -->|"uses payment settings"| node_upi
node_jobsheet -->|"uses templates"| node_templatedata
node_staffmgmt -->|"manages staff"| node_staffdata
node_servicemgmt -->|"manages services"| node_servicedata
node_messages -->|"manages templates"| node_templatedata
node_servicedata -->|"uses client"| node_supabase
node_staffdata -->|"uses client"| node_supabase
node_templatedata -->|"uses client"| node_supabase
node_upi -->|"uses client"| node_supabase
node_auth -->|"uses client"| node_supabase
node_jobdata -->|"reads and writes"| node_db
node_supabase -->|"connects to"| node_db
node_whatsapp -->|"resolves endpoint"| node_api
node_whatsappcontext -->|"resolves endpoint"| node_api
node_api -.->|"configures endpoint"| node_whatsappservice
node_server -->|"uses"| node_serverauth
node_server -->|"uses"| node_backup
node_server -->|"uses"| node_pdf

click node_app "https://github.com/saiteja-yelamareddy/go-grand/blob/main/src/App.tsx"
click node_ownerlogin "https://github.com/saiteja-yelamareddy/go-grand/blob/main/src/pages/OwnerLogin.tsx"
click node_stafflogin "https://github.com/saiteja-yelamareddy/go-grand/blob/main/src/pages/StaffLogin.tsx"
click node_auth "https://github.com/saiteja-yelamareddy/go-grand/blob/main/src/config/authConfig.ts"
click node_protected "https://github.com/saiteja-yelamareddy/go-grand/blob/main/src/components/ProtectedRoute.tsx"
click node_jobsheet "https://github.com/saiteja-yelamareddy/go-grand/blob/main/src/components/JobSheet.tsx"
click node_today "https://github.com/saiteja-yelamareddy/go-grand/blob/main/src/components/TodaysVehicles.tsx"
click node_vehicles "https://github.com/saiteja-yelamareddy/go-grand/blob/main/src/components/TotalVehicles.tsx"
click node_jobdata "https://github.com/saiteja-yelamareddy/go-grand/blob/main/src/utils/draftStorage.ts"
click node_invoice "https://github.com/saiteja-yelamareddy/go-grand/blob/main/src/utils/invoiceUtils.ts"
click node_staffmgmt "https://github.com/saiteja-yelamareddy/go-grand/blob/main/src/pages/OwnerStaff.tsx"
click node_staffdata "https://github.com/saiteja-yelamareddy/go-grand/blob/main/src/utils/staffStorage.ts"
click node_servicemgmt "https://github.com/saiteja-yelamareddy/go-grand/blob/main/src/pages/OwnerServices.tsx"
click node_servicedata "https://github.com/saiteja-yelamareddy/go-grand/blob/main/src/utils/serviceStorage.ts"
click node_messages "https://github.com/saiteja-yelamareddy/go-grand/blob/main/src/pages/OwnerMessages.tsx"
click node_templatedata "https://github.com/saiteja-yelamareddy/go-grand/blob/main/src/utils/templateStorage.ts"
click node_upi "https://github.com/saiteja-yelamareddy/go-grand/blob/main/src/utils/upiStorage.ts"
click node_whatsapp "https://github.com/saiteja-yelamareddy/go-grand/blob/main/src/components/WhatsAppSettingsModal.tsx"
click node_whatsappcontext "https://github.com/saiteja-yelamareddy/go-grand/blob/main/src/contexts/WhatsAppContext.tsx"
click node_api "https://github.com/saiteja-yelamareddy/go-grand/blob/main/src/config/apiConfig.ts"
click node_supabase "https://github.com/saiteja-yelamareddy/go-grand/blob/main/src/config/supabaseClient.ts"
click node_server "https://github.com/saiteja-yelamareddy/go-grand/blob/main/server/index.js"
click node_serverauth "https://github.com/saiteja-yelamareddy/go-grand/blob/main/server/supabaseAuth.js"
click node_backup "https://github.com/saiteja-yelamareddy/go-grand/blob/main/server/backupService.js"
click node_pdf "https://github.com/saiteja-yelamareddy/go-grand/blob/main/server/pdfGenerator.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_ownerlogin,node_stafflogin,node_auth,node_protected toneBlue
class node_jobsheet,node_today,node_vehicles,node_invoice,node_db toneAmber
class node_staffmgmt,node_servicemgmt,node_messages,node_whatsapp,node_whatsappcontext toneMint
class node_jobdata,node_staffdata,node_servicedata,node_templatedata,node_upi,node_supabase toneRose
class node_api,node_server,node_serverauth,node_backup,node_pdf,node_user,node_whatsappservice toneIndigo
```

## Components

### Access and navigation

- [Application routes](https://github.com/saiteja-yelamareddy/go-grand/blob/main/src/App.tsx): `src/App.tsx`
- [Owner login](https://github.com/saiteja-yelamareddy/go-grand/blob/main/src/pages/OwnerLogin.tsx): `src/pages/OwnerLogin.tsx`
- [Staff login](https://github.com/saiteja-yelamareddy/go-grand/blob/main/src/pages/StaffLogin.tsx): `src/pages/StaffLogin.tsx`
- [Auth and sessions](https://github.com/saiteja-yelamareddy/go-grand/blob/main/src/config/authConfig.ts): `src/config/authConfig.ts`
- [Route guards](https://github.com/saiteja-yelamareddy/go-grand/blob/main/src/components/ProtectedRoute.tsx): `src/components/ProtectedRoute.tsx`

### Wash operations

- [Job entry](https://github.com/saiteja-yelamareddy/go-grand/blob/main/src/components/JobSheet.tsx): `src/components/JobSheet.tsx`
- [Today's vehicles](https://github.com/saiteja-yelamareddy/go-grand/blob/main/src/components/TodaysVehicles.tsx): `src/components/TodaysVehicles.tsx`
- [Vehicle records](https://github.com/saiteja-yelamareddy/go-grand/blob/main/src/components/TotalVehicles.tsx): `src/components/TotalVehicles.tsx`
- [Invoice utilities](https://github.com/saiteja-yelamareddy/go-grand/blob/main/src/utils/invoiceUtils.ts): `src/utils/invoiceUtils.ts`

### Owner management

- [Staff management](https://github.com/saiteja-yelamareddy/go-grand/blob/main/src/pages/OwnerStaff.tsx): `src/pages/OwnerStaff.tsx`
- [Service management](https://github.com/saiteja-yelamareddy/go-grand/blob/main/src/pages/OwnerServices.tsx): `src/pages/OwnerServices.tsx`
- [Message templates](https://github.com/saiteja-yelamareddy/go-grand/blob/main/src/pages/OwnerMessages.tsx): `src/pages/OwnerMessages.tsx`
- [WhatsApp settings](https://github.com/saiteja-yelamareddy/go-grand/blob/main/src/components/WhatsAppSettingsModal.tsx): `src/components/WhatsAppSettingsModal.tsx`
- [WhatsApp integration](https://github.com/saiteja-yelamareddy/go-grand/blob/main/src/contexts/WhatsAppContext.tsx): `src/contexts/WhatsAppContext.tsx`

### Data and settings

- [Job record storage](https://github.com/saiteja-yelamareddy/go-grand/blob/main/src/utils/draftStorage.ts): `src/utils/draftStorage.ts`
- [Staff storage](https://github.com/saiteja-yelamareddy/go-grand/blob/main/src/utils/staffStorage.ts): `src/utils/staffStorage.ts`
- [Service storage](https://github.com/saiteja-yelamareddy/go-grand/blob/main/src/utils/serviceStorage.ts): `src/utils/serviceStorage.ts`
- [Template storage](https://github.com/saiteja-yelamareddy/go-grand/blob/main/src/utils/templateStorage.ts): `src/utils/templateStorage.ts`
- [UPI settings](https://github.com/saiteja-yelamareddy/go-grand/blob/main/src/utils/upiStorage.ts): `src/utils/upiStorage.ts`
- [Supabase client](https://github.com/saiteja-yelamareddy/go-grand/blob/main/src/config/supabaseClient.ts): `src/config/supabaseClient.ts`

### Backend services

- [WhatsApp API config](https://github.com/saiteja-yelamareddy/go-grand/blob/main/src/config/apiConfig.ts): `src/config/apiConfig.ts`
- [Backend API](https://github.com/saiteja-yelamareddy/go-grand/blob/main/server/index.js): `server/index.js`
- [Backend authentication](https://github.com/saiteja-yelamareddy/go-grand/blob/main/server/supabaseAuth.js): `server/supabaseAuth.js`
- [Backup service](https://github.com/saiteja-yelamareddy/go-grand/blob/main/server/backupService.js): `server/backupService.js`
- [PDF generation](https://github.com/saiteja-yelamareddy/go-grand/blob/main/server/pdfGenerator.js): `server/pdfGenerator.js`

### Other components

- **Owner or staff**
- **Supabase database**
- **WhatsApp backend**

## Connections

- Owner or staff → Application routes: opens (evidence: `src/App.tsx`)
- Application routes → Owner login: routes to (evidence: `src/App.tsx`)
- Application routes → Staff login: routes to (evidence: `src/App.tsx`)
- Application routes → Route guards: guards pages (evidence: `src/App.tsx`)
- Application routes → Job entry: routes to (evidence: `src/App.tsx`)
- Application routes → Today's vehicles: routes to (evidence: `src/App.tsx`)
- Application routes → Vehicle records: routes to (evidence: `src/App.tsx`)
- Application routes → Staff management: routes to (evidence: `src/App.tsx`)
- Application routes → Service management: routes to (evidence: `src/App.tsx`)
- Application routes → Message templates: routes to (evidence: `src/App.tsx`)
- Owner login → Auth and sessions: authenticates via (evidence: `src/config/authConfig.ts`)
- Staff login → Staff storage: checks staff (evidence: `src/pages/StaffLogin.tsx`)
- Staff login → Auth and sessions: uses sessions (evidence: `src/pages/StaffLogin.tsx`)
- Route guards → Auth and sessions: checks session (evidence: `src/components/ProtectedRoute.tsx`)
- Job entry → Job record storage: reads and writes (evidence: `src/components/JobSheet.tsx`)
- Today's vehicles → Job record storage: reads records (evidence: `src/components/TodaysVehicles.tsx`)
- Vehicle records → Job record storage: reads records (evidence: `src/components/TotalVehicles.tsx`)
- Job entry → Invoice utilities: uses (evidence: `src/components/JobSheet.tsx`)
- Job entry → UPI settings: uses payment settings (evidence: `src/components/JobSheet.tsx`)
- Job entry → Template storage: uses templates (evidence: `src/components/JobSheet.tsx`)
- Staff management → Staff storage: manages staff (evidence: `src/pages/OwnerStaff.tsx`)
- Service management → Service storage: manages services (evidence: `src/pages/OwnerServices.tsx`)
- Message templates → Template storage: manages templates (evidence: `src/pages/OwnerMessages.tsx`)
- Service storage → Supabase client: uses client (evidence: `src/utils/serviceStorage.ts`)
- Staff storage → Supabase client: uses client (evidence: `src/utils/staffStorage.ts`)
- Template storage → Supabase client: uses client (evidence: `src/utils/templateStorage.ts`)
- UPI settings → Supabase client: uses client (evidence: `src/utils/upiStorage.ts`)
- Auth and sessions → Supabase client: uses client (evidence: `src/config/authConfig.ts`)
- Job record storage → Supabase database: reads and writes (evidence: `src/utils/draftStorage.ts`)
- Supabase client → Supabase database: connects to (evidence: `src/config/supabaseClient.ts`)
- WhatsApp settings → WhatsApp API config: resolves endpoint (evidence: `src/components/WhatsAppSettingsModal.tsx`)
- WhatsApp integration → WhatsApp API config: resolves endpoint (evidence: `src/contexts/WhatsAppContext.tsx`)
- WhatsApp API config → WhatsApp backend: configures endpoint (evidence: `src/config/apiConfig.ts`)
- Backend API → Backend authentication: uses (evidence: `server/index.js`)
- Backend API → Backup service: uses (evidence: `server/index.js`)
- Backend API → PDF generation: uses (evidence: `server/index.js`)
