# ibrahimfaisal12/salespd architecture

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

- Interactive diagram: https://gitdiagram.com/ibrahimfaisal12/salespd
- Repository: https://github.com/ibrahimfaisal12/salespd

## Overview

salespd is a sales-performance dashboard: users create an account or sign in, then access protected sales metrics and charts. A separate Python ingestion script reads the supplied Superstore CSV, normalizes and cleans sales records, and upserts them into Supabase; the dashboard presents sales data from that backend. The dashboard excerpt confirms monthly and regional visualizations, KPI displays, refresh and error handling, and sign-out, but omits its fetch implementation, so the precise query and aggregation wiring cannot be verified here.

Main entry points: [`src/pages/Dashboard.jsx`](https://github.com/ibrahimfaisal12/salespd/blob/main/src/pages/Dashboard.jsx) (Dashboard View), [`src/supabaseClient.js`](https://github.com/ibrahimfaisal12/salespd/blob/main/src/supabaseClient.js) (Supabase Client), [`src/App.jsx`](https://github.com/ibrahimfaisal12/salespd/blob/main/src/App.jsx) (App Router), [`src/components/ProtectedRoute.jsx`](https://github.com/ibrahimfaisal12/salespd/blob/main/src/components/ProtectedRoute.jsx) (Route Guard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web Application"]
  node_app["App Router<br/>[App.jsx]"]
end

subgraph group_access["Authentication"]
  node_login["Login / Signup<br/>[Login.jsx]"]
  node_guard["Route Guard<br/>[ProtectedRoute.jsx]"]
  node_client["Supabase Client<br/>[supabaseClient.js]"]
  node_supabase[("Supabase")]
end

subgraph group_analytics["Sales Analytics"]
  node_dashboard["Dashboard View<br/>[Dashboard.jsx]"]
  node_salesdb[("fact_sales")]
end

subgraph group_ingest["Data Ingestion"]
  node_csv["Superstore CSV"]
  node_ingestscript["Ingest and Clean<br/>[ingest.py]"]
end

node_user(("Dashboard User"))

node_user -->|"opens"| node_app
node_app -->|"routes to"| node_login
node_app -->|"protects"| node_guard
node_guard -->|"renders when authorized"| node_dashboard
node_login -->|"authenticates"| node_client
node_guard -->|"checks session"| node_client
node_dashboard -->|"signs out"| node_client
node_client -->|"auth requests"| node_supabase
node_dashboard -->|"loads sales data"| node_salesdb
node_salesdb -->|"supplies records"| node_dashboard
node_csv -->|"provides rows"| node_ingestscript
node_ingestscript -->|"cleans and upserts"| node_salesdb

click node_app "https://github.com/ibrahimfaisal12/salespd/blob/main/src/App.jsx"
click node_login "https://github.com/ibrahimfaisal12/salespd/blob/main/src/pages/Login.jsx"
click node_guard "https://github.com/ibrahimfaisal12/salespd/blob/main/src/components/ProtectedRoute.jsx"
click node_client "https://github.com/ibrahimfaisal12/salespd/blob/main/src/supabaseClient.js"
click node_dashboard "https://github.com/ibrahimfaisal12/salespd/blob/main/src/pages/Dashboard.jsx"
click node_csv "https://github.com/ibrahimfaisal12/salespd/blob/main/Superstore%20Sales%20Dataset.csv"
click node_ingestscript "https://github.com/ibrahimfaisal12/salespd/blob/main/ingestion/ingest.py"

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_user toneBlue
class node_login,node_guard,node_client,node_supabase toneAmber
class node_dashboard,node_salesdb toneMint
class node_csv,node_ingestscript toneRose
```

## Components

### Web Application

- [App Router](https://github.com/ibrahimfaisal12/salespd/blob/main/src/App.jsx): `src/App.jsx`

### Authentication

- [Login / Signup](https://github.com/ibrahimfaisal12/salespd/blob/main/src/pages/Login.jsx): `src/pages/Login.jsx`
- [Route Guard](https://github.com/ibrahimfaisal12/salespd/blob/main/src/components/ProtectedRoute.jsx): `src/components/ProtectedRoute.jsx`
- [Supabase Client](https://github.com/ibrahimfaisal12/salespd/blob/main/src/supabaseClient.js): `src/supabaseClient.js`
- **Supabase**

### Sales Analytics

- [Dashboard View](https://github.com/ibrahimfaisal12/salespd/blob/main/src/pages/Dashboard.jsx): `src/pages/Dashboard.jsx`
- **fact_sales**

### Data Ingestion

- [Superstore CSV](https://github.com/ibrahimfaisal12/salespd/blob/main/Superstore%20Sales%20Dataset.csv): `Superstore Sales Dataset.csv`
- [Ingest and Clean](https://github.com/ibrahimfaisal12/salespd/blob/main/ingestion/ingest.py): `ingestion/ingest.py`

### Other components

- **Dashboard User**

## Connections

- Dashboard User → App Router: opens
- App Router → Login / Signup: routes to
- App Router → Route Guard: protects
- Route Guard → Dashboard View: renders when authorized
- Login / Signup → Supabase Client: authenticates
- Route Guard → Supabase Client: checks session
- Dashboard View → Supabase Client: signs out
- Supabase Client → Supabase: auth requests
- Dashboard View → fact_sales: loads sales data
- fact_sales → Dashboard View: supplies records
- Superstore CSV → Ingest and Clean: provides rows
- Ingest and Clean → fact_sales: cleans and upserts
