# sharvesh-g/ai-startup-builder architecture

> Architecture diagram of the GitHub repository sharvesh-g/ai-startup-builder, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sharvesh-g/ai-startup-builder
- Repository: https://github.com/sharvesh-g/ai-startup-builder

## Overview

#### Purpose and Entry Points
A React-based strategy analysis workspace for creating ventures/strategies, evaluating opportunities, modeling finances, compiling evidence, and exporting executive deliverables. Client startup is `src/main.tsx`, with top-level application composition in `src/App.tsx`; `server.ts` is the server-side entry point. The app is run locally through the Vite-based development flow indicated by `vite.config.ts`.

#### Application Shell and Navigation
The application shell coordinates the major workspaces and persistent navigation: `src/App.tsx`, `src/components/Sidebar.tsx`, and `src/components/Header.tsx`. View-level modules separate the product’s primary modes—home, dashboard, strategies, reports, history, settings, and exports—rather than exposing a single linear wizard. This makes the app a client-side operational console with workflow state shared at the application level.

#### Strategy Creation and Analysis Workflow
Venture/strategy input begins in onboarding and creation surfaces such as `src/components/NewStrategyWizard.tsx`, `src/components/StartupForm.tsx`, and `src/components/NewVentureModal.tsx`. Submitted business context feeds analysis-oriented views including `src/components/AnalysisProgressView.tsx` and `src/components/AgentSupervisorProgress.tsx`. The boundary is between user-provided assumptions/questions and generated or computed strategy artifacts.

#### Domain, Opportunity, and Quality Logic
Core business interpretation is concentrated in the library layer: `src/lib/domainEngine.ts`, `src/lib/opportunityModel.ts`, and `src/lib/qualityGate.ts`. These modules likely transform venture inputs into structured strategy assessments, opportunity scoring, and validation/readiness checks. Canonicalized strategy data in `src/lib/canonicalStrategy.ts` provides a stable internal representation for downstream views, reports, and exports.

#### Evidence, Agents, and AI Integration
Evidence and source traceability are represented by `src/lib/evidenceRegistry.ts` and displayed through `src/components/CitationsList.tsx`. Agent-oriented progress and user interaction are surfaced in `src/components/AgentsView.tsx` and `src/components/CopilotChatPanel.tsx`. The required `GEMINI_API_KEY` indicates Gemini is the material external AI service; `server.ts` is the likely trust boundary for API-backed operations, rather than exposing provider credentials directly from UI components.

#### Decision Views and Financial Outputs
Decision support is rendered as specialized presentation modules: `src/components/CompetitorMatrix.tsx`, `src/components/RiskMatrixView.tsx`, and `src/components/FinancialDashboard.tsx`. Financial calculations are isolated in `src/lib/financialEngine.ts`, separating computation from visualization. Additional views such as roadmap, personas, executive brief, and opportunity scorecards consume the strategy/analysis model to present distinct stakeholder-oriented outputs.

#### Persistence, History, and Export Boundary
Local strategy/history persistence is encapsulated by `src/lib/historyStorage.ts` and surfaced through `src/components/HistorySidebar.tsx` and `src/components/HistoryView.tsx`. Export is a separate finalization stage: `src/components/ExportCenterView.tsx`, `src/lib/pdfGenerator.ts`, and `src/lib/pptGenerator.ts` convert prepared report data into distributable formats. `src/lib/professionalReportData.ts` is the likely adapter that assembles canonical analysis into report-ready content.

Main entry points: [`src/lib/canonicalStrategy.ts`](https://github.com/sharvesh-g/ai-startup-builder/blob/main/src/lib/canonicalStrategy.ts) (Canonical strategy), [`src/App.tsx`](https://github.com/sharvesh-g/ai-startup-builder/blob/main/src/App.tsx) (Application shell), [`src/components/ExportCenterView.tsx`](https://github.com/sharvesh-g/ai-startup-builder/blob/main/src/components/ExportCenterView.tsx) (Export center), [`server.ts`](https://github.com/sharvesh-g/ai-startup-builder/blob/main/server.ts) (Server entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client workspace"]
  node_client_entry["Client entry<br/>React bootstrap<br/>[main.tsx]"]
  node_app_shell["Application shell<br/>workspace coordinator<br/>[App.tsx]"]
  node_navigation["Persistent navigation<br/>navigation UI<br/>[Sidebar.tsx]"]
  node_header["Workspace header<br/>navigation UI<br/>[Header.tsx]"]
  node_strategy_input["Strategy creation<br/>input workflow"]
  node_analysis_progress["Analysis progress<br/>workflow UI"]
  node_agent_workspace["Agents and copilot<br/>agent UI<br/>[AgentsView.tsx]"]
end

subgraph group_analysis["Strategy analysis"]
  node_canonical_strategy["Canonical strategy<br/>domain model"]
  node_domain_engine["Domain engine<br/>strategy interpretation<br/>[domainEngine.ts]"]
  node_opportunity_model["Opportunity model<br/>scoring logic"]
  node_quality_gate["Quality gate<br/>readiness validation<br/>[qualityGate.ts]"]
  node_evidence_registry[("Evidence registry<br/>source traceability")]
  node_financial_engine["Financial engine<br/>financial computation<br/>[financialEngine.ts]"]
  node_history_storage[("History storage<br/>local persistence<br/>[historyStorage.ts]")]
end

subgraph group_outputs["Decision outputs"]
  node_decision_views["Decision dashboards<br/>presentation views"]
  node_report_data["Report data adapter<br/>report assembly"]
  node_export_center["Export center<br/>export UI"]
  node_pdf_export["PDF generator<br/>document export<br/>[pdfGenerator.ts]"]
  node_ppt_export["PowerPoint generator<br/>slide export<br/>[pptGenerator.ts]"]
end

node_vite{{"Vite dev flow<br/>development runtime<br/>[vite.config.ts]"}}
node_server{{"Server entry<br/>AI trust boundary<br/>[server.ts]"}}
node_gemini(("Gemini<br/>external AI service"))

node_vite -->|"runs"| node_client_entry
node_client_entry -->|"mounts"| node_app_shell
node_app_shell -->|"renders"| node_navigation
node_app_shell -->|"renders"| node_header
node_app_shell -->|"opens"| node_strategy_input
node_strategy_input -->|"submits context"| node_domain_engine
node_domain_engine -->|"structures assessment"| node_opportunity_model
node_opportunity_model -->|"evaluates"| node_quality_gate
node_quality_gate -->|"validates"| node_canonical_strategy
node_canonical_strategy -->|"drives"| node_analysis_progress
node_canonical_strategy -->|"links evidence"| node_evidence_registry
node_canonical_strategy -->|"supplies assumptions"| node_financial_engine
node_canonical_strategy -->|"persists"| node_history_storage
node_canonical_strategy -->|"feeds"| node_decision_views
node_financial_engine -->|"provides metrics"| node_decision_views
node_canonical_strategy -->|"assembles"| node_report_data
node_evidence_registry -->|"includes citations"| node_report_data
node_report_data -->|"prepares"| node_export_center
node_export_center -->|"generates"| node_pdf_export
node_export_center -->|"generates"| node_ppt_export
node_agent_workspace -->|"requests AI work"| node_server
node_server -->|"uses API key"| node_gemini
node_server -.->|"returns sourced results"| node_evidence_registry

click node_vite "https://github.com/sharvesh-g/ai-startup-builder/blob/main/vite.config.ts"
click node_client_entry "https://github.com/sharvesh-g/ai-startup-builder/blob/main/src/main.tsx"
click node_app_shell "https://github.com/sharvesh-g/ai-startup-builder/blob/main/src/App.tsx"
click node_navigation "https://github.com/sharvesh-g/ai-startup-builder/blob/main/src/components/Sidebar.tsx"
click node_header "https://github.com/sharvesh-g/ai-startup-builder/blob/main/src/components/Header.tsx"
click node_strategy_input "https://github.com/sharvesh-g/ai-startup-builder/blob/main/src/components/NewStrategyWizard.tsx"
click node_analysis_progress "https://github.com/sharvesh-g/ai-startup-builder/blob/main/src/components/AnalysisProgressView.tsx"
click node_agent_workspace "https://github.com/sharvesh-g/ai-startup-builder/blob/main/src/components/AgentsView.tsx"
click node_canonical_strategy "https://github.com/sharvesh-g/ai-startup-builder/blob/main/src/lib/canonicalStrategy.ts"
click node_domain_engine "https://github.com/sharvesh-g/ai-startup-builder/blob/main/src/lib/domainEngine.ts"
click node_opportunity_model "https://github.com/sharvesh-g/ai-startup-builder/blob/main/src/lib/opportunityModel.ts"
click node_quality_gate "https://github.com/sharvesh-g/ai-startup-builder/blob/main/src/lib/qualityGate.ts"
click node_evidence_registry "https://github.com/sharvesh-g/ai-startup-builder/blob/main/src/lib/evidenceRegistry.ts"
click node_financial_engine "https://github.com/sharvesh-g/ai-startup-builder/blob/main/src/lib/financialEngine.ts"
click node_history_storage "https://github.com/sharvesh-g/ai-startup-builder/blob/main/src/lib/historyStorage.ts"
click node_decision_views "https://github.com/sharvesh-g/ai-startup-builder/blob/main/src/components/FinancialDashboard.tsx"
click node_report_data "https://github.com/sharvesh-g/ai-startup-builder/blob/main/src/lib/professionalReportData.ts"
click node_export_center "https://github.com/sharvesh-g/ai-startup-builder/blob/main/src/components/ExportCenterView.tsx"
click node_pdf_export "https://github.com/sharvesh-g/ai-startup-builder/blob/main/src/lib/pdfGenerator.ts"
click node_ppt_export "https://github.com/sharvesh-g/ai-startup-builder/blob/main/src/lib/pptGenerator.ts"
click node_server "https://github.com/sharvesh-g/ai-startup-builder/blob/main/server.ts"

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_client_entry,node_app_shell,node_navigation,node_header,node_strategy_input,node_analysis_progress,node_agent_workspace toneBlue
class node_canonical_strategy,node_domain_engine,node_opportunity_model,node_quality_gate,node_evidence_registry,node_financial_engine,node_history_storage toneAmber
class node_decision_views,node_report_data,node_export_center,node_pdf_export,node_ppt_export toneMint
class node_vite,node_server,node_gemini toneNeutral
```

## Components

### Client workspace

- [Client entry](https://github.com/sharvesh-g/ai-startup-builder/blob/main/src/main.tsx): React bootstrap · `src/main.tsx`
- [Application shell](https://github.com/sharvesh-g/ai-startup-builder/blob/main/src/App.tsx): workspace coordinator · Owns shared workflow state and primary views. · `src/App.tsx`
- [Persistent navigation](https://github.com/sharvesh-g/ai-startup-builder/blob/main/src/components/Sidebar.tsx): navigation UI · `src/components/Sidebar.tsx`
- [Workspace header](https://github.com/sharvesh-g/ai-startup-builder/blob/main/src/components/Header.tsx): navigation UI · `src/components/Header.tsx`
- [Strategy creation](https://github.com/sharvesh-g/ai-startup-builder/blob/main/src/components/NewStrategyWizard.tsx): input workflow · Captures venture context and assumptions. · `src/components/NewStrategyWizard.tsx`
- [Analysis progress](https://github.com/sharvesh-g/ai-startup-builder/blob/main/src/components/AnalysisProgressView.tsx): workflow UI · `src/components/AnalysisProgressView.tsx`
- [Agents and copilot](https://github.com/sharvesh-g/ai-startup-builder/blob/main/src/components/AgentsView.tsx): agent UI · `src/components/AgentsView.tsx`

### Strategy analysis

- [Canonical strategy](https://github.com/sharvesh-g/ai-startup-builder/blob/main/src/lib/canonicalStrategy.ts): domain model · Stable representation used by downstream consumers. · `src/lib/canonicalStrategy.ts`
- [Domain engine](https://github.com/sharvesh-g/ai-startup-builder/blob/main/src/lib/domainEngine.ts): strategy interpretation · `src/lib/domainEngine.ts`
- [Opportunity model](https://github.com/sharvesh-g/ai-startup-builder/blob/main/src/lib/opportunityModel.ts): scoring logic · `src/lib/opportunityModel.ts`
- [Quality gate](https://github.com/sharvesh-g/ai-startup-builder/blob/main/src/lib/qualityGate.ts): readiness validation · `src/lib/qualityGate.ts`
- [Evidence registry](https://github.com/sharvesh-g/ai-startup-builder/blob/main/src/lib/evidenceRegistry.ts): source traceability · `src/lib/evidenceRegistry.ts`
- [Financial engine](https://github.com/sharvesh-g/ai-startup-builder/blob/main/src/lib/financialEngine.ts): financial computation · `src/lib/financialEngine.ts`
- [History storage](https://github.com/sharvesh-g/ai-startup-builder/blob/main/src/lib/historyStorage.ts): local persistence · `src/lib/historyStorage.ts`

### Decision outputs

- [Decision dashboards](https://github.com/sharvesh-g/ai-startup-builder/blob/main/src/components/FinancialDashboard.tsx): presentation views · Competitor, risk, and financial decision views. · `src/components/FinancialDashboard.tsx`
- [Report data adapter](https://github.com/sharvesh-g/ai-startup-builder/blob/main/src/lib/professionalReportData.ts): report assembly · `src/lib/professionalReportData.ts`
- [Export center](https://github.com/sharvesh-g/ai-startup-builder/blob/main/src/components/ExportCenterView.tsx): export UI · `src/components/ExportCenterView.tsx`
- [PDF generator](https://github.com/sharvesh-g/ai-startup-builder/blob/main/src/lib/pdfGenerator.ts): document export · `src/lib/pdfGenerator.ts`
- [PowerPoint generator](https://github.com/sharvesh-g/ai-startup-builder/blob/main/src/lib/pptGenerator.ts): slide export · `src/lib/pptGenerator.ts`

### Other components

- [Vite dev flow](https://github.com/sharvesh-g/ai-startup-builder/blob/main/vite.config.ts): development runtime · `vite.config.ts`
- [Server entry](https://github.com/sharvesh-g/ai-startup-builder/blob/main/server.ts): AI trust boundary · Keeps Gemini API access outside the client. · `server.ts`
- **Gemini**: external AI service

## Connections

- Vite dev flow → Client entry: runs
- Client entry → Application shell: mounts
- Application shell → Persistent navigation: renders
- Application shell → Workspace header: renders
- Application shell → Strategy creation: opens
- Strategy creation → Domain engine: submits context
- Domain engine → Opportunity model: structures assessment
- Opportunity model → Quality gate: evaluates
- Quality gate → Canonical strategy: validates
- Canonical strategy → Analysis progress: drives
- Canonical strategy → Evidence registry: links evidence
- Canonical strategy → Financial engine: supplies assumptions
- Canonical strategy → History storage: persists
- Canonical strategy → Decision dashboards: feeds
- Financial engine → Decision dashboards: provides metrics
- Canonical strategy → Report data adapter: assembles
- Evidence registry → Report data adapter: includes citations
- Report data adapter → Export center: prepares
- Export center → PDF generator: generates
- Export center → PowerPoint generator: generates
- Agents and copilot → Server entry: requests AI work
- Server entry → Gemini: uses API key
- Server entry → Evidence registry: returns sourced results
