# evan-reichert/opsforge architecture

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

- Interactive diagram: https://gitdiagram.com/evan-reichert/opsforge
- Repository: https://github.com/evan-reichert/opsforge

## Overview

OpsForge is a CSV-based operations analytics dashboard. A user submits an export through the React interface; the FastAPI backend applies upload guards, analyzes the data with AI or heuristic fallback, returns health and issue summaries, and saves reports for later retrieval. The graph also shows the dashboard and report-history views. Backend validation and analysis details are only partly excerpted, so those domain links rely on the README; storage and frontend calls are more directly evidenced.

Main entry points: [`src/App.tsx`](https://github.com/evan-reichert/opsforge/blob/main/src/App.tsx) (App shell), [`main.py`](https://github.com/evan-reichert/opsforge/blob/main/main.py) (FastAPI routes), [`src/components/Upload.tsx`](https://github.com/evan-reichert/opsforge/blob/main/src/components/Upload.tsx) (CSV upload), [`src/components/Past.tsx`](https://github.com/evan-reichert/opsforge/blob/main/src/components/Past.tsx) (Report history)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Dashboard UI"]
  node_app["App shell<br/>[App.tsx]"]
  node_navigation["Tab navigation<br/>[Tabs.tsx]"]
  node_home["Home page<br/>[Home.tsx]"]
  node_about["Product overview<br/>[About.tsx]"]
  node_upload_ui["CSV upload<br/>[Upload.tsx]"]
  node_history_ui["Report history<br/>[Past.tsx]"]
  node_kpi_grid["Health metrics<br/>[KpiGrid.tsx]"]
  node_kpi_card["Metric card<br/>[KpiCard.tsx]"]
  node_issue_chart["Issue chart<br/>[BarChart.tsx]"]
  node_client_key["Client identity<br/>[clientKey.ts]"]
end

subgraph group_backend["Analysis Backend"]
  node_api["FastAPI routes<br/>[main.py]"]
  node_csv_validation["CSV validation<br/>[main.py]"]
  node_analysis["Issue analysis<br/>[model.py]"]
  node_report_generation["Scoring and advice<br/>[model.py]"]
  node_serverless["Serverless entry<br/>[index.py]"]
end

subgraph group_persistence["Report Storage"]
  node_report_record["Report model<br/>[database.py]"]
  node_report_store[("Report database<br/>[database.py]")]
end

subgraph group_integration["External Services"]
  node_openai["OpenAI API"]
end

node_user(("User"))

node_user -->|"uses"| node_app
node_app -->|"renders"| node_navigation
node_app -->|"renders"| node_home
node_app -->|"renders"| node_about
node_app -->|"renders"| node_upload_ui
node_app -->|"renders"| node_history_ui
node_app -->|"renders"| node_kpi_grid
node_app -->|"renders"| node_issue_chart
node_home -->|"opens tab"| node_upload_ui
node_upload_ui -->|"gets identity"| node_client_key
node_history_ui -->|"gets identity"| node_client_key
node_upload_ui -->|"posts CSV"| node_api
node_history_ui -->|"lists reports"| node_api
node_app -->|"loads report"| node_api
node_upload_ui -->|"renders metrics"| node_kpi_grid
node_upload_ui -->|"renders counts"| node_issue_chart
node_kpi_grid -->|"renders cards"| node_kpi_card
node_api -->|"validates upload"| node_csv_validation
node_csv_validation -->|"analyzes dataset"| node_analysis
node_api -->|"invokes analysis"| node_analysis
node_analysis -->|"builds report"| node_report_generation
node_report_generation -.->|"requests AI analysis"| node_openai
node_api -->|"creates record"| node_report_record
node_report_record -->|"persists payload"| node_report_store
node_api -->|"reads and writes"| node_report_store
node_serverless -->|"serves app"| node_api

click node_app "https://github.com/evan-reichert/opsforge/blob/main/src/App.tsx"
click node_navigation "https://github.com/evan-reichert/opsforge/blob/main/src/components/Tabs.tsx"
click node_home "https://github.com/evan-reichert/opsforge/blob/main/src/components/Home.tsx"
click node_about "https://github.com/evan-reichert/opsforge/blob/main/src/components/About.tsx"
click node_upload_ui "https://github.com/evan-reichert/opsforge/blob/main/src/components/Upload.tsx"
click node_history_ui "https://github.com/evan-reichert/opsforge/blob/main/src/components/Past.tsx"
click node_kpi_grid "https://github.com/evan-reichert/opsforge/blob/main/src/components/KpiGrid.tsx"
click node_kpi_card "https://github.com/evan-reichert/opsforge/blob/main/src/components/KpiCard.tsx"
click node_issue_chart "https://github.com/evan-reichert/opsforge/blob/main/src/components/BarChart.tsx"
click node_client_key "https://github.com/evan-reichert/opsforge/blob/main/src/utils/clientKey.ts"
click node_api "https://github.com/evan-reichert/opsforge/blob/main/main.py"
click node_csv_validation "https://github.com/evan-reichert/opsforge/blob/main/main.py"
click node_analysis "https://github.com/evan-reichert/opsforge/blob/main/model.py"
click node_report_generation "https://github.com/evan-reichert/opsforge/blob/main/model.py"
click node_serverless "https://github.com/evan-reichert/opsforge/blob/main/api/index.py"
click node_report_record "https://github.com/evan-reichert/opsforge/blob/main/database.py"
click node_report_store "https://github.com/evan-reichert/opsforge/blob/main/database.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_navigation,node_home,node_about,node_upload_ui,node_history_ui,node_kpi_grid,node_kpi_card,node_issue_chart,node_client_key,node_user toneBlue
class node_api,node_csv_validation,node_analysis,node_report_generation,node_serverless toneAmber
class node_report_record,node_report_store toneMint
class node_openai toneRose
```

## Components

### Dashboard UI

- [App shell](https://github.com/evan-reichert/opsforge/blob/main/src/App.tsx): `src/App.tsx`
- [Tab navigation](https://github.com/evan-reichert/opsforge/blob/main/src/components/Tabs.tsx): `src/components/Tabs.tsx`
- [Home page](https://github.com/evan-reichert/opsforge/blob/main/src/components/Home.tsx): `src/components/Home.tsx`
- [Product overview](https://github.com/evan-reichert/opsforge/blob/main/src/components/About.tsx): `src/components/About.tsx`
- [CSV upload](https://github.com/evan-reichert/opsforge/blob/main/src/components/Upload.tsx): `src/components/Upload.tsx`
- [Report history](https://github.com/evan-reichert/opsforge/blob/main/src/components/Past.tsx): `src/components/Past.tsx`
- [Health metrics](https://github.com/evan-reichert/opsforge/blob/main/src/components/KpiGrid.tsx): `src/components/KpiGrid.tsx`
- [Metric card](https://github.com/evan-reichert/opsforge/blob/main/src/components/KpiCard.tsx): `src/components/KpiCard.tsx`
- [Issue chart](https://github.com/evan-reichert/opsforge/blob/main/src/components/BarChart.tsx): `src/components/BarChart.tsx`
- [Client identity](https://github.com/evan-reichert/opsforge/blob/main/src/utils/clientKey.ts): `src/utils/clientKey.ts`

### Analysis Backend

- [FastAPI routes](https://github.com/evan-reichert/opsforge/blob/main/main.py): `main.py`
- [CSV validation](https://github.com/evan-reichert/opsforge/blob/main/main.py): `main.py`
- [Issue analysis](https://github.com/evan-reichert/opsforge/blob/main/model.py): `model.py`
- [Scoring and advice](https://github.com/evan-reichert/opsforge/blob/main/model.py): `model.py`
- [Serverless entry](https://github.com/evan-reichert/opsforge/blob/main/api/index.py): `api/index.py`

### Report Storage

- [Report model](https://github.com/evan-reichert/opsforge/blob/main/database.py): `database.py`
- [Report database](https://github.com/evan-reichert/opsforge/blob/main/database.py): `database.py`

### External Services

- **OpenAI API**

### Other components

- **User**

## Connections

- User → App shell: uses (evidence: `README.md`)
- App shell → Tab navigation: renders (evidence: `src/App.tsx`)
- App shell → Home page: renders (evidence: `src/App.tsx`)
- App shell → Product overview: renders (evidence: `src/App.tsx`)
- App shell → CSV upload: renders (evidence: `src/App.tsx`)
- App shell → Report history: renders (evidence: `src/App.tsx`)
- App shell → Health metrics: renders (evidence: `src/App.tsx`)
- App shell → Issue chart: renders (evidence: `src/App.tsx`)
- Home page → CSV upload: opens tab (evidence: `src/App.tsx`)
- CSV upload → Client identity: gets identity (evidence: `src/components/Upload.tsx`)
- Report history → Client identity: gets identity (evidence: `src/components/Past.tsx`)
- CSV upload → FastAPI routes: posts CSV (evidence: `src/components/Upload.tsx`)
- Report history → FastAPI routes: lists reports (evidence: `src/components/Past.tsx`)
- App shell → FastAPI routes: loads report (evidence: `src/App.tsx`)
- CSV upload → Health metrics: renders metrics (evidence: `src/components/Upload.tsx`)
- CSV upload → Issue chart: renders counts (evidence: `src/components/Upload.tsx`)
- Health metrics → Metric card: renders cards (evidence: `src/components/KpiGrid.tsx`)
- FastAPI routes → CSV validation: validates upload (evidence: `README.md`)
- CSV validation → Issue analysis: analyzes dataset (evidence: `README.md`)
- FastAPI routes → Issue analysis: invokes analysis (evidence: `main.py`)
- Issue analysis → Scoring and advice: builds report (evidence: `README.md`)
- Scoring and advice → OpenAI API: requests AI analysis (evidence: `model.py`)
- FastAPI routes → Report model: creates record (evidence: `main.py`)
- Report model → Report database: persists payload (evidence: `database.py`)
- FastAPI routes → Report database: reads and writes (evidence: `main.py`)
- Serverless entry → FastAPI routes: serves app (evidence: `api/index.py`)
