# tanisha-s0212/ai-eda-assistant architecture

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

- Interactive diagram: https://gitdiagram.com/tanisha-s0212/ai-eda-assistant
- Repository: https://github.com/tanisha-s0212/ai-eda-assistant

## Overview

Intelligent Data Assistant is a guided data-science workspace: users upload a dataset, inspect and clean it, explore and forecast it, train models, make predictions, and generate a report. The Next.js frontend manages the workflow and calls a FastAPI backend, which owns dataset processing and analysis. The README documents PostgreSQL activity tracking and persisted trained models. Backend internals are represented by distinct documented capabilities, but the large backend module was only sampled in excerpts, so implementation-level links between those capabilities are not inferred.

Main entry points: [`frontend/src/app/page.tsx`](https://github.com/tanisha-s0212/ai-eda-assistant/blob/main/frontend/src/app/page.tsx) (Guided workflow), [`backend/main.py`](https://github.com/tanisha-s0212/ai-eda-assistant/blob/main/backend/main.py) (FastAPI service), [`frontend/src/components/tabs/ml-tab.tsx`](https://github.com/tanisha-s0212/ai-eda-assistant/blob/main/frontend/src/components/tabs/ml-tab.tsx) (ML assistant), [`frontend/src/lib/api.ts`](https://github.com/tanisha-s0212/ai-eda-assistant/blob/main/frontend/src/lib/api.ts) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Workflow UI"]
  node_workflow["Guided workflow<br/>[page.tsx]"]
  node_upload["Dataset upload<br/>[upload-tab.tsx]"]
  node_understanding["Data understanding"]
  node_eda["Exploratory analysis<br/>[eda-tab.tsx]"]
  node_cleaning["Data cleaning<br/>[cleaning-tab.tsx]"]
  node_tsforecast["Time-series forecast"]
  node_mlforecast["ML forecast"]
  node_mlassistant["ML assistant<br/>[ml-tab.tsx]"]
  node_prediction["Prediction<br/>[prediction-tab.tsx]"]
  node_report["Report generation<br/>[report-tab.tsx]"]
  node_lossforecast["Loss forecast"]
  node_profitforecast["Profit forecast"]
end

subgraph group_transport["API Layer"]
  node_api["API client<br/>[api.ts]"]
  node_proxy["Next API proxy<br/>[route.ts]"]
end

subgraph group_analysis["Data Analysis"]
  node_backend["FastAPI service<br/>[main.py]"]
  node_dtype["Dtype inference<br/>[dtype_inference.py]"]
end

subgraph group_persistence["State and Storage"]
  node_dataset[("Dataset cache<br/>[main.py]")]
  node_activity[("Workflow activity<br/>[main.py]")]
  node_models[("Persisted models<br/>[main.py]")]
end

node_user(("Workspace user"))
node_postgres[("PostgreSQL")]

node_user -->|"uses"| node_workflow
node_workflow -->|"selects"| node_upload
node_workflow -->|"selects"| node_understanding
node_workflow -->|"selects"| node_eda
node_workflow -->|"selects"| node_cleaning
node_workflow -->|"selects"| node_tsforecast
node_workflow -->|"selects"| node_mlforecast
node_workflow -->|"selects"| node_mlassistant
node_workflow -->|"selects"| node_prediction
node_workflow -->|"selects"| node_report
node_workflow -.->|"includes"| node_lossforecast
node_workflow -.->|"includes"| node_profitforecast
node_mlassistant -->|"requests training"| node_api
node_api -.->|"forwards API requests"| node_proxy
node_proxy -->|"proxies requests"| node_backend
node_backend -->|"uses inference"| node_dtype
node_backend -->|"caches datasets"| node_dataset
node_backend -->|"records actions"| node_activity
node_activity -->|"persists activity"| node_postgres
node_backend -->|"persists trained models"| node_models

click node_workflow "https://github.com/tanisha-s0212/ai-eda-assistant/blob/main/frontend/src/app/page.tsx"
click node_upload "https://github.com/tanisha-s0212/ai-eda-assistant/blob/main/frontend/src/components/tabs/upload-tab.tsx"
click node_understanding "https://github.com/tanisha-s0212/ai-eda-assistant/blob/main/frontend/src/components/tabs/understanding-tab.tsx"
click node_eda "https://github.com/tanisha-s0212/ai-eda-assistant/blob/main/frontend/src/components/tabs/eda-tab.tsx"
click node_cleaning "https://github.com/tanisha-s0212/ai-eda-assistant/blob/main/frontend/src/components/tabs/cleaning-tab.tsx"
click node_tsforecast "https://github.com/tanisha-s0212/ai-eda-assistant/blob/main/frontend/src/components/tabs/time-series-forecast-tab.tsx"
click node_mlforecast "https://github.com/tanisha-s0212/ai-eda-assistant/blob/main/frontend/src/components/tabs/ml-forecast-tab.tsx"
click node_mlassistant "https://github.com/tanisha-s0212/ai-eda-assistant/blob/main/frontend/src/components/tabs/ml-tab.tsx"
click node_prediction "https://github.com/tanisha-s0212/ai-eda-assistant/blob/main/frontend/src/components/tabs/prediction-tab.tsx"
click node_report "https://github.com/tanisha-s0212/ai-eda-assistant/blob/main/frontend/src/components/tabs/report-tab.tsx"
click node_lossforecast "https://github.com/tanisha-s0212/ai-eda-assistant/blob/main/frontend/src/components/tabs/loss-forecast-tab.tsx"
click node_profitforecast "https://github.com/tanisha-s0212/ai-eda-assistant/blob/main/frontend/src/components/tabs/profit-forecast-tab.tsx"
click node_api "https://github.com/tanisha-s0212/ai-eda-assistant/blob/main/frontend/src/lib/api.ts"
click node_proxy "https://github.com/tanisha-s0212/ai-eda-assistant/blob/main/frontend/src/app/api/%5B...path%5D/route.ts"
click node_backend "https://github.com/tanisha-s0212/ai-eda-assistant/blob/main/backend/main.py"
click node_dtype "https://github.com/tanisha-s0212/ai-eda-assistant/blob/main/backend/dtype_inference.py"
click node_dataset "https://github.com/tanisha-s0212/ai-eda-assistant/blob/main/backend/main.py"
click node_activity "https://github.com/tanisha-s0212/ai-eda-assistant/blob/main/backend/main.py"
click node_models "https://github.com/tanisha-s0212/ai-eda-assistant/blob/main/backend/main.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_workflow,node_upload,node_understanding,node_eda,node_cleaning,node_tsforecast,node_mlforecast,node_mlassistant,node_prediction,node_report,node_lossforecast,node_profitforecast,node_user toneBlue
class node_api,node_proxy,node_postgres toneAmber
class node_backend,node_dtype toneMint
class node_dataset,node_activity,node_models toneRose
```

## Components

### Workflow UI

- [Guided workflow](https://github.com/tanisha-s0212/ai-eda-assistant/blob/main/frontend/src/app/page.tsx): `frontend/src/app/page.tsx`
- [Dataset upload](https://github.com/tanisha-s0212/ai-eda-assistant/blob/main/frontend/src/components/tabs/upload-tab.tsx): `frontend/src/components/tabs/upload-tab.tsx`
- [Data understanding](https://github.com/tanisha-s0212/ai-eda-assistant/blob/main/frontend/src/components/tabs/understanding-tab.tsx): `frontend/src/components/tabs/understanding-tab.tsx`
- [Exploratory analysis](https://github.com/tanisha-s0212/ai-eda-assistant/blob/main/frontend/src/components/tabs/eda-tab.tsx): `frontend/src/components/tabs/eda-tab.tsx`
- [Data cleaning](https://github.com/tanisha-s0212/ai-eda-assistant/blob/main/frontend/src/components/tabs/cleaning-tab.tsx): `frontend/src/components/tabs/cleaning-tab.tsx`
- [Time-series forecast](https://github.com/tanisha-s0212/ai-eda-assistant/blob/main/frontend/src/components/tabs/time-series-forecast-tab.tsx): `frontend/src/components/tabs/time-series-forecast-tab.tsx`
- [ML forecast](https://github.com/tanisha-s0212/ai-eda-assistant/blob/main/frontend/src/components/tabs/ml-forecast-tab.tsx): `frontend/src/components/tabs/ml-forecast-tab.tsx`
- [ML assistant](https://github.com/tanisha-s0212/ai-eda-assistant/blob/main/frontend/src/components/tabs/ml-tab.tsx): `frontend/src/components/tabs/ml-tab.tsx`
- [Prediction](https://github.com/tanisha-s0212/ai-eda-assistant/blob/main/frontend/src/components/tabs/prediction-tab.tsx): `frontend/src/components/tabs/prediction-tab.tsx`
- [Report generation](https://github.com/tanisha-s0212/ai-eda-assistant/blob/main/frontend/src/components/tabs/report-tab.tsx): `frontend/src/components/tabs/report-tab.tsx`
- [Loss forecast](https://github.com/tanisha-s0212/ai-eda-assistant/blob/main/frontend/src/components/tabs/loss-forecast-tab.tsx): `frontend/src/components/tabs/loss-forecast-tab.tsx`
- [Profit forecast](https://github.com/tanisha-s0212/ai-eda-assistant/blob/main/frontend/src/components/tabs/profit-forecast-tab.tsx): `frontend/src/components/tabs/profit-forecast-tab.tsx`

### API Layer

- [API client](https://github.com/tanisha-s0212/ai-eda-assistant/blob/main/frontend/src/lib/api.ts): `frontend/src/lib/api.ts`
- [Next API proxy](https://github.com/tanisha-s0212/ai-eda-assistant/blob/main/frontend/src/app/api/%5B...path%5D/route.ts): `frontend/src/app/api/[...path]/route.ts`

### Data Analysis

- [FastAPI service](https://github.com/tanisha-s0212/ai-eda-assistant/blob/main/backend/main.py): `backend/main.py`
- [Dtype inference](https://github.com/tanisha-s0212/ai-eda-assistant/blob/main/backend/dtype_inference.py): `backend/dtype_inference.py`

### State and Storage

- [Dataset cache](https://github.com/tanisha-s0212/ai-eda-assistant/blob/main/backend/main.py): `backend/main.py`
- [Workflow activity](https://github.com/tanisha-s0212/ai-eda-assistant/blob/main/backend/main.py): `backend/main.py`
- [Persisted models](https://github.com/tanisha-s0212/ai-eda-assistant/blob/main/backend/main.py): `backend/main.py`

### Other components

- **Workspace user**
- **PostgreSQL**

## Connections

- Workspace user → Guided workflow: uses (evidence: `README.md`)
- Guided workflow → Dataset upload: selects (evidence: `frontend/src/app/page.tsx`)
- Guided workflow → Data understanding: selects (evidence: `frontend/src/app/page.tsx`)
- Guided workflow → Exploratory analysis: selects (evidence: `frontend/src/app/page.tsx`)
- Guided workflow → Data cleaning: selects (evidence: `frontend/src/app/page.tsx`)
- Guided workflow → Time-series forecast: selects (evidence: `frontend/src/app/page.tsx`)
- Guided workflow → ML forecast: selects (evidence: `frontend/src/app/page.tsx`)
- Guided workflow → ML assistant: selects (evidence: `frontend/src/app/page.tsx`)
- Guided workflow → Prediction: selects (evidence: `README.md`)
- Guided workflow → Report generation: selects (evidence: `README.md`)
- Guided workflow → Loss forecast: includes
- Guided workflow → Profit forecast: includes
- ML assistant → API client: requests training (evidence: `frontend/src/components/tabs/ml-tab.tsx`)
- API client → Next API proxy: forwards API requests (evidence: `README.md`)
- Next API proxy → FastAPI service: proxies requests (evidence: `frontend/src/app/api/[...path]/route.ts`)
- FastAPI service → Dtype inference: uses inference (evidence: `backend/main.py`)
- FastAPI service → Dataset cache: caches datasets (evidence: `backend/main.py`)
- FastAPI service → Workflow activity: records actions (evidence: `README.md`)
- Workflow activity → PostgreSQL: persists activity (evidence: `README.md`)
- FastAPI service → Persisted models: persists trained models (evidence: `README.md`)
