# irrelevantongit/cart-el-for-vulkan architecture

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

- Interactive diagram: https://gitdiagram.com/irrelevantongit/cart-el-for-vulkan
- Repository: https://github.com/irrelevantongit/cart-el-for-vulkan

## Overview

CART-EL is a local-first retail intelligence platform: a generated DuckDB warehouse feeds a Flask analytics API and browser dashboards, with a separate client-side spreadsheet analysis path. The graph also preserves the documented simulation, AI, export, and interface capabilities, plus the sampled Firebase-backed session flows. Some UI-to-API wiring and unsampled endpoint details are based on README documentation rather than inspected implementation.

Main entry points: [`ui/app.py`](https://github.com/irrelevantongit/cart-el-for-vulkan/blob/ui-branch/ui/app.py) (Flask analytics API), [`ui/session.js`](https://github.com/irrelevantongit/cart-el-for-vulkan/blob/ui-branch/ui/session.js) (Session manager), [`ui/dashboard.html`](https://github.com/irrelevantongit/cart-el-for-vulkan/blob/ui-branch/ui/dashboard.html) (Analytics dashboard), [`ui/firebase-config.js`](https://github.com/irrelevantongit/cart-el-for-vulkan/blob/ui-branch/ui/firebase-config.js) (Firebase setup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Retail Data"]
  node_pipeline["Data generator"]
  node_warehouse[("DuckDB warehouse<br/>[retail_hub.duckdb]")]
end

subgraph group_analytics["Analytics Service"]
  node_api["Flask analytics API<br/>[app.py]"]
end

subgraph group_browser["Browser Experience"]
  node_landing["Landing hub<br/>[index.html]"]
  node_dashboard["Analytics dashboard<br/>[dashboard.html]"]
  node_dashboard_logic["Dashboard charts<br/>[script.js]"]
  node_spreadsheet["Excel analytics"]
  node_assistant["El Jefe assistant<br/>[el-jefe-ai.js]"]
  node_export["PDF export<br/>[dashboard.html]"]
  node_theme["Theme and navigation<br/>[theme-toggle.js]"]
end

subgraph group_identity["Identity"]
  node_login["Sign-in and signup<br/>[login.js]"]
  node_firebase_config["Firebase setup<br/>[firebase-config.js]"]
  node_session["Session manager<br/>[session.js]"]
  node_auth_guard["Dashboard guard"]
  node_otp["OTP verification<br/>[otp-auth.js]"]
end

node_retailer(("Retail user"))
node_firebase[("Firebase Auth and Firestore")]

node_retailer -->|"opens"| node_landing
node_landing -->|"previews revenue"| node_warehouse
node_retailer -->|"explores analytics"| node_dashboard
node_dashboard -->|"renders tabs"| node_dashboard_logic
node_dashboard_logic -->|"requests analytics"| node_api
node_api -->|"queries"| node_warehouse
node_retailer -->|"uploads sales file"| node_spreadsheet
node_spreadsheet -.->|"optionally submits analysis"| node_api
node_retailer -->|"asks questions"| node_assistant
node_assistant -->|"reads visible metrics"| node_dashboard
node_retailer -->|"exports view"| node_export
node_export -->|"renders current view"| node_dashboard
node_retailer -->|"changes theme"| node_theme
node_retailer -->|"signs in"| node_login
node_login -.->|"completes login"| node_session
node_session -->|"uses auth and database"| node_firebase_config
node_firebase_config -->|"initializes services"| node_firebase
node_session -->|"logs sessions"| node_firebase
node_auth_guard -->|"checks session"| node_session
node_auth_guard -->|"loads user profile"| node_firebase
node_otp -->|"uses database setup"| node_firebase_config
node_otp -->|"stores and verifies codes"| node_firebase
node_retailer -->|"simulates new data"| node_api
node_api -->|"reruns ETL"| node_pipeline
node_pipeline -->|"writes generated tables"| node_warehouse

click node_pipeline "https://github.com/irrelevantongit/cart-el-for-vulkan/blob/ui-branch/sql/backend_pipeline.py"
click node_warehouse "https://github.com/irrelevantongit/cart-el-for-vulkan/blob/ui-branch/retail_hub.duckdb"
click node_api "https://github.com/irrelevantongit/cart-el-for-vulkan/blob/ui-branch/ui/app.py"
click node_landing "https://github.com/irrelevantongit/cart-el-for-vulkan/blob/ui-branch/ui/index.html"
click node_dashboard "https://github.com/irrelevantongit/cart-el-for-vulkan/blob/ui-branch/ui/dashboard.html"
click node_dashboard_logic "https://github.com/irrelevantongit/cart-el-for-vulkan/blob/ui-branch/ui/script.js"
click node_spreadsheet "https://github.com/irrelevantongit/cart-el-for-vulkan/blob/ui-branch/ui/excel-analytics.html"
click node_assistant "https://github.com/irrelevantongit/cart-el-for-vulkan/blob/ui-branch/ui/el-jefe-ai.js"
click node_export "https://github.com/irrelevantongit/cart-el-for-vulkan/blob/ui-branch/ui/dashboard.html"
click node_theme "https://github.com/irrelevantongit/cart-el-for-vulkan/blob/ui-branch/ui/theme-toggle.js"
click node_login "https://github.com/irrelevantongit/cart-el-for-vulkan/blob/ui-branch/ui/login.js"
click node_firebase_config "https://github.com/irrelevantongit/cart-el-for-vulkan/blob/ui-branch/ui/firebase-config.js"
click node_session "https://github.com/irrelevantongit/cart-el-for-vulkan/blob/ui-branch/ui/session.js"
click node_auth_guard "https://github.com/irrelevantongit/cart-el-for-vulkan/blob/ui-branch/ui/dashboard-auth-guard.js"
click node_otp "https://github.com/irrelevantongit/cart-el-for-vulkan/blob/ui-branch/ui/otp-auth.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_pipeline,node_warehouse,node_retailer toneBlue
class node_api,node_firebase toneAmber
class node_landing,node_dashboard,node_dashboard_logic,node_spreadsheet,node_assistant,node_export,node_theme toneMint
class node_login,node_firebase_config,node_session,node_auth_guard,node_otp toneRose
```

## Components

### Retail Data

- [Data generator](https://github.com/irrelevantongit/cart-el-for-vulkan/blob/ui-branch/sql/backend_pipeline.py): `sql/backend_pipeline.py`
- [DuckDB warehouse](https://github.com/irrelevantongit/cart-el-for-vulkan/blob/ui-branch/retail_hub.duckdb): `retail_hub.duckdb`

### Analytics Service

- [Flask analytics API](https://github.com/irrelevantongit/cart-el-for-vulkan/blob/ui-branch/ui/app.py): `ui/app.py`

### Browser Experience

- [Landing hub](https://github.com/irrelevantongit/cart-el-for-vulkan/blob/ui-branch/ui/index.html): `ui/index.html`
- [Analytics dashboard](https://github.com/irrelevantongit/cart-el-for-vulkan/blob/ui-branch/ui/dashboard.html): `ui/dashboard.html`
- [Dashboard charts](https://github.com/irrelevantongit/cart-el-for-vulkan/blob/ui-branch/ui/script.js): `ui/script.js`
- [Excel analytics](https://github.com/irrelevantongit/cart-el-for-vulkan/blob/ui-branch/ui/excel-analytics.html): `ui/excel-analytics.html`
- [El Jefe assistant](https://github.com/irrelevantongit/cart-el-for-vulkan/blob/ui-branch/ui/el-jefe-ai.js): `ui/el-jefe-ai.js`
- [PDF export](https://github.com/irrelevantongit/cart-el-for-vulkan/blob/ui-branch/ui/dashboard.html): `ui/dashboard.html`
- [Theme and navigation](https://github.com/irrelevantongit/cart-el-for-vulkan/blob/ui-branch/ui/theme-toggle.js): `ui/theme-toggle.js`

### Identity

- [Sign-in and signup](https://github.com/irrelevantongit/cart-el-for-vulkan/blob/ui-branch/ui/login.js): `ui/login.js`
- [Firebase setup](https://github.com/irrelevantongit/cart-el-for-vulkan/blob/ui-branch/ui/firebase-config.js): `ui/firebase-config.js`
- [Session manager](https://github.com/irrelevantongit/cart-el-for-vulkan/blob/ui-branch/ui/session.js): `ui/session.js`
- [Dashboard guard](https://github.com/irrelevantongit/cart-el-for-vulkan/blob/ui-branch/ui/dashboard-auth-guard.js): `ui/dashboard-auth-guard.js`
- [OTP verification](https://github.com/irrelevantongit/cart-el-for-vulkan/blob/ui-branch/ui/otp-auth.js): `ui/otp-auth.js`

### Other components

- **Retail user**
- **Firebase Auth and Firestore**

## Connections

- Retail user → Landing hub: opens (evidence: `README.md`)
- Landing hub → DuckDB warehouse: previews revenue (evidence: `README.md`)
- Retail user → Analytics dashboard: explores analytics (evidence: `README.md`)
- Analytics dashboard → Dashboard charts: renders tabs (evidence: `README.md`)
- Dashboard charts → Flask analytics API: requests analytics (evidence: `README.md`)
- Flask analytics API → DuckDB warehouse: queries (evidence: `ui/app.py`)
- Retail user → Excel analytics: uploads sales file (evidence: `README.md`)
- Excel analytics → Flask analytics API: optionally submits analysis (evidence: `README.md`)
- Retail user → El Jefe assistant: asks questions (evidence: `README.md`)
- El Jefe assistant → Analytics dashboard: reads visible metrics (evidence: `ui/el-jefe-ai.js`)
- Retail user → PDF export: exports view (evidence: `README.md`)
- PDF export → Analytics dashboard: renders current view (evidence: `README.md`)
- Retail user → Theme and navigation: changes theme (evidence: `README.md`)
- Retail user → Sign-in and signup: signs in (evidence: `README.md`)
- Sign-in and signup → Session manager: completes login
- Session manager → Firebase setup: uses auth and database (evidence: `ui/session.js`)
- Firebase setup → Firebase Auth and Firestore: initializes services (evidence: `ui/firebase-config.js`)
- Session manager → Firebase Auth and Firestore: logs sessions (evidence: `ui/session.js`)
- Dashboard guard → Session manager: checks session (evidence: `ui/dashboard-auth-guard.js`)
- Dashboard guard → Firebase Auth and Firestore: loads user profile (evidence: `ui/dashboard-auth-guard.js`)
- OTP verification → Firebase setup: uses database setup (evidence: `ui/otp-auth.js`)
- OTP verification → Firebase Auth and Firestore: stores and verifies codes (evidence: `ui/otp-auth.js`)
- Retail user → Flask analytics API: simulates new data (evidence: `README.md`)
- Flask analytics API → Data generator: reruns ETL (evidence: `README.md`)
- Data generator → DuckDB warehouse: writes generated tables (evidence: `sql/backend_pipeline.py`)
