# advait-0611/yojana-setu architecture

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

- Interactive diagram: https://gitdiagram.com/advait-0611/yojana-setu
- Repository: https://github.com/advait-0611/yojana-setu

## Overview

Yojana Setu is a prototype for helping entrepreneurs discover potentially relevant government schemes and prepare supporting materials. Applicants enter a profile through a guided questionnaire or voice input; the matching endpoint evaluates it against the local scheme dataset and returns explainable results. From results, applicants can pre-check documents with OCR or generate a preliminary, sector-adapted DPR. The README also describes scheme-specific document guidance. The UI implements several capabilities in one large page; edges reflect shown code or documented behavior, not assumed internal calls.

Main entry points: [`src/app/api/match/route.ts`](https://github.com/advait-0611/yojana-setu/blob/main/src/app/api/match/route.ts) (Matching Endpoint), [`src/app/page.tsx`](https://github.com/advait-0611/yojana-setu/blob/main/src/app/page.tsx) (Explainable Results), [`src/data/schemes.json`](https://github.com/advait-0611/yojana-setu/blob/main/src/data/schemes.json) (Scheme Dataset)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_intake["Profile Intake"]
  node_profile_ui["Profile Questionnaire<br/>[page.tsx]"]
  node_voice["Voice Input<br/>[page.tsx]"]
  node_match_request["Match Submission<br/>[page.tsx]"]
end

subgraph group_matching["Scheme Matching"]
  node_match_api["Matching Endpoint<br/>[route.ts]"]
  node_eligibility["Eligibility Checks<br/>[route.ts]"]
  node_schemes[("Scheme Dataset<br/>[schemes.json]")]
  node_results["Explainable Results<br/>[page.tsx]"]
end

subgraph group_support["Applicant Support"]
  node_document_guidance["Document Guidance<br/>[schemes.json]"]
  node_ocr["Document Pre-check<br/>[page.tsx]"]
  node_dpr["DPR Generator<br/>[page.tsx]"]
end

node_applicant(("Applicant"))
node_tesseract["Tesseract OCR"]
node_jspdf["PDF Generator"]

node_applicant -->|"enters profile"| node_profile_ui
node_applicant -->|"speaks profile"| node_voice
node_voice -->|"fills fields"| node_profile_ui
node_profile_ui -->|"submits profile"| node_match_request
node_match_request -->|"sends profile"| node_match_api
node_match_api -->|"evaluates profile"| node_eligibility
node_match_api -->|"loads schemes"| node_schemes
node_match_api -->|"returns matches"| node_results
node_results -->|"shows requirements"| node_document_guidance
node_results -->|"starts pre-check"| node_ocr
node_ocr -->|"extracts text"| node_tesseract
node_results -->|"generates report"| node_dpr
node_dpr -->|"creates PDF"| node_jspdf

click node_profile_ui "https://github.com/advait-0611/yojana-setu/blob/main/src/app/page.tsx"
click node_voice "https://github.com/advait-0611/yojana-setu/blob/main/src/app/page.tsx"
click node_match_request "https://github.com/advait-0611/yojana-setu/blob/main/src/app/page.tsx"
click node_match_api "https://github.com/advait-0611/yojana-setu/blob/main/src/app/api/match/route.ts"
click node_eligibility "https://github.com/advait-0611/yojana-setu/blob/main/src/app/api/match/route.ts"
click node_schemes "https://github.com/advait-0611/yojana-setu/blob/main/src/data/schemes.json"
click node_results "https://github.com/advait-0611/yojana-setu/blob/main/src/app/page.tsx"
click node_document_guidance "https://github.com/advait-0611/yojana-setu/blob/main/src/data/schemes.json"
click node_ocr "https://github.com/advait-0611/yojana-setu/blob/main/src/app/page.tsx"
click node_dpr "https://github.com/advait-0611/yojana-setu/blob/main/src/app/page.tsx"

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_profile_ui,node_voice,node_match_request toneBlue
class node_match_api,node_eligibility,node_schemes,node_results toneAmber
class node_document_guidance,node_ocr,node_dpr toneMint
class node_applicant,node_tesseract,node_jspdf toneIndigo
```

## Components

### Profile Intake

- [Profile Questionnaire](https://github.com/advait-0611/yojana-setu/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Voice Input](https://github.com/advait-0611/yojana-setu/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Match Submission](https://github.com/advait-0611/yojana-setu/blob/main/src/app/page.tsx): `src/app/page.tsx`

### Scheme Matching

- [Matching Endpoint](https://github.com/advait-0611/yojana-setu/blob/main/src/app/api/match/route.ts): `src/app/api/match/route.ts`
- [Eligibility Checks](https://github.com/advait-0611/yojana-setu/blob/main/src/app/api/match/route.ts): `src/app/api/match/route.ts`
- [Scheme Dataset](https://github.com/advait-0611/yojana-setu/blob/main/src/data/schemes.json): `src/data/schemes.json`
- [Explainable Results](https://github.com/advait-0611/yojana-setu/blob/main/src/app/page.tsx): `src/app/page.tsx`

### Applicant Support

- [Document Guidance](https://github.com/advait-0611/yojana-setu/blob/main/src/data/schemes.json): `src/data/schemes.json`
- [Document Pre-check](https://github.com/advait-0611/yojana-setu/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [DPR Generator](https://github.com/advait-0611/yojana-setu/blob/main/src/app/page.tsx): `src/app/page.tsx`

### Other components

- **Applicant**
- **Tesseract OCR**
- **PDF Generator**

## Connections

- Applicant → Profile Questionnaire: enters profile (evidence: `README.md`)
- Applicant → Voice Input: speaks profile (evidence: `README.md`)
- Voice Input → Profile Questionnaire: fills fields (evidence: `README.md`)
- Profile Questionnaire → Match Submission: submits profile (evidence: `README.md`)
- Match Submission → Matching Endpoint: sends profile (evidence: `README.md`)
- Matching Endpoint → Eligibility Checks: evaluates profile (evidence: `src/app/api/match/route.ts`)
- Matching Endpoint → Scheme Dataset: loads schemes (evidence: `src/app/api/match/route.ts`)
- Matching Endpoint → Explainable Results: returns matches (evidence: `README.md`)
- Explainable Results → Document Guidance: shows requirements (evidence: `README.md`)
- Explainable Results → Document Pre-check: starts pre-check (evidence: `README.md`)
- Document Pre-check → Tesseract OCR: extracts text (evidence: `src/app/page.tsx`)
- Explainable Results → DPR Generator: generates report (evidence: `src/app/page.tsx`)
- DPR Generator → PDF Generator: creates PDF (evidence: `src/app/page.tsx`)
