# chandrashekhar235/foundrai architecture

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

- Interactive diagram: https://gitdiagram.com/chandrashekhar235/foundrai
- Repository: https://github.com/chandrashekhar235/foundrai

## Overview

FoundrAI presents a startup-idea-to-blueprint workflow. Users enter an idea in the analysis UI; the Express analysis route sends it to the Python analyzer, which combines model classification, knowledge retrieval, market and competitor assessment, startup planning, and financial forecasting before returning results. Separate account signup/login and Google authentication are exposed through Express. The README gives no further capability detail; domain internals beyond the shown analyzer dependencies are represented at subsystem level where their exact call paths were not sampled.

Main entry points: [`frontend/app`](https://github.com/chandrashekhar235/foundrai/tree/main/frontend/app) (FoundrAI web app), [`ai/services/analyzer.py`](https://github.com/chandrashekhar235/foundrai/blob/main/ai/services/analyzer.py) (Startup analyzer), [`frontend/components/auth`](https://github.com/chandrashekhar235/foundrai/tree/main/frontend/components/auth) (Login and signup UI), [`backend/express/src/controllers/auth.controller.ts`](https://github.com/chandrashekhar235/foundrai/blob/main/backend/express/src/controllers/auth.controller.ts) (Auth controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Web experience"]
  node_web["FoundrAI web app"]
  node_analysisui["Startup analysis UI<br/>[page.tsx]"]
  node_authui["Login and signup UI"]
  node_authcontext["Auth state<br/>[AuthContext.tsx]"]
  node_workflow["Workflow display<br/>[Workflow.tsx]"]
  node_workflowdata["Workflow steps<br/>[WorkflowData.tsx]"]
  node_features["Feature pages<br/>[page.tsx]"]
  node_pricing["Pricing pages<br/>[Pricing.tsx]"]
  node_about["About pages"]
end

subgraph group_api["Backend API"]
  node_express["Express server<br/>[server.ts]"]
  node_analyzeroute["Analysis route<br/>[analyze.routes.ts]"]
  node_authroutes["Auth routes<br/>[auth.routes.ts]"]
  node_authcontroller["Auth controller<br/>[auth.controller.ts]"]
  node_userstore[("User database<br/>[prisma.ts]")]
end

subgraph group_analysis["AI analysis"]
  node_pythonapi["Python analysis entry<br/>[main.py]"]
  node_analyzer["Startup analyzer<br/>[analyzer.py]"]
  node_classifier["Startup classifier<br/>[train_model.py]"]
  node_retriever["Knowledge retrieval<br/>[retriever.py]"]
  node_knowledge["Knowledge base<br/>[knowledge_base.py]"]
  node_forecast["Financial forecast"]
  node_planning["Startup planning<br/>[startup_plan.py]"]
  node_dataset["Dataset preparation<br/>[prepare_dataset.py]"]
end

node_founder(("Startup founder"))
node_google["Google identity"]

node_founder -->|"browses"| node_web
node_web -->|"opens analysis"| node_analysisui
node_web -->|"renders"| node_workflow
node_workflow -->|"renders steps"| node_workflowdata
node_founder -->|"enters idea"| node_analysisui
node_analysisui -.->|"submits analysis"| node_analyzeroute
node_express -->|"mounts route"| node_analyzeroute
node_express -->|"mounts route"| node_authroutes
node_analyzeroute -->|"spawns and sends input"| node_pythonapi
node_pythonapi -->|"runs analysis"| node_analyzer
node_analyzer -->|"retrieves insights"| node_retriever
node_analyzer -->|"reads market data"| node_knowledge
node_retriever -->|"loads knowledge"| node_knowledge
node_analyzer -->|"compares stages"| node_forecast
node_analyzer -.->|"loads model"| node_classifier
node_analyzer -.->|"derives planning insights"| node_planning
node_dataset -.->|"prepares training data"| node_classifier
node_authroutes -->|"dispatches requests"| node_authcontroller
node_authcontroller -->|"reads and writes users"| node_userstore
node_authcontroller -->|"verifies credential"| node_google
node_founder -.->|"signs in"| node_authui
node_authui -.->|"submits credentials"| node_authroutes
node_authui -.->|"uses auth state"| node_authcontext
node_web -->|"links features"| node_features
node_web -->|"links pricing"| node_pricing
node_web -->|"links about"| node_about

click node_web "https://github.com/chandrashekhar235/foundrai/tree/main/frontend/app"
click node_analysisui "https://github.com/chandrashekhar235/foundrai/blob/main/frontend/app/analyze/page.tsx"
click node_authui "https://github.com/chandrashekhar235/foundrai/tree/main/frontend/components/auth"
click node_authcontext "https://github.com/chandrashekhar235/foundrai/blob/main/frontend/context/AuthContext.tsx"
click node_workflow "https://github.com/chandrashekhar235/foundrai/blob/main/frontend/components/Workflow/Workflow.tsx"
click node_workflowdata "https://github.com/chandrashekhar235/foundrai/blob/main/frontend/components/Workflow/WorkflowData.tsx"
click node_features "https://github.com/chandrashekhar235/foundrai/blob/main/frontend/app/features/page.tsx"
click node_pricing "https://github.com/chandrashekhar235/foundrai/blob/main/frontend/components/pricing/Pricing.tsx"
click node_about "https://github.com/chandrashekhar235/foundrai/tree/main/frontend/components/about"
click node_express "https://github.com/chandrashekhar235/foundrai/blob/main/backend/express/src/server.ts"
click node_analyzeroute "https://github.com/chandrashekhar235/foundrai/blob/main/backend/express/src/routes/analyze.routes.ts"
click node_authroutes "https://github.com/chandrashekhar235/foundrai/blob/main/backend/express/src/routes/auth.routes.ts"
click node_authcontroller "https://github.com/chandrashekhar235/foundrai/blob/main/backend/express/src/controllers/auth.controller.ts"
click node_userstore "https://github.com/chandrashekhar235/foundrai/blob/main/backend/express/src/config/prisma.ts"
click node_pythonapi "https://github.com/chandrashekhar235/foundrai/blob/main/ai/main.py"
click node_analyzer "https://github.com/chandrashekhar235/foundrai/blob/main/ai/services/analyzer.py"
click node_classifier "https://github.com/chandrashekhar235/foundrai/blob/main/ai/models/train_model.py"
click node_retriever "https://github.com/chandrashekhar235/foundrai/blob/main/ai/services/retriever.py"
click node_knowledge "https://github.com/chandrashekhar235/foundrai/blob/main/ai/services/knowledge_base.py"
click node_forecast "https://github.com/chandrashekhar235/foundrai/blob/main/ai/services/financial_forecast.py"
click node_planning "https://github.com/chandrashekhar235/foundrai/blob/main/ai/services/startup_plan.py"
click node_dataset "https://github.com/chandrashekhar235/foundrai/blob/main/ai/prepare_dataset.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_web,node_analysisui,node_authui,node_authcontext,node_workflow,node_workflowdata,node_features,node_pricing,node_about toneBlue
class node_express,node_analyzeroute,node_authroutes,node_authcontroller,node_userstore toneAmber
class node_pythonapi,node_analyzer,node_classifier,node_retriever,node_knowledge,node_forecast,node_planning,node_dataset toneMint
class node_founder,node_google toneIndigo
```

## Components

### Web experience

- [FoundrAI web app](https://github.com/chandrashekhar235/foundrai/tree/main/frontend/app): `frontend/app`
- [Startup analysis UI](https://github.com/chandrashekhar235/foundrai/blob/main/frontend/app/analyze/page.tsx): `frontend/app/analyze/page.tsx`
- [Login and signup UI](https://github.com/chandrashekhar235/foundrai/tree/main/frontend/components/auth): `frontend/components/auth`
- [Auth state](https://github.com/chandrashekhar235/foundrai/blob/main/frontend/context/AuthContext.tsx): `frontend/context/AuthContext.tsx`
- [Workflow display](https://github.com/chandrashekhar235/foundrai/blob/main/frontend/components/Workflow/Workflow.tsx): `frontend/components/Workflow/Workflow.tsx`
- [Workflow steps](https://github.com/chandrashekhar235/foundrai/blob/main/frontend/components/Workflow/WorkflowData.tsx): `frontend/components/Workflow/WorkflowData.tsx`
- [Feature pages](https://github.com/chandrashekhar235/foundrai/blob/main/frontend/app/features/page.tsx): `frontend/app/features/page.tsx`
- [Pricing pages](https://github.com/chandrashekhar235/foundrai/blob/main/frontend/components/pricing/Pricing.tsx): `frontend/components/pricing/Pricing.tsx`
- [About pages](https://github.com/chandrashekhar235/foundrai/tree/main/frontend/components/about): `frontend/components/about`

### Backend API

- [Express server](https://github.com/chandrashekhar235/foundrai/blob/main/backend/express/src/server.ts): `backend/express/src/server.ts`
- [Analysis route](https://github.com/chandrashekhar235/foundrai/blob/main/backend/express/src/routes/analyze.routes.ts): `backend/express/src/routes/analyze.routes.ts`
- [Auth routes](https://github.com/chandrashekhar235/foundrai/blob/main/backend/express/src/routes/auth.routes.ts): `backend/express/src/routes/auth.routes.ts`
- [Auth controller](https://github.com/chandrashekhar235/foundrai/blob/main/backend/express/src/controllers/auth.controller.ts): `backend/express/src/controllers/auth.controller.ts`
- [User database](https://github.com/chandrashekhar235/foundrai/blob/main/backend/express/src/config/prisma.ts): `backend/express/src/config/prisma.ts`

### AI analysis

- [Python analysis entry](https://github.com/chandrashekhar235/foundrai/blob/main/ai/main.py): `ai/main.py`
- [Startup analyzer](https://github.com/chandrashekhar235/foundrai/blob/main/ai/services/analyzer.py): `ai/services/analyzer.py`
- [Startup classifier](https://github.com/chandrashekhar235/foundrai/blob/main/ai/models/train_model.py): `ai/models/train_model.py`
- [Knowledge retrieval](https://github.com/chandrashekhar235/foundrai/blob/main/ai/services/retriever.py): `ai/services/retriever.py`
- [Knowledge base](https://github.com/chandrashekhar235/foundrai/blob/main/ai/services/knowledge_base.py): `ai/services/knowledge_base.py`
- [Financial forecast](https://github.com/chandrashekhar235/foundrai/blob/main/ai/services/financial_forecast.py): `ai/services/financial_forecast.py`
- [Startup planning](https://github.com/chandrashekhar235/foundrai/blob/main/ai/services/startup_plan.py): `ai/services/startup_plan.py`
- [Dataset preparation](https://github.com/chandrashekhar235/foundrai/blob/main/ai/prepare_dataset.py): `ai/prepare_dataset.py`

### Other components

- **Startup founder**
- **Google identity**

## Connections

- Startup founder → FoundrAI web app: browses (evidence: `frontend/app/page.tsx`)
- FoundrAI web app → Startup analysis UI: opens analysis
- FoundrAI web app → Workflow display: renders (evidence: `frontend/app/page.tsx`)
- Workflow display → Workflow steps: renders steps (evidence: `frontend/components/Workflow/Workflow.tsx`)
- Startup founder → Startup analysis UI: enters idea (evidence: `frontend/app/analyze/page.tsx`)
- Startup analysis UI → Analysis route: submits analysis
- Express server → Analysis route: mounts route (evidence: `backend/express/src/server.ts`)
- Express server → Auth routes: mounts route (evidence: `backend/express/src/server.ts`)
- Analysis route → Python analysis entry: spawns and sends input (evidence: `backend/express/src/routes/analyze.routes.ts`)
- Python analysis entry → Startup analyzer: runs analysis (evidence: `ai/main.py`)
- Startup analyzer → Knowledge retrieval: retrieves insights (evidence: `ai/services/analyzer.py`)
- Startup analyzer → Knowledge base: reads market data (evidence: `ai/services/analyzer.py`)
- Knowledge retrieval → Knowledge base: loads knowledge (evidence: `ai/services/retriever.py`)
- Startup analyzer → Financial forecast: compares stages (evidence: `ai/services/analyzer.py`)
- Startup analyzer → Startup classifier: loads model
- Startup analyzer → Startup planning: derives planning insights (evidence: `ai/services/analyzer.py`)
- Dataset preparation → Startup classifier: prepares training data
- Auth routes → Auth controller: dispatches requests (evidence: `backend/express/src/routes/auth.routes.ts`)
- Auth controller → User database: reads and writes users (evidence: `backend/express/src/controllers/auth.controller.ts`)
- Auth controller → Google identity: verifies credential (evidence: `backend/express/src/controllers/auth.controller.ts`)
- Startup founder → Login and signup UI: signs in
- Login and signup UI → Auth routes: submits credentials
- Login and signup UI → Auth state: uses auth state
- FoundrAI web app → Feature pages: links features
- FoundrAI web app → Pricing pages: links pricing
- FoundrAI web app → About pages: links about
