# arun-232007/gram-biz-ai architecture

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

- Interactive diagram: https://gitdiagram.com/arun-232007/gram-biz-ai
- Repository: https://github.com/arun-232007/gram-biz-ai

## Overview

SIH-PS-9 is a guided business and credit-readiness platform for entrepreneurs. Users move through business assessment and financial planning, then access matched loan schemes and supporting reports, guides, roadmaps, and monthly tracking. The repository contains duplicate frontend and backend trees; this map uses the fuller `frontend/` client and the documented `app/` API tree. The assessment route’s calls are visible, but most page-to-API and route-to-service wiring is unsampled, so those relationships are omitted or marked unverified.

Main entry points: [`frontend/src/App.jsx`](https://github.com/arun-232007/gram-biz-ai/blob/main/frontend/src/App.jsx) (Web workspace), [`app/main.py`](https://github.com/arun-232007/gram-biz-ai/blob/main/app/main.py) (FastAPI service), [`app/routes/assessment.py`](https://github.com/arun-232007/gram-biz-ai/blob/main/app/routes/assessment.py) (Assessment endpoint), [`frontend/src/pages/Assessment.jsx`](https://github.com/arun-232007/gram-biz-ai/blob/main/frontend/src/pages/Assessment.jsx) (Assessment)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Entrepreneur workspace"]
  node_workspace["Web workspace<br/>[App.jsx]"]
  node_assessment_ui["Assessment<br/>[Assessment.jsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.jsx]"]
  node_loan_ui["Loan schemes<br/>[LoanSchemes.jsx]"]
  node_reports_ui["Reports<br/>[Reports.jsx]"]
  node_business_plan["Business plan<br/>[BusinessPlan.jsx]"]
  node_business_guide["Business guide<br/>[BusinessGuide.jsx]"]
  node_marketing["Marketing plan<br/>[MarketingPlan.jsx]"]
  node_roadmap["Growth roadmap<br/>[Roadmap.jsx]"]
  node_tracker["Monthly tracker<br/>[MonthlyTracker.jsx]"]
end

subgraph group_api["API and assessment"]
  node_api["FastAPI service<br/>[main.py]"]
  node_assessment_route["Assessment endpoint<br/>[assessment.py]"]
  node_chat_route["Chat endpoint<br/>[chatbot.py]"]
  node_business_route["Business endpoint<br/>[business.py]"]
  node_financial_route["Financial endpoint<br/>[financial.py]"]
  node_monthly_route["Monthly endpoint<br/>[monthly_plan.py]"]
end

subgraph group_engines["Business analysis"]
  node_financial_engine["Financial calculation"]
  node_scheme_router["Scheme matching<br/>[scheme_router.py]"]
  node_report_service["Business report<br/>[report_service.py]"]
  node_market_service["Market insights<br/>[market_service.py]"]
  node_ai_service["AI service<br/>[ai_service.py]"]
end

subgraph group_support["Planning support"]
  node_monthly_service["Monthly planning"]
  node_cost_engine["Cost analysis<br/>[cost_engine.py]"]
  node_loan_engine["Loan calculations<br/>[loan_engine.py]"]
  node_revenue_engine["Revenue estimates<br/>[revenue_engine.py]"]
  node_scenario_engine["Scenario analysis<br/>[scenario_engine.py]"]
  node_database[("Database<br/>[database.py]")]
end

node_entrepreneur(("Entrepreneur"))

node_entrepreneur -->|"uses"| node_workspace
node_workspace -->|"renders"| node_assessment_ui
node_workspace -->|"renders"| node_dashboard
node_workspace -->|"renders"| node_loan_ui
node_workspace -->|"renders"| node_reports_ui
node_workspace -->|"renders"| node_business_plan
node_workspace -->|"renders"| node_business_guide
node_workspace -->|"renders"| node_marketing
node_workspace -->|"renders"| node_roadmap
node_workspace -->|"renders"| node_tracker
node_api -->|"registers"| node_assessment_route
node_api -->|"registers"| node_chat_route
node_api -->|"registers"| node_business_route
node_api -->|"registers"| node_financial_route
node_api -->|"registers"| node_monthly_route
node_assessment_route -->|"calculates"| node_financial_engine
node_assessment_route -->|"matches scheme"| node_scheme_router
node_assessment_route -->|"builds report"| node_report_service
node_assessment_ui -.->|"submits assessment"| node_assessment_route
node_loan_ui -.->|"uses assessment results"| node_assessment_route
node_api -.->|"accesses"| node_database

click node_workspace "https://github.com/arun-232007/gram-biz-ai/blob/main/frontend/src/App.jsx"
click node_assessment_ui "https://github.com/arun-232007/gram-biz-ai/blob/main/frontend/src/pages/Assessment.jsx"
click node_dashboard "https://github.com/arun-232007/gram-biz-ai/blob/main/frontend/src/pages/Dashboard.jsx"
click node_loan_ui "https://github.com/arun-232007/gram-biz-ai/blob/main/frontend/src/pages/LoanSchemes.jsx"
click node_reports_ui "https://github.com/arun-232007/gram-biz-ai/blob/main/frontend/src/pages/Reports.jsx"
click node_business_plan "https://github.com/arun-232007/gram-biz-ai/blob/main/frontend/src/pages/BusinessPlan.jsx"
click node_business_guide "https://github.com/arun-232007/gram-biz-ai/blob/main/frontend/src/pages/BusinessGuide.jsx"
click node_marketing "https://github.com/arun-232007/gram-biz-ai/blob/main/frontend/src/pages/MarketingPlan.jsx"
click node_roadmap "https://github.com/arun-232007/gram-biz-ai/blob/main/frontend/src/pages/Roadmap.jsx"
click node_tracker "https://github.com/arun-232007/gram-biz-ai/blob/main/frontend/src/pages/MonthlyTracker.jsx"
click node_api "https://github.com/arun-232007/gram-biz-ai/blob/main/app/main.py"
click node_assessment_route "https://github.com/arun-232007/gram-biz-ai/blob/main/app/routes/assessment.py"
click node_chat_route "https://github.com/arun-232007/gram-biz-ai/blob/main/app/routes/chatbot.py"
click node_business_route "https://github.com/arun-232007/gram-biz-ai/blob/main/app/routes/business.py"
click node_financial_route "https://github.com/arun-232007/gram-biz-ai/blob/main/app/routes/financial.py"
click node_monthly_route "https://github.com/arun-232007/gram-biz-ai/blob/main/app/routes/monthly_plan.py"
click node_financial_engine "https://github.com/arun-232007/gram-biz-ai/blob/main/app/services/financial_engine.py"
click node_scheme_router "https://github.com/arun-232007/gram-biz-ai/blob/main/app/services/scheme_router.py"
click node_report_service "https://github.com/arun-232007/gram-biz-ai/blob/main/app/services/report_service.py"
click node_market_service "https://github.com/arun-232007/gram-biz-ai/blob/main/app/services/market_service.py"
click node_ai_service "https://github.com/arun-232007/gram-biz-ai/blob/main/app/services/ai_service.py"
click node_monthly_service "https://github.com/arun-232007/gram-biz-ai/blob/main/app/services/monthly_plan_service.py"
click node_cost_engine "https://github.com/arun-232007/gram-biz-ai/blob/main/backend/app/services/ai_engine/cost_engine.py"
click node_loan_engine "https://github.com/arun-232007/gram-biz-ai/blob/main/backend/app/services/ai_engine/loan_engine.py"
click node_revenue_engine "https://github.com/arun-232007/gram-biz-ai/blob/main/backend/app/services/ai_engine/revenue_engine.py"
click node_scenario_engine "https://github.com/arun-232007/gram-biz-ai/blob/main/backend/app/services/ai_engine/scenario_engine.py"
click node_database "https://github.com/arun-232007/gram-biz-ai/blob/main/app/database/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_workspace,node_assessment_ui,node_dashboard,node_loan_ui,node_reports_ui,node_business_plan,node_business_guide,node_marketing,node_roadmap,node_tracker toneBlue
class node_api,node_assessment_route,node_chat_route,node_business_route,node_financial_route,node_monthly_route toneAmber
class node_financial_engine,node_scheme_router,node_report_service,node_market_service,node_ai_service toneMint
class node_monthly_service,node_cost_engine,node_loan_engine,node_revenue_engine,node_scenario_engine,node_database toneRose
class node_entrepreneur toneIndigo
```

## Components

### Entrepreneur workspace

- [Web workspace](https://github.com/arun-232007/gram-biz-ai/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Assessment](https://github.com/arun-232007/gram-biz-ai/blob/main/frontend/src/pages/Assessment.jsx): `frontend/src/pages/Assessment.jsx`
- [Dashboard](https://github.com/arun-232007/gram-biz-ai/blob/main/frontend/src/pages/Dashboard.jsx): `frontend/src/pages/Dashboard.jsx`
- [Loan schemes](https://github.com/arun-232007/gram-biz-ai/blob/main/frontend/src/pages/LoanSchemes.jsx): `frontend/src/pages/LoanSchemes.jsx`
- [Reports](https://github.com/arun-232007/gram-biz-ai/blob/main/frontend/src/pages/Reports.jsx): `frontend/src/pages/Reports.jsx`
- [Business plan](https://github.com/arun-232007/gram-biz-ai/blob/main/frontend/src/pages/BusinessPlan.jsx): `frontend/src/pages/BusinessPlan.jsx`
- [Business guide](https://github.com/arun-232007/gram-biz-ai/blob/main/frontend/src/pages/BusinessGuide.jsx): `frontend/src/pages/BusinessGuide.jsx`
- [Marketing plan](https://github.com/arun-232007/gram-biz-ai/blob/main/frontend/src/pages/MarketingPlan.jsx): `frontend/src/pages/MarketingPlan.jsx`
- [Growth roadmap](https://github.com/arun-232007/gram-biz-ai/blob/main/frontend/src/pages/Roadmap.jsx): `frontend/src/pages/Roadmap.jsx`
- [Monthly tracker](https://github.com/arun-232007/gram-biz-ai/blob/main/frontend/src/pages/MonthlyTracker.jsx): `frontend/src/pages/MonthlyTracker.jsx`

### API and assessment

- [FastAPI service](https://github.com/arun-232007/gram-biz-ai/blob/main/app/main.py): `app/main.py`
- [Assessment endpoint](https://github.com/arun-232007/gram-biz-ai/blob/main/app/routes/assessment.py): `app/routes/assessment.py`
- [Chat endpoint](https://github.com/arun-232007/gram-biz-ai/blob/main/app/routes/chatbot.py): `app/routes/chatbot.py`
- [Business endpoint](https://github.com/arun-232007/gram-biz-ai/blob/main/app/routes/business.py): `app/routes/business.py`
- [Financial endpoint](https://github.com/arun-232007/gram-biz-ai/blob/main/app/routes/financial.py): `app/routes/financial.py`
- [Monthly endpoint](https://github.com/arun-232007/gram-biz-ai/blob/main/app/routes/monthly_plan.py): `app/routes/monthly_plan.py`

### Business analysis

- [Financial calculation](https://github.com/arun-232007/gram-biz-ai/blob/main/app/services/financial_engine.py): `app/services/financial_engine.py`
- [Scheme matching](https://github.com/arun-232007/gram-biz-ai/blob/main/app/services/scheme_router.py): `app/services/scheme_router.py`
- [Business report](https://github.com/arun-232007/gram-biz-ai/blob/main/app/services/report_service.py): `app/services/report_service.py`
- [Market insights](https://github.com/arun-232007/gram-biz-ai/blob/main/app/services/market_service.py): `app/services/market_service.py`
- [AI service](https://github.com/arun-232007/gram-biz-ai/blob/main/app/services/ai_service.py): `app/services/ai_service.py`

### Planning support

- [Monthly planning](https://github.com/arun-232007/gram-biz-ai/blob/main/app/services/monthly_plan_service.py): `app/services/monthly_plan_service.py`
- [Cost analysis](https://github.com/arun-232007/gram-biz-ai/blob/main/backend/app/services/ai_engine/cost_engine.py): `backend/app/services/ai_engine/cost_engine.py`
- [Loan calculations](https://github.com/arun-232007/gram-biz-ai/blob/main/backend/app/services/ai_engine/loan_engine.py): `backend/app/services/ai_engine/loan_engine.py`
- [Revenue estimates](https://github.com/arun-232007/gram-biz-ai/blob/main/backend/app/services/ai_engine/revenue_engine.py): `backend/app/services/ai_engine/revenue_engine.py`
- [Scenario analysis](https://github.com/arun-232007/gram-biz-ai/blob/main/backend/app/services/ai_engine/scenario_engine.py): `backend/app/services/ai_engine/scenario_engine.py`
- [Database](https://github.com/arun-232007/gram-biz-ai/blob/main/app/database/database.py): `app/database/database.py`

### Other components

- **Entrepreneur**

## Connections

- Entrepreneur → Web workspace: uses (evidence: `frontend/src/App.jsx`)
- Web workspace → Assessment: renders (evidence: `frontend/src/App.jsx`)
- Web workspace → Dashboard: renders (evidence: `frontend/src/App.jsx`)
- Web workspace → Loan schemes: renders (evidence: `frontend/src/App.jsx`)
- Web workspace → Reports: renders (evidence: `frontend/src/App.jsx`)
- Web workspace → Business plan: renders (evidence: `frontend/src/App.jsx`)
- Web workspace → Business guide: renders (evidence: `frontend/src/App.jsx`)
- Web workspace → Marketing plan: renders (evidence: `frontend/src/App.jsx`)
- Web workspace → Growth roadmap: renders (evidence: `frontend/src/App.jsx`)
- Web workspace → Monthly tracker: renders (evidence: `frontend/src/App.jsx`)
- FastAPI service → Assessment endpoint: registers (evidence: `app/main.py`)
- FastAPI service → Chat endpoint: registers (evidence: `app/main.py`)
- FastAPI service → Business endpoint: registers (evidence: `app/main.py`)
- FastAPI service → Financial endpoint: registers (evidence: `app/main.py`)
- FastAPI service → Monthly endpoint: registers (evidence: `app/main.py`)
- Assessment endpoint → Financial calculation: calculates (evidence: `app/routes/assessment.py`)
- Assessment endpoint → Scheme matching: matches scheme (evidence: `app/routes/assessment.py`)
- Assessment endpoint → Business report: builds report (evidence: `app/routes/assessment.py`)
- Assessment → Assessment endpoint: submits assessment
- Loan schemes → Assessment endpoint: uses assessment results
- FastAPI service → Database: accesses
