# 404-shiv/clarionex architecture

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

- Interactive diagram: https://gitdiagram.com/404-shiv/clarionex
- Repository: https://github.com/404-shiv/clarionex

## Overview

Clarionex turns uploaded CSVs into cleaned, classified datasets and suggested Plotly visualizations, which users select for a dashboard. The backend keeps the current dataset and metadata in memory; the frontend coordinates upload, chart selection, rendering, and exports. The README documents broad chart support, while the excerpts show the upload/cleaning/metadata path and chart-generation boundary. Some view and chart-rendering details are unsampled, so uncertain internal links are omitted.

Main entry points: [`backend/main.py`](https://github.com/404-shiv/clarionex/blob/main/backend/main.py) (FastAPI endpoints), [`frontend/src/App.jsx`](https://github.com/404-shiv/clarionex/blob/main/frontend/src/App.jsx) (App state), [`frontend/src/views/DashboardView.jsx`](https://github.com/404-shiv/clarionex/blob/main/frontend/src/views/DashboardView.jsx) (Dashboard view), [`frontend/src/components/Layout.jsx`](https://github.com/404-shiv/clarionex/blob/main/frontend/src/components/Layout.jsx) (App layout)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend experience"]
  node_app["App state<br/>[App.jsx]"]
  node_upload_view["Upload view<br/>[UploadView.jsx]"]
  node_upload_zone["CSV upload<br/>[UploadZone.jsx]"]
  node_api["API client<br/>[api.js]"]
  node_dashboard_view["Dashboard view<br/>[DashboardView.jsx]"]
  node_chart_selector["Chart selector<br/>[ChartSelector.jsx]"]
  node_dashboard["Dashboard grid<br/>[Dashboard.jsx]"]
  node_chart_card["Chart card<br/>[ChartCard.jsx]"]
  node_insights_view["Insights view<br/>[InsightsView.jsx]"]
  node_datasets_view["Datasets view<br/>[DatasetsView.jsx]"]
  node_layout["App layout<br/>[Layout.jsx]"]
  node_navbar["Navigation bar<br/>[Navbar.jsx]"]
  node_sidebar["Sidebar navigation<br/>[Sidebar.jsx]"]
end

subgraph group_backend["Dataset processing"]
  node_backend_api["FastAPI endpoints<br/>[main.py]"]
  node_memory_state[("In-memory dataset<br/>[main.py]")]
  node_cleaning["CSV cleaning<br/>[cleaning.py]"]
  node_metadata["Column metadata<br/>[metadata.py]"]
end

subgraph group_visualization["Charting"]
  node_chart_engine["Chart suggestions and generation<br/>[chart_engine.py]"]
  node_plotly["Plotly chart output<br/>[chart_engine.py]"]
end

node_user(("Analyst"))

node_user -->|"uploads CSV"| node_upload_zone
node_app -->|"renders"| node_layout
node_app -->|"routes upload"| node_upload_view
node_app -->|"routes dashboard"| node_dashboard_view
node_upload_view -->|"renders"| node_upload_zone
node_upload_zone -->|"uploads and fetches charts"| node_api
node_api -->|"HTTP requests"| node_backend_api
node_backend_api -->|"cleans dataset"| node_cleaning
node_backend_api -->|"detects structure"| node_metadata
node_backend_api -->|"suggests and generates"| node_chart_engine
node_backend_api -->|"stores dataset and metadata"| node_memory_state
node_chart_engine -.->|"uses stored dataset"| node_memory_state
node_chart_engine -->|"returns chart JSON"| node_plotly
node_dashboard_view -->|"shows chart options"| node_chart_selector
node_dashboard_view -->|"renders selected charts"| node_dashboard
node_dashboard -->|"renders cards"| node_chart_card
node_chart_card -->|"requests chart data"| node_api
node_layout -->|"renders"| node_sidebar
node_layout -->|"renders"| node_navbar
node_insights_view -->|"renders dashboard"| node_dashboard

click node_app "https://github.com/404-shiv/clarionex/blob/main/frontend/src/App.jsx"
click node_upload_view "https://github.com/404-shiv/clarionex/blob/main/frontend/src/views/UploadView.jsx"
click node_upload_zone "https://github.com/404-shiv/clarionex/blob/main/frontend/src/components/UploadZone.jsx"
click node_api "https://github.com/404-shiv/clarionex/blob/main/frontend/src/api.js"
click node_dashboard_view "https://github.com/404-shiv/clarionex/blob/main/frontend/src/views/DashboardView.jsx"
click node_chart_selector "https://github.com/404-shiv/clarionex/blob/main/frontend/src/components/ChartSelector.jsx"
click node_dashboard "https://github.com/404-shiv/clarionex/blob/main/frontend/src/components/Dashboard.jsx"
click node_chart_card "https://github.com/404-shiv/clarionex/blob/main/frontend/src/components/ChartCard.jsx"
click node_insights_view "https://github.com/404-shiv/clarionex/blob/main/frontend/src/views/InsightsView.jsx"
click node_datasets_view "https://github.com/404-shiv/clarionex/blob/main/frontend/src/views/DatasetsView.jsx"
click node_layout "https://github.com/404-shiv/clarionex/blob/main/frontend/src/components/Layout.jsx"
click node_navbar "https://github.com/404-shiv/clarionex/blob/main/frontend/src/components/Navbar.jsx"
click node_sidebar "https://github.com/404-shiv/clarionex/blob/main/frontend/src/components/Sidebar.jsx"
click node_backend_api "https://github.com/404-shiv/clarionex/blob/main/backend/main.py"
click node_memory_state "https://github.com/404-shiv/clarionex/blob/main/backend/main.py"
click node_cleaning "https://github.com/404-shiv/clarionex/blob/main/backend/cleaning.py"
click node_metadata "https://github.com/404-shiv/clarionex/blob/main/backend/metadata.py"
click node_chart_engine "https://github.com/404-shiv/clarionex/blob/main/backend/chart_engine.py"
click node_plotly "https://github.com/404-shiv/clarionex/blob/main/backend/chart_engine.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_upload_view,node_upload_zone,node_api,node_dashboard_view,node_chart_selector,node_dashboard,node_chart_card,node_insights_view,node_datasets_view,node_layout,node_navbar,node_sidebar toneBlue
class node_backend_api,node_memory_state,node_cleaning,node_metadata toneAmber
class node_chart_engine,node_plotly toneMint
class node_user toneIndigo
```

## Components

### Frontend experience

- [App state](https://github.com/404-shiv/clarionex/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Upload view](https://github.com/404-shiv/clarionex/blob/main/frontend/src/views/UploadView.jsx): `frontend/src/views/UploadView.jsx`
- [CSV upload](https://github.com/404-shiv/clarionex/blob/main/frontend/src/components/UploadZone.jsx): `frontend/src/components/UploadZone.jsx`
- [API client](https://github.com/404-shiv/clarionex/blob/main/frontend/src/api.js): `frontend/src/api.js`
- [Dashboard view](https://github.com/404-shiv/clarionex/blob/main/frontend/src/views/DashboardView.jsx): `frontend/src/views/DashboardView.jsx`
- [Chart selector](https://github.com/404-shiv/clarionex/blob/main/frontend/src/components/ChartSelector.jsx): `frontend/src/components/ChartSelector.jsx`
- [Dashboard grid](https://github.com/404-shiv/clarionex/blob/main/frontend/src/components/Dashboard.jsx): `frontend/src/components/Dashboard.jsx`
- [Chart card](https://github.com/404-shiv/clarionex/blob/main/frontend/src/components/ChartCard.jsx): `frontend/src/components/ChartCard.jsx`
- [Insights view](https://github.com/404-shiv/clarionex/blob/main/frontend/src/views/InsightsView.jsx): `frontend/src/views/InsightsView.jsx`
- [Datasets view](https://github.com/404-shiv/clarionex/blob/main/frontend/src/views/DatasetsView.jsx): `frontend/src/views/DatasetsView.jsx`
- [App layout](https://github.com/404-shiv/clarionex/blob/main/frontend/src/components/Layout.jsx): `frontend/src/components/Layout.jsx`
- [Navigation bar](https://github.com/404-shiv/clarionex/blob/main/frontend/src/components/Navbar.jsx): `frontend/src/components/Navbar.jsx`
- [Sidebar navigation](https://github.com/404-shiv/clarionex/blob/main/frontend/src/components/Sidebar.jsx): `frontend/src/components/Sidebar.jsx`

### Dataset processing

- [FastAPI endpoints](https://github.com/404-shiv/clarionex/blob/main/backend/main.py): `backend/main.py`
- [In-memory dataset](https://github.com/404-shiv/clarionex/blob/main/backend/main.py): `backend/main.py`
- [CSV cleaning](https://github.com/404-shiv/clarionex/blob/main/backend/cleaning.py): `backend/cleaning.py`
- [Column metadata](https://github.com/404-shiv/clarionex/blob/main/backend/metadata.py): `backend/metadata.py`

### Charting

- [Chart suggestions and generation](https://github.com/404-shiv/clarionex/blob/main/backend/chart_engine.py): `backend/chart_engine.py`
- [Plotly chart output](https://github.com/404-shiv/clarionex/blob/main/backend/chart_engine.py): `backend/chart_engine.py`

### Other components

- **Analyst**

## Connections

- Analyst → CSV upload: uploads CSV (evidence: `README.md`)
- App state → App layout: renders (evidence: `frontend/src/App.jsx`)
- App state → Upload view: routes upload (evidence: `frontend/src/App.jsx`)
- App state → Dashboard view: routes dashboard (evidence: `frontend/src/App.jsx`)
- Upload view → CSV upload: renders (evidence: `frontend/src/views/UploadView.jsx`)
- CSV upload → API client: uploads and fetches charts (evidence: `frontend/src/components/UploadZone.jsx`)
- API client → FastAPI endpoints: HTTP requests (evidence: `frontend/src/api.js`)
- FastAPI endpoints → CSV cleaning: cleans dataset (evidence: `backend/main.py`)
- FastAPI endpoints → Column metadata: detects structure (evidence: `backend/main.py`)
- FastAPI endpoints → Chart suggestions and generation: suggests and generates (evidence: `backend/main.py`)
- FastAPI endpoints → In-memory dataset: stores dataset and metadata (evidence: `backend/main.py`)
- Chart suggestions and generation → In-memory dataset: uses stored dataset (evidence: `backend/main.py`)
- Chart suggestions and generation → Plotly chart output: returns chart JSON (evidence: `backend/chart_engine.py`)
- Dashboard view → Chart selector: shows chart options (evidence: `frontend/src/views/DashboardView.jsx`)
- Dashboard view → Dashboard grid: renders selected charts (evidence: `frontend/src/views/DashboardView.jsx`)
- Dashboard grid → Chart card: renders cards (evidence: `frontend/src/components/Dashboard.jsx`)
- Chart card → API client: requests chart data (evidence: `frontend/src/components/ChartCard.jsx`)
- App layout → Sidebar navigation: renders (evidence: `frontend/src/components/Layout.jsx`)
- App layout → Navigation bar: renders (evidence: `frontend/src/components/Layout.jsx`)
- Insights view → Dashboard grid: renders dashboard (evidence: `frontend/src/views/InsightsView.jsx`)
