# neha-lodh/insightflow architecture

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

- Interactive diagram: https://gitdiagram.com/neha-lodh/insightflow
- Repository: https://github.com/neha-lodh/insightflow

## Overview

InsightFlow is an AI-assisted data analysis app with two user-facing modes: a Flask-served browser interface and a Streamlit interface. The main workflow is to sign in, upload a dataset, inspect its profile and quality, ask questions or explore charts, then download a report. The Python engine supports cleaning, profiling, query planning, safe analysis and report generation; account handling is a separate subsystem. The browser UI implementation was not sampled, so its documented capabilities are shown without inferring its internal calls. Connections are limited to excerpted code or README statements.

Main entry points: [`app.py`](https://github.com/neha-lodh/insightflow/blob/main/app.py) (Streamlit App), [`insightflow_ui.html`](https://github.com/neha-lodh/insightflow/blob/main/insightflow_ui.html) (Web Dashboard), [`server.py`](https://github.com/neha-lodh/insightflow/blob/main/server.py) (Flask Server), [`auth.py`](https://github.com/neha-lodh/insightflow/blob/main/auth.py) (Authentication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User Interfaces"]
  node_streamlit["Streamlit App<br/>[app.py]"]
  node_webui["Web Dashboard"]
  node_explorer["Explore And Quality"]
  node_questions["Questions And Charts"]
  node_reports["Reports"]
end

subgraph group_analysis["Data Analysis"]
  node_engine["Analysis Engine<br/>[core.py]"]
  node_query["Question Planning<br/>[core.py]"]
  node_execution["Safe Analysis<br/>[core.py]"]
end

subgraph group_accounts["Accounts"]
  node_account_ui["Sign-In Page<br/>[login.html]"]
  node_auth["Authentication<br/>[auth.py]"]
  node_users[("Account Database<br/>[users.py]")]
end

subgraph group_delivery["Web Service"]
  node_server["Flask Server<br/>[server.py]"]
  node_excel["Excel Import<br/>[server.py]"]
end

node_analyst(("Analyst"))
node_browser(("Browser"))

node_analyst -->|"uses"| node_streamlit
node_analyst -->|"uses"| node_browser
node_browser -->|"opens"| node_webui
node_server -->|"serves"| node_webui
node_browser -->|"uploads Excel"| node_excel
node_excel -->|"handled by"| node_server
node_server -->|"registers routes"| node_auth
node_account_ui -.->|"uses auth endpoints"| node_auth
node_auth -->|"validates and authenticates"| node_users
node_streamlit -->|"registers and signs in"| node_users
node_streamlit -.->|"prepares dataset"| node_engine
node_streamlit -->|"plans questions"| node_query
node_streamlit -->|"executes analysis"| node_execution
node_streamlit -->|"builds reports"| node_engine
node_webui -->|"provides"| node_explorer
node_webui -->|"provides"| node_questions
node_webui -->|"provides"| node_reports
node_analyst -->|"inspects data"| node_explorer
node_analyst -->|"asks questions"| node_questions
node_analyst -->|"downloads"| node_reports
node_query -.->|"creates plan"| node_execution

click node_streamlit "https://github.com/neha-lodh/insightflow/blob/main/app.py"
click node_webui "https://github.com/neha-lodh/insightflow/blob/main/insightflow_ui.html"
click node_explorer "https://github.com/neha-lodh/insightflow/blob/main/insightflow_ui.html"
click node_questions "https://github.com/neha-lodh/insightflow/blob/main/insightflow_ui.html"
click node_reports "https://github.com/neha-lodh/insightflow/blob/main/insightflow_ui.html"
click node_engine "https://github.com/neha-lodh/insightflow/blob/main/core.py"
click node_query "https://github.com/neha-lodh/insightflow/blob/main/core.py"
click node_execution "https://github.com/neha-lodh/insightflow/blob/main/core.py"
click node_account_ui "https://github.com/neha-lodh/insightflow/blob/main/login.html"
click node_auth "https://github.com/neha-lodh/insightflow/blob/main/auth.py"
click node_users "https://github.com/neha-lodh/insightflow/blob/main/users.py"
click node_server "https://github.com/neha-lodh/insightflow/blob/main/server.py"
click node_excel "https://github.com/neha-lodh/insightflow/blob/main/server.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_streamlit,node_webui,node_explorer,node_questions,node_reports,node_browser toneBlue
class node_engine,node_query,node_execution toneAmber
class node_account_ui,node_auth,node_users toneMint
class node_server,node_excel toneRose
class node_analyst toneIndigo
```

## Components

### User Interfaces

- [Streamlit App](https://github.com/neha-lodh/insightflow/blob/main/app.py): `app.py`
- [Web Dashboard](https://github.com/neha-lodh/insightflow/blob/main/insightflow_ui.html): `insightflow_ui.html`
- [Explore And Quality](https://github.com/neha-lodh/insightflow/blob/main/insightflow_ui.html): `insightflow_ui.html`
- [Questions And Charts](https://github.com/neha-lodh/insightflow/blob/main/insightflow_ui.html): `insightflow_ui.html`
- [Reports](https://github.com/neha-lodh/insightflow/blob/main/insightflow_ui.html): `insightflow_ui.html`

### Data Analysis

- [Analysis Engine](https://github.com/neha-lodh/insightflow/blob/main/core.py): `core.py`
- [Question Planning](https://github.com/neha-lodh/insightflow/blob/main/core.py): `core.py`
- [Safe Analysis](https://github.com/neha-lodh/insightflow/blob/main/core.py): `core.py`

### Accounts

- [Sign-In Page](https://github.com/neha-lodh/insightflow/blob/main/login.html): `login.html`
- [Authentication](https://github.com/neha-lodh/insightflow/blob/main/auth.py): `auth.py`
- [Account Database](https://github.com/neha-lodh/insightflow/blob/main/users.py): `users.py`

### Web Service

- [Flask Server](https://github.com/neha-lodh/insightflow/blob/main/server.py): `server.py`
- [Excel Import](https://github.com/neha-lodh/insightflow/blob/main/server.py): `server.py`

### Other components

- **Analyst**
- **Browser**

## Connections

- Analyst → Streamlit App: uses (evidence: `README.md`)
- Analyst → Browser: uses (evidence: `README.md`)
- Browser → Web Dashboard: opens (evidence: `README.md`)
- Flask Server → Web Dashboard: serves (evidence: `server.py`)
- Browser → Excel Import: uploads Excel (evidence: `README.md`)
- Excel Import → Flask Server: handled by (evidence: `server.py`)
- Flask Server → Authentication: registers routes (evidence: `server.py`)
- Sign-In Page → Authentication: uses auth endpoints
- Authentication → Account Database: validates and authenticates (evidence: `auth.py`)
- Streamlit App → Account Database: registers and signs in (evidence: `app.py`)
- Streamlit App → Analysis Engine: prepares dataset (evidence: `app.py`)
- Streamlit App → Question Planning: plans questions (evidence: `app.py`)
- Streamlit App → Safe Analysis: executes analysis (evidence: `app.py`)
- Streamlit App → Analysis Engine: builds reports (evidence: `app.py`)
- Web Dashboard → Explore And Quality: provides (evidence: `README.md`)
- Web Dashboard → Questions And Charts: provides (evidence: `README.md`)
- Web Dashboard → Reports: provides (evidence: `README.md`)
- Analyst → Explore And Quality: inspects data (evidence: `README.md`)
- Analyst → Questions And Charts: asks questions (evidence: `README.md`)
- Analyst → Reports: downloads (evidence: `README.md`)
- Question Planning → Safe Analysis: creates plan (evidence: `core.py`)
