# hm186812/avatrautoservice architecture

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

- Interactive diagram: https://gitdiagram.com/hm186812/avatrautoservice
- Repository: https://github.com/hm186812/avatrautoservice

## Overview

AVATR is a dealership CRM, showroom, POS, and auto-service application. Staff sign in, then work through dashboard, customer, inventory, stock receiving, sales, billing, and service workflows; the app coordinates view state and persistence. The README also describes a customer-facing vehicle catalog, role-based access, cloud synchronization, payment assets, and offline fallback. The graph reflects those documented capabilities, but unsampled implementation details are represented at directory level. Edges are limited to relationships shown in excerpts, the source index, or README; some documented integrations lack sampled implementation paths.

Main entry points: [`src/App.tsx`](https://github.com/hm186812/avatrautoservice/blob/main/src/App.tsx) (Application coordinator), [`src/backend/data.ts`](https://github.com/hm186812/avatrautoservice/blob/main/src/backend/data.ts) (Backend data services), [`src/components/views/POSSalesView.tsx`](https://github.com/hm186812/avatrautoservice/blob/main/src/components/views/POSSalesView.tsx) (POS and payments), [`src/components/auth/LoginView.tsx`](https://github.com/hm186812/avatrautoservice/blob/main/src/components/auth/LoginView.tsx) (Staff sign-in)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Staff experience"]
  node_app["Application coordinator<br/>[App.tsx]"]
  node_login["Staff sign-in<br/>[LoginView.tsx]"]
  node_navigation["Role-aware navigation<br/>[Sidebar.tsx]"]
end

subgraph group_operations["Dealership operations"]
  node_dashboard["Dashboard and reporting<br/>[DashboardView.tsx]"]
  node_customers["Customer CRM<br/>[CustomerView.tsx]"]
  node_catalog["Vehicle catalog<br/>[InventoryView.tsx]"]
  node_stockin["Stock receiving<br/>[StockInView.tsx]"]
  node_sales["POS and payments<br/>[POSSalesView.tsx]"]
  node_bills["Bills management"]
  node_alerts["Stock alerts"]
  node_appointments["Appointments"]
  node_users["User governance"]
  node_profile["Staff profile<br/>[ProfileView.tsx]"]
  node_modals["Sales and service forms"]
end

subgraph group_persistence["Data and persistence"]
  node_backend["Backend data services<br/>[data.ts]"]
  node_ids["Record identifiers<br/>[ids.ts]"]
  node_security["Input sanitization<br/>[security.ts]"]
  node_supabaseclient["Supabase client<br/>[client.ts]"]
  node_cloud[("Supabase cloud")]
  node_local[("Browser local storage")]
end

subgraph group_shared["Shared interface"]
  node_translations["Translations<br/>[translations.ts]"]
  node_settings["Company payment settings<br/>[companySettings.ts]"]
  node_currencies["Currency configuration<br/>[currencies.ts]"]
  node_mockdata["Offline sample data<br/>[mockData.ts]"]
end

node_staff(("Dealership staff"))

node_staff -->|"signs in"| node_login
node_login -->|"submits credentials"| node_app
node_app -->|"loads and saves"| node_backend
node_app -->|"shows navigation"| node_navigation
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_customers
node_app -->|"routes to"| node_catalog
node_app -->|"routes to"| node_stockin
node_app -->|"routes to"| node_sales
node_app -->|"routes to"| node_bills
node_app -->|"routes to"| node_alerts
node_app -->|"routes to"| node_appointments
node_app -->|"routes to"| node_users
node_app -->|"routes to"| node_profile
node_app -->|"opens forms"| node_modals
node_stockin -->|"uploads vehicle image"| node_backend
node_sales -->|"saves settings"| node_backend
node_backend -->|"requires client"| node_supabaseclient
node_supabaseclient -.->|"connects to"| node_cloud
node_backend -->|"creates identifiers"| node_ids
node_backend -->|"sanitizes input"| node_security
node_app -->|"stores preferences"| node_local
node_sales -->|"reads payment settings"| node_settings
node_sales -->|"uses currencies"| node_currencies
node_app -->|"uses translations"| node_translations
node_backend -.->|"offline fallback"| node_local
node_app -.->|"offline data"| node_mockdata

click node_app "https://github.com/hm186812/avatrautoservice/blob/main/src/App.tsx"
click node_login "https://github.com/hm186812/avatrautoservice/blob/main/src/components/auth/LoginView.tsx"
click node_navigation "https://github.com/hm186812/avatrautoservice/blob/main/src/components/layout/Sidebar.tsx"
click node_dashboard "https://github.com/hm186812/avatrautoservice/blob/main/src/components/views/DashboardView.tsx"
click node_customers "https://github.com/hm186812/avatrautoservice/blob/main/src/components/views/CustomerView.tsx"
click node_catalog "https://github.com/hm186812/avatrautoservice/blob/main/src/components/views/InventoryView.tsx"
click node_stockin "https://github.com/hm186812/avatrautoservice/blob/main/src/components/views/StockInView.tsx"
click node_sales "https://github.com/hm186812/avatrautoservice/blob/main/src/components/views/POSSalesView.tsx"
click node_bills "https://github.com/hm186812/avatrautoservice/blob/main/src/components/views/BillsManagementView.tsx"
click node_alerts "https://github.com/hm186812/avatrautoservice/blob/main/src/components/views/StockAlertsView.tsx"
click node_appointments "https://github.com/hm186812/avatrautoservice/blob/main/src/components/views/AppointmentsView.tsx"
click node_users "https://github.com/hm186812/avatrautoservice/blob/main/src/components/views/UserManagementView.tsx"
click node_profile "https://github.com/hm186812/avatrautoservice/blob/main/src/components/views/ProfileView.tsx"
click node_modals "https://github.com/hm186812/avatrautoservice/tree/main/src/components/modals"
click node_backend "https://github.com/hm186812/avatrautoservice/blob/main/src/backend/data.ts"
click node_ids "https://github.com/hm186812/avatrautoservice/blob/main/src/backend/ids.ts"
click node_security "https://github.com/hm186812/avatrautoservice/blob/main/src/utils/security.ts"
click node_supabaseclient "https://github.com/hm186812/avatrautoservice/blob/main/src/backend/client.ts"
click node_translations "https://github.com/hm186812/avatrautoservice/blob/main/src/data/translations.ts"
click node_settings "https://github.com/hm186812/avatrautoservice/blob/main/src/data/companySettings.ts"
click node_currencies "https://github.com/hm186812/avatrautoservice/blob/main/src/data/currencies.ts"
click node_mockdata "https://github.com/hm186812/avatrautoservice/blob/main/src/data/mockData.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_app,node_login,node_navigation toneBlue
class node_dashboard,node_customers,node_catalog,node_stockin,node_sales,node_bills,node_alerts,node_appointments,node_users,node_profile,node_modals toneAmber
class node_backend,node_ids,node_security,node_supabaseclient,node_cloud,node_local toneMint
class node_translations,node_settings,node_currencies,node_mockdata toneRose
class node_staff toneIndigo
```

## Components

### Staff experience

- [Application coordinator](https://github.com/hm186812/avatrautoservice/blob/main/src/App.tsx): `src/App.tsx`
- [Staff sign-in](https://github.com/hm186812/avatrautoservice/blob/main/src/components/auth/LoginView.tsx): `src/components/auth/LoginView.tsx`
- [Role-aware navigation](https://github.com/hm186812/avatrautoservice/blob/main/src/components/layout/Sidebar.tsx): `src/components/layout/Sidebar.tsx`

### Dealership operations

- [Dashboard and reporting](https://github.com/hm186812/avatrautoservice/blob/main/src/components/views/DashboardView.tsx): `src/components/views/DashboardView.tsx`
- [Customer CRM](https://github.com/hm186812/avatrautoservice/blob/main/src/components/views/CustomerView.tsx): `src/components/views/CustomerView.tsx`
- [Vehicle catalog](https://github.com/hm186812/avatrautoservice/blob/main/src/components/views/InventoryView.tsx): `src/components/views/InventoryView.tsx`
- [Stock receiving](https://github.com/hm186812/avatrautoservice/blob/main/src/components/views/StockInView.tsx): `src/components/views/StockInView.tsx`
- [POS and payments](https://github.com/hm186812/avatrautoservice/blob/main/src/components/views/POSSalesView.tsx): `src/components/views/POSSalesView.tsx`
- [Bills management](https://github.com/hm186812/avatrautoservice/blob/main/src/components/views/BillsManagementView.tsx): `src/components/views/BillsManagementView.tsx`
- [Stock alerts](https://github.com/hm186812/avatrautoservice/blob/main/src/components/views/StockAlertsView.tsx): `src/components/views/StockAlertsView.tsx`
- [Appointments](https://github.com/hm186812/avatrautoservice/blob/main/src/components/views/AppointmentsView.tsx): `src/components/views/AppointmentsView.tsx`
- [User governance](https://github.com/hm186812/avatrautoservice/blob/main/src/components/views/UserManagementView.tsx): `src/components/views/UserManagementView.tsx`
- [Staff profile](https://github.com/hm186812/avatrautoservice/blob/main/src/components/views/ProfileView.tsx): `src/components/views/ProfileView.tsx`
- [Sales and service forms](https://github.com/hm186812/avatrautoservice/tree/main/src/components/modals): `src/components/modals`

### Data and persistence

- [Backend data services](https://github.com/hm186812/avatrautoservice/blob/main/src/backend/data.ts): `src/backend/data.ts`
- [Record identifiers](https://github.com/hm186812/avatrautoservice/blob/main/src/backend/ids.ts): `src/backend/ids.ts`
- [Input sanitization](https://github.com/hm186812/avatrautoservice/blob/main/src/utils/security.ts): `src/utils/security.ts`
- [Supabase client](https://github.com/hm186812/avatrautoservice/blob/main/src/backend/client.ts): `src/backend/client.ts`
- **Supabase cloud**
- **Browser local storage**

### Shared interface

- [Translations](https://github.com/hm186812/avatrautoservice/blob/main/src/data/translations.ts): `src/data/translations.ts`
- [Company payment settings](https://github.com/hm186812/avatrautoservice/blob/main/src/data/companySettings.ts): `src/data/companySettings.ts`
- [Currency configuration](https://github.com/hm186812/avatrautoservice/blob/main/src/data/currencies.ts): `src/data/currencies.ts`
- [Offline sample data](https://github.com/hm186812/avatrautoservice/blob/main/src/data/mockData.ts): `src/data/mockData.ts`

### Other components

- **Dealership staff**

## Connections

- Dealership staff → Staff sign-in: signs in
- Staff sign-in → Application coordinator: submits credentials (evidence: `src/App.tsx`)
- Application coordinator → Backend data services: loads and saves (evidence: `src/App.tsx`)
- Application coordinator → Role-aware navigation: shows navigation (evidence: `src/App.tsx`)
- Application coordinator → Dashboard and reporting: routes to (evidence: `src/App.tsx`)
- Application coordinator → Customer CRM: routes to (evidence: `src/App.tsx`)
- Application coordinator → Vehicle catalog: routes to (evidence: `src/App.tsx`)
- Application coordinator → Stock receiving: routes to (evidence: `src/App.tsx`)
- Application coordinator → POS and payments: routes to (evidence: `src/App.tsx`)
- Application coordinator → Bills management: routes to (evidence: `src/App.tsx`)
- Application coordinator → Stock alerts: routes to (evidence: `src/App.tsx`)
- Application coordinator → Appointments: routes to (evidence: `src/App.tsx`)
- Application coordinator → User governance: routes to (evidence: `src/App.tsx`)
- Application coordinator → Staff profile: routes to (evidence: `src/App.tsx`)
- Application coordinator → Sales and service forms: opens forms (evidence: `src/App.tsx`)
- Stock receiving → Backend data services: uploads vehicle image (evidence: `src/components/views/StockInView.tsx`)
- POS and payments → Backend data services: saves settings (evidence: `src/components/views/POSSalesView.tsx`)
- Backend data services → Supabase client: requires client (evidence: `src/backend/data.ts`)
- Supabase client → Supabase cloud: connects to (evidence: `README.md`)
- Backend data services → Record identifiers: creates identifiers (evidence: `src/backend/data.ts`)
- Backend data services → Input sanitization: sanitizes input (evidence: `src/backend/data.ts`)
- Application coordinator → Browser local storage: stores preferences (evidence: `src/App.tsx`)
- POS and payments → Company payment settings: reads payment settings (evidence: `src/components/views/POSSalesView.tsx`)
- POS and payments → Currency configuration: uses currencies (evidence: `src/components/views/POSSalesView.tsx`)
- Application coordinator → Translations: uses translations (evidence: `src/App.tsx`)
- Backend data services → Browser local storage: offline fallback (evidence: `README.md`)
- Application coordinator → Offline sample data: offline data (evidence: `README.md`)
