# pranjalkumar9430/udyogsetu architecture

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

- Interactive diagram: https://gitdiagram.com/pranjalkumar9430/udyogsetu
- Repository: https://github.com/pranjalkumar9430/udyogsetu

## Overview

UdyogSetu is a bilingual entrepreneur platform for discovering government schemes and business-growth support. Its main journey runs from account/profile setup through text or voice query, structured extraction, explainable scheme ranking, and saving or reviewing matches. Separate branches support readiness assessment, scheme browsing, mentors, notifications, and administrative oversight. The frontend routes user workflows and calls backend APIs; backend endpoints coordinate domain logic and persistence. Edges reflect README statements or shown imports/calls; some unsampled feature wiring is intentionally omitted.

Main entry points: [`backend/udyogsetu/models/db.py`](https://github.com/pranjalkumar9430/udyogsetu/blob/main/backend/udyogsetu/models/db.py) (Domain Records), [`backend/udyogsetu/api/query.py`](https://github.com/pranjalkumar9430/udyogsetu/blob/main/backend/udyogsetu/api/query.py) (Query Orchestration), [`frontend/src/services/api.ts`](https://github.com/pranjalkumar9430/udyogsetu/blob/main/frontend/src/services/api.ts) (API Client), [`backend/udyogsetu/main.py`](https://github.com/pranjalkumar9430/udyogsetu/blob/main/backend/udyogsetu/main.py) (FastAPI Application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Entrepreneur Experience"]
  node_app["App Router<br/>[App.tsx]"]
  node_query_ui["Query Hub<br/>[QueryPage.tsx]"]
  node_voice["Voice Input<br/>[VoiceRecorder.tsx]"]
  node_api_client["API Client<br/>[api.ts]"]
end

subgraph group_identity["Identity and Profiles"]
  node_auth_context["Auth State<br/>[AuthContext.tsx]"]
  node_auth_api["Authentication<br/>[router.py]"]
  node_profile_api["Business Profile<br/>[profile.py]"]
end

subgraph group_discovery["Scheme Discovery"]
  node_query_api["Query Orchestration<br/>[query.py]"]
  node_extractor["Bilingual Extractor<br/>[query_processor.py]"]
  node_ranker["Explainable Ranker"]
  node_scheme_api["Scheme Catalog<br/>[schemes.py]"]
  node_seed_schemes["Curated Schemes<br/>[seed_schemes.py]"]
  node_saved_api["Saved Schemes<br/>[saved.py]"]
end

subgraph group_growth["Readiness and Advisory"]
  node_readiness_ui["Readiness Workspace<br/>[ReadinessPage.tsx]"]
  node_readiness_api["Readiness Service<br/>[readinessApi.ts]"]
  node_readiness_endpoint["Readiness API<br/>[readiness.py]"]
  node_readiness_engine["Readiness Engine"]
  node_mentors_api["Mentor Directory<br/>[mentors.py]"]
end

subgraph group_platform["Backend Platform"]
  node_admin_api["Administration<br/>[admin.py]"]
  node_notifications_api["Notifications<br/>[notifications.py]"]
  node_auth_guard["JWT Authorization<br/>[dependencies.py]"]
  node_database[("Database Sessions<br/>[database.py]")]
  node_domain_models["Domain Records<br/>[db.py]"]
  node_app_server["FastAPI Application<br/>[main.py]"]
end

node_entrepreneur(("Entrepreneur"))

node_entrepreneur -->|"uses"| node_app
node_app -->|"provides state"| node_auth_context
node_app -->|"routes to"| node_query_ui
node_query_ui -->|"renders"| node_voice
node_query_ui -->|"submits query"| node_api_client
node_api_client -->|"calls endpoint"| node_query_api
node_query_api -->|"extracts fields"| node_extractor
node_query_api -->|"ranks schemes"| node_ranker
node_query_api -->|"reads and records"| node_domain_models
node_extractor -->|"passes parameters"| node_ranker
node_ranker -->|"returns matches"| node_query_api
node_entrepreneur -->|"registers or logs in"| node_auth_context
node_auth_context -->|"requests identity"| node_api_client
node_api_client -.->|"calls auth routes"| node_auth_api
node_auth_api -->|"creates user"| node_domain_models
node_auth_guard -->|"loads session"| node_database
node_auth_guard -->|"checks user"| node_domain_models
node_app_server -->|"registers routes"| node_auth_api
node_app_server -->|"registers routes"| node_query_api
node_app_server -->|"initializes storage"| node_database
node_database -->|"maps records"| node_domain_models
node_query_api -->|"requires user"| node_auth_guard
node_query_api -.->|"uses business profile"| node_profile_api
node_scheme_api -.->|"serves catalog"| node_domain_models
node_seed_schemes -.->|"seeds scheme data"| node_domain_models
node_saved_api -.->|"stores bookmarks"| node_domain_models
node_readiness_ui -->|"requests assessment"| node_readiness_api
node_readiness_api -.->|"calls service"| node_readiness_endpoint
node_readiness_endpoint -->|"evaluates readiness"| node_readiness_engine
node_readiness_endpoint -.->|"reads business data"| node_domain_models
node_mentors_api -->|"serves mentor data"| node_domain_models
node_admin_api -->|"manages platform records"| node_domain_models
node_notifications_api -->|"uses notification records"| node_domain_models
node_profile_api -.->|"persists profile"| node_domain_models

click node_app "https://github.com/pranjalkumar9430/udyogsetu/blob/main/frontend/src/App.tsx"
click node_query_ui "https://github.com/pranjalkumar9430/udyogsetu/blob/main/frontend/src/pages/QueryPage.tsx"
click node_voice "https://github.com/pranjalkumar9430/udyogsetu/blob/main/frontend/src/components/VoiceRecorder.tsx"
click node_api_client "https://github.com/pranjalkumar9430/udyogsetu/blob/main/frontend/src/services/api.ts"
click node_auth_context "https://github.com/pranjalkumar9430/udyogsetu/blob/main/frontend/src/context/AuthContext.tsx"
click node_auth_api "https://github.com/pranjalkumar9430/udyogsetu/blob/main/backend/udyogsetu/auth/router.py"
click node_profile_api "https://github.com/pranjalkumar9430/udyogsetu/blob/main/backend/udyogsetu/api/profile.py"
click node_query_api "https://github.com/pranjalkumar9430/udyogsetu/blob/main/backend/udyogsetu/api/query.py"
click node_extractor "https://github.com/pranjalkumar9430/udyogsetu/blob/main/backend/udyogsetu/core/query_processor.py"
click node_ranker "https://github.com/pranjalkumar9430/udyogsetu/blob/main/backend/udyogsetu/core/recommendation_engine.py"
click node_scheme_api "https://github.com/pranjalkumar9430/udyogsetu/blob/main/backend/udyogsetu/api/schemes.py"
click node_seed_schemes "https://github.com/pranjalkumar9430/udyogsetu/blob/main/backend/udyogsetu/data/seed_schemes.py"
click node_saved_api "https://github.com/pranjalkumar9430/udyogsetu/blob/main/backend/udyogsetu/api/saved.py"
click node_readiness_ui "https://github.com/pranjalkumar9430/udyogsetu/blob/main/frontend/src/pages/ReadinessPage.tsx"
click node_readiness_api "https://github.com/pranjalkumar9430/udyogsetu/blob/main/frontend/src/services/readinessApi.ts"
click node_readiness_endpoint "https://github.com/pranjalkumar9430/udyogsetu/blob/main/backend/udyogsetu/api/readiness.py"
click node_readiness_engine "https://github.com/pranjalkumar9430/udyogsetu/blob/main/backend/udyogsetu/core/readiness_engine.py"
click node_mentors_api "https://github.com/pranjalkumar9430/udyogsetu/blob/main/backend/udyogsetu/api/mentors.py"
click node_admin_api "https://github.com/pranjalkumar9430/udyogsetu/blob/main/backend/udyogsetu/api/admin.py"
click node_notifications_api "https://github.com/pranjalkumar9430/udyogsetu/blob/main/backend/udyogsetu/api/notifications.py"
click node_auth_guard "https://github.com/pranjalkumar9430/udyogsetu/blob/main/backend/udyogsetu/auth/dependencies.py"
click node_database "https://github.com/pranjalkumar9430/udyogsetu/blob/main/backend/udyogsetu/models/database.py"
click node_domain_models "https://github.com/pranjalkumar9430/udyogsetu/blob/main/backend/udyogsetu/models/db.py"
click node_app_server "https://github.com/pranjalkumar9430/udyogsetu/blob/main/backend/udyogsetu/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_app,node_query_ui,node_voice,node_api_client toneBlue
class node_auth_context,node_auth_api,node_profile_api toneAmber
class node_query_api,node_extractor,node_ranker,node_scheme_api,node_seed_schemes,node_saved_api toneMint
class node_readiness_ui,node_readiness_api,node_readiness_endpoint,node_readiness_engine,node_mentors_api toneRose
class node_admin_api,node_notifications_api,node_auth_guard,node_database,node_domain_models,node_app_server,node_entrepreneur toneIndigo
```

## Components

### Entrepreneur Experience

- [App Router](https://github.com/pranjalkumar9430/udyogsetu/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Query Hub](https://github.com/pranjalkumar9430/udyogsetu/blob/main/frontend/src/pages/QueryPage.tsx): `frontend/src/pages/QueryPage.tsx`
- [Voice Input](https://github.com/pranjalkumar9430/udyogsetu/blob/main/frontend/src/components/VoiceRecorder.tsx): `frontend/src/components/VoiceRecorder.tsx`
- [API Client](https://github.com/pranjalkumar9430/udyogsetu/blob/main/frontend/src/services/api.ts): `frontend/src/services/api.ts`

### Identity and Profiles

- [Auth State](https://github.com/pranjalkumar9430/udyogsetu/blob/main/frontend/src/context/AuthContext.tsx): `frontend/src/context/AuthContext.tsx`
- [Authentication](https://github.com/pranjalkumar9430/udyogsetu/blob/main/backend/udyogsetu/auth/router.py): `backend/udyogsetu/auth/router.py`
- [Business Profile](https://github.com/pranjalkumar9430/udyogsetu/blob/main/backend/udyogsetu/api/profile.py): `backend/udyogsetu/api/profile.py`

### Scheme Discovery

- [Query Orchestration](https://github.com/pranjalkumar9430/udyogsetu/blob/main/backend/udyogsetu/api/query.py): `backend/udyogsetu/api/query.py`
- [Bilingual Extractor](https://github.com/pranjalkumar9430/udyogsetu/blob/main/backend/udyogsetu/core/query_processor.py): `backend/udyogsetu/core/query_processor.py`
- [Explainable Ranker](https://github.com/pranjalkumar9430/udyogsetu/blob/main/backend/udyogsetu/core/recommendation_engine.py): `backend/udyogsetu/core/recommendation_engine.py`
- [Scheme Catalog](https://github.com/pranjalkumar9430/udyogsetu/blob/main/backend/udyogsetu/api/schemes.py): `backend/udyogsetu/api/schemes.py`
- [Curated Schemes](https://github.com/pranjalkumar9430/udyogsetu/blob/main/backend/udyogsetu/data/seed_schemes.py): `backend/udyogsetu/data/seed_schemes.py`
- [Saved Schemes](https://github.com/pranjalkumar9430/udyogsetu/blob/main/backend/udyogsetu/api/saved.py): `backend/udyogsetu/api/saved.py`

### Readiness and Advisory

- [Readiness Workspace](https://github.com/pranjalkumar9430/udyogsetu/blob/main/frontend/src/pages/ReadinessPage.tsx): `frontend/src/pages/ReadinessPage.tsx`
- [Readiness Service](https://github.com/pranjalkumar9430/udyogsetu/blob/main/frontend/src/services/readinessApi.ts): `frontend/src/services/readinessApi.ts`
- [Readiness API](https://github.com/pranjalkumar9430/udyogsetu/blob/main/backend/udyogsetu/api/readiness.py): `backend/udyogsetu/api/readiness.py`
- [Readiness Engine](https://github.com/pranjalkumar9430/udyogsetu/blob/main/backend/udyogsetu/core/readiness_engine.py): `backend/udyogsetu/core/readiness_engine.py`
- [Mentor Directory](https://github.com/pranjalkumar9430/udyogsetu/blob/main/backend/udyogsetu/api/mentors.py): `backend/udyogsetu/api/mentors.py`

### Backend Platform

- [Administration](https://github.com/pranjalkumar9430/udyogsetu/blob/main/backend/udyogsetu/api/admin.py): `backend/udyogsetu/api/admin.py`
- [Notifications](https://github.com/pranjalkumar9430/udyogsetu/blob/main/backend/udyogsetu/api/notifications.py): `backend/udyogsetu/api/notifications.py`
- [JWT Authorization](https://github.com/pranjalkumar9430/udyogsetu/blob/main/backend/udyogsetu/auth/dependencies.py): `backend/udyogsetu/auth/dependencies.py`
- [Database Sessions](https://github.com/pranjalkumar9430/udyogsetu/blob/main/backend/udyogsetu/models/database.py): `backend/udyogsetu/models/database.py`
- [Domain Records](https://github.com/pranjalkumar9430/udyogsetu/blob/main/backend/udyogsetu/models/db.py): `backend/udyogsetu/models/db.py`
- [FastAPI Application](https://github.com/pranjalkumar9430/udyogsetu/blob/main/backend/udyogsetu/main.py): `backend/udyogsetu/main.py`

### Other components

- **Entrepreneur**

## Connections

- Entrepreneur → App Router: uses (evidence: `README.md`)
- App Router → Auth State: provides state (evidence: `frontend/src/App.tsx`)
- App Router → Query Hub: routes to (evidence: `frontend/src/App.tsx`)
- Query Hub → Voice Input: renders (evidence: `frontend/src/pages/QueryPage.tsx`)
- Query Hub → API Client: submits query (evidence: `frontend/src/services/api.ts`)
- API Client → Query Orchestration: calls endpoint (evidence: `frontend/src/services/api.ts`)
- Query Orchestration → Bilingual Extractor: extracts fields (evidence: `backend/udyogsetu/api/query.py`)
- Query Orchestration → Explainable Ranker: ranks schemes (evidence: `backend/udyogsetu/api/query.py`)
- Query Orchestration → Domain Records: reads and records (evidence: `backend/udyogsetu/api/query.py`)
- Bilingual Extractor → Explainable Ranker: passes parameters (evidence: `README.md`)
- Explainable Ranker → Query Orchestration: returns matches (evidence: `README.md`)
- Entrepreneur → Auth State: registers or logs in (evidence: `README.md`)
- Auth State → API Client: requests identity (evidence: `frontend/src/context/AuthContext.tsx`)
- API Client → Authentication: calls auth routes
- Authentication → Domain Records: creates user (evidence: `backend/udyogsetu/auth/router.py`)
- JWT Authorization → Database Sessions: loads session (evidence: `backend/udyogsetu/auth/dependencies.py`)
- JWT Authorization → Domain Records: checks user (evidence: `backend/udyogsetu/auth/dependencies.py`)
- FastAPI Application → Authentication: registers routes (evidence: `backend/udyogsetu/main.py`)
- FastAPI Application → Query Orchestration: registers routes (evidence: `backend/udyogsetu/main.py`)
- FastAPI Application → Database Sessions: initializes storage (evidence: `backend/udyogsetu/main.py`)
- Database Sessions → Domain Records: maps records (evidence: `backend/udyogsetu/models/database.py`)
- Query Orchestration → JWT Authorization: requires user (evidence: `backend/udyogsetu/api/query.py`)
- Query Orchestration → Business Profile: uses business profile
- Scheme Catalog → Domain Records: serves catalog (evidence: `backend/udyogsetu/api/schemes.py`)
- Curated Schemes → Domain Records: seeds scheme data
- Saved Schemes → Domain Records: stores bookmarks
- Readiness Workspace → Readiness Service: requests assessment (evidence: `frontend/src/pages/ReadinessPage.tsx`)
- Readiness Service → Readiness API: calls service
- Readiness API → Readiness Engine: evaluates readiness (evidence: `backend/udyogsetu/api/readiness.py`)
- Readiness API → Domain Records: reads business data (evidence: `backend/udyogsetu/api/readiness.py`)
- Mentor Directory → Domain Records: serves mentor data (evidence: `backend/udyogsetu/api/mentors.py`)
- Administration → Domain Records: manages platform records (evidence: `backend/udyogsetu/api/admin.py`)
- Notifications → Domain Records: uses notification records (evidence: `backend/udyogsetu/api/notifications.py`)
- Business Profile → Domain Records: persists profile
