# hritik3706/fundmatch architecture

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

- Interactive diagram: https://gitdiagram.com/hritik3706/fundmatch
- Repository: https://github.com/hritik3706/fundmatch

## Overview

FundMatch turns founder-provided startup information into funding guidance: it builds a unified profile, discovers and scores relevant government schemes, explains eligibility and gaps, then provides an application roadmap. The frontend exposes onboarding, scheme discovery and detail views, plus an advisor chat. The graph combines README-described product stages with relationships visible in sampled backend source and the SOURCE INDEX; unsampled implementation details are not inferred.

Main entry points: [`backend/src/services/matching.service.ts`](https://github.com/hritik3706/fundmatch/blob/main/backend/src/services/matching.service.ts) (Scheme matching), [`backend/src/services/actionPlan.service.ts`](https://github.com/hritik3706/fundmatch/blob/main/backend/src/services/actionPlan.service.ts) (Action plan generation), [`backend/src/services/chat/advisor.service.ts`](https://github.com/hritik3706/fundmatch/blob/main/backend/src/services/chat/advisor.service.ts) (Advisor orchestration), [`backend/src/repositories/profile.repository.ts`](https://github.com/hritik3706/fundmatch/blob/main/backend/src/repositories/profile.repository.ts) (Profile repository)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_founder["Founder experience"]
  node_onboarding["Startup onboarding<br/>[page.tsx]"]
  node_discovery["Scheme discovery<br/>[page.tsx]"]
  node_scheme_detail["Scheme details<br/>[page.tsx]"]
  node_roadmap_view["Application roadmap<br/>[page.tsx]"]
  node_advisor_view["Advisor chat<br/>[page.tsx]"]
end

subgraph group_intelligence["Funding intelligence"]
  node_match_route["Match API route<br/>[matches.routes.ts]"]
  node_chat_route["Chat API route<br/>[chat.routes.ts]"]
  node_profile_builder["Unified profile<br/>[unifiedProfile.ts]"]
  node_matching["Scheme matching"]
  node_scoring["Match scoring<br/>[formula.ts]"]
  node_advisor["Advisor orchestration<br/>[advisor.service.ts]"]
end

subgraph group_guidance["Eligibility and guidance"]
  node_eligibility["Eligibility and gaps<br/>[gaps.ts]"]
  node_action_plan["Action plan generation"]
end

subgraph group_data["Data and integrations"]
  node_profile_store["Profile repository"]
  node_scheme_store["Scheme repository"]
  node_match_store["Match and plan repository"]
  node_database[("PostgreSQL<br/>[db.ts]")]
  node_website_reader["Website extraction<br/>[readStartupSite.ts]"]
  node_model_service["AI model service<br/>[claude.service.ts]"]
end

node_founder(("Founder"))
node_firecrawl["Firecrawl"]
node_model_provider["Gemini or Claude"]

node_founder -->|"provides startup info"| node_onboarding
node_onboarding -->|"builds profile"| node_profile_builder
node_profile_builder -->|"uses website details"| node_website_reader
node_website_reader -.->|"extracts website"| node_firecrawl
node_founder -->|"requests schemes"| node_discovery
node_discovery -.->|"requests analysis"| node_match_route
node_match_route -->|"analyzes profile"| node_matching
node_matching -->|"loads profile"| node_profile_store
node_matching -->|"unifies inputs"| node_profile_builder
node_matching -->|"reads startup site"| node_website_reader
node_matching -->|"loads schemes"| node_scheme_store
node_matching -->|"scores schemes"| node_scoring
node_matching -->|"reads and saves matches"| node_match_store
node_scoring -.->|"evaluates requirements"| node_eligibility
node_match_route -.->|"returns match detail"| node_scheme_detail
node_scheme_detail -->|"shows eligibility gaps"| node_eligibility
node_eligibility -->|"informs next steps"| node_action_plan
node_action_plan -->|"loads profile"| node_profile_store
node_action_plan -->|"loads scheme"| node_scheme_store
node_action_plan -->|"reads and saves plan"| node_match_store
node_action_plan -->|"generates plan"| node_model_service
node_roadmap_view -.->|"shows roadmap"| node_action_plan
node_founder -->|"asks funding questions"| node_advisor_view
node_advisor_view -.->|"sends message"| node_chat_route
node_chat_route -->|"handles turn"| node_advisor
node_advisor -->|"extracts and answers"| node_model_service
node_advisor -.->|"creates profile"| node_profile_store
node_advisor -->|"runs analysis"| node_matching
node_model_service -->|"sends prompt"| node_model_provider
node_profile_store -->|"queries profiles"| node_database
node_scheme_store -->|"queries schemes"| node_database
node_match_store -->|"stores matches and plans"| node_database

click node_onboarding "https://github.com/hritik3706/fundmatch/blob/main/frontend/src/app/onboarding/page.tsx"
click node_discovery "https://github.com/hritik3706/fundmatch/blob/main/frontend/src/app/schemes/page.tsx"
click node_scheme_detail "https://github.com/hritik3706/fundmatch/blob/main/frontend/src/app/schemes/%5Bid%5D/page.tsx"
click node_roadmap_view "https://github.com/hritik3706/fundmatch/blob/main/frontend/src/app/schemes/%5Bid%5D/roadmap/page.tsx"
click node_advisor_view "https://github.com/hritik3706/fundmatch/blob/main/frontend/src/app/advisor/page.tsx"
click node_match_route "https://github.com/hritik3706/fundmatch/blob/main/backend/src/routes/matches.routes.ts"
click node_chat_route "https://github.com/hritik3706/fundmatch/blob/main/backend/src/routes/chat.routes.ts"
click node_profile_builder "https://github.com/hritik3706/fundmatch/blob/main/backend/src/services/profile/unifiedProfile.ts"
click node_matching "https://github.com/hritik3706/fundmatch/blob/main/backend/src/services/matching.service.ts"
click node_scoring "https://github.com/hritik3706/fundmatch/blob/main/backend/src/services/scoring/formula.ts"
click node_advisor "https://github.com/hritik3706/fundmatch/blob/main/backend/src/services/chat/advisor.service.ts"
click node_eligibility "https://github.com/hritik3706/fundmatch/blob/main/backend/src/services/scoring/gaps.ts"
click node_action_plan "https://github.com/hritik3706/fundmatch/blob/main/backend/src/services/actionPlan.service.ts"
click node_profile_store "https://github.com/hritik3706/fundmatch/blob/main/backend/src/repositories/profile.repository.ts"
click node_scheme_store "https://github.com/hritik3706/fundmatch/blob/main/backend/src/repositories/scheme.repository.ts"
click node_match_store "https://github.com/hritik3706/fundmatch/blob/main/backend/src/repositories/match.repository.ts"
click node_database "https://github.com/hritik3706/fundmatch/blob/main/backend/src/config/db.ts"
click node_website_reader "https://github.com/hritik3706/fundmatch/blob/main/backend/src/services/website/readStartupSite.ts"
click node_model_service "https://github.com/hritik3706/fundmatch/blob/main/backend/src/services/claude.service.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_onboarding,node_discovery,node_scheme_detail,node_roadmap_view,node_advisor_view toneBlue
class node_match_route,node_chat_route,node_profile_builder,node_matching,node_scoring,node_advisor toneAmber
class node_eligibility,node_action_plan toneMint
class node_profile_store,node_scheme_store,node_match_store,node_database,node_website_reader,node_model_service toneRose
class node_founder,node_firecrawl,node_model_provider toneIndigo
```

## Components

### Founder experience

- [Startup onboarding](https://github.com/hritik3706/fundmatch/blob/main/frontend/src/app/onboarding/page.tsx): `frontend/src/app/onboarding/page.tsx`
- [Scheme discovery](https://github.com/hritik3706/fundmatch/blob/main/frontend/src/app/schemes/page.tsx): `frontend/src/app/schemes/page.tsx`
- [Scheme details](https://github.com/hritik3706/fundmatch/blob/main/frontend/src/app/schemes/%5Bid%5D/page.tsx): `frontend/src/app/schemes/[id]/page.tsx`
- [Application roadmap](https://github.com/hritik3706/fundmatch/blob/main/frontend/src/app/schemes/%5Bid%5D/roadmap/page.tsx): `frontend/src/app/schemes/[id]/roadmap/page.tsx`
- [Advisor chat](https://github.com/hritik3706/fundmatch/blob/main/frontend/src/app/advisor/page.tsx): `frontend/src/app/advisor/page.tsx`

### Funding intelligence

- [Match API route](https://github.com/hritik3706/fundmatch/blob/main/backend/src/routes/matches.routes.ts): `backend/src/routes/matches.routes.ts`
- [Chat API route](https://github.com/hritik3706/fundmatch/blob/main/backend/src/routes/chat.routes.ts): `backend/src/routes/chat.routes.ts`
- [Unified profile](https://github.com/hritik3706/fundmatch/blob/main/backend/src/services/profile/unifiedProfile.ts): `backend/src/services/profile/unifiedProfile.ts`
- [Scheme matching](https://github.com/hritik3706/fundmatch/blob/main/backend/src/services/matching.service.ts): `backend/src/services/matching.service.ts`
- [Match scoring](https://github.com/hritik3706/fundmatch/blob/main/backend/src/services/scoring/formula.ts): `backend/src/services/scoring/formula.ts`
- [Advisor orchestration](https://github.com/hritik3706/fundmatch/blob/main/backend/src/services/chat/advisor.service.ts): `backend/src/services/chat/advisor.service.ts`

### Eligibility and guidance

- [Eligibility and gaps](https://github.com/hritik3706/fundmatch/blob/main/backend/src/services/scoring/gaps.ts): `backend/src/services/scoring/gaps.ts`
- [Action plan generation](https://github.com/hritik3706/fundmatch/blob/main/backend/src/services/actionPlan.service.ts): `backend/src/services/actionPlan.service.ts`

### Data and integrations

- [Profile repository](https://github.com/hritik3706/fundmatch/blob/main/backend/src/repositories/profile.repository.ts): `backend/src/repositories/profile.repository.ts`
- [Scheme repository](https://github.com/hritik3706/fundmatch/blob/main/backend/src/repositories/scheme.repository.ts): `backend/src/repositories/scheme.repository.ts`
- [Match and plan repository](https://github.com/hritik3706/fundmatch/blob/main/backend/src/repositories/match.repository.ts): `backend/src/repositories/match.repository.ts`
- [PostgreSQL](https://github.com/hritik3706/fundmatch/blob/main/backend/src/config/db.ts): `backend/src/config/db.ts`
- [Website extraction](https://github.com/hritik3706/fundmatch/blob/main/backend/src/services/website/readStartupSite.ts): `backend/src/services/website/readStartupSite.ts`
- [AI model service](https://github.com/hritik3706/fundmatch/blob/main/backend/src/services/claude.service.ts): `backend/src/services/claude.service.ts`

### Other components

- **Founder**
- **Firecrawl**
- **Gemini or Claude**

## Connections

- Founder → Startup onboarding: provides startup info
- Startup onboarding → Unified profile: builds profile
- Unified profile → Website extraction: uses website details (evidence: `backend/src/services/profile/unifiedProfile.ts`)
- Website extraction → Firecrawl: extracts website
- Founder → Scheme discovery: requests schemes
- Scheme discovery → Match API route: requests analysis
- Match API route → Scheme matching: analyzes profile (evidence: `backend/src/routes/matches.routes.ts`)
- Scheme matching → Profile repository: loads profile (evidence: `backend/src/services/matching.service.ts`)
- Scheme matching → Unified profile: unifies inputs (evidence: `backend/src/services/matching.service.ts`)
- Scheme matching → Website extraction: reads startup site (evidence: `backend/src/services/matching.service.ts`)
- Scheme matching → Scheme repository: loads schemes (evidence: `backend/src/services/matching.service.ts`)
- Scheme matching → Match scoring: scores schemes (evidence: `backend/src/services/matching.service.ts`)
- Scheme matching → Match and plan repository: reads and saves matches (evidence: `backend/src/services/matching.service.ts`)
- Match scoring → Eligibility and gaps: evaluates requirements
- Match API route → Scheme details: returns match detail
- Scheme details → Eligibility and gaps: shows eligibility gaps
- Eligibility and gaps → Action plan generation: informs next steps (evidence: `backend/src/services/actionPlan.service.ts`)
- Action plan generation → Profile repository: loads profile (evidence: `backend/src/services/actionPlan.service.ts`)
- Action plan generation → Scheme repository: loads scheme (evidence: `backend/src/services/actionPlan.service.ts`)
- Action plan generation → Match and plan repository: reads and saves plan (evidence: `backend/src/services/actionPlan.service.ts`)
- Action plan generation → AI model service: generates plan (evidence: `backend/src/services/actionPlan.service.ts`)
- Application roadmap → Action plan generation: shows roadmap
- Founder → Advisor chat: asks funding questions
- Advisor chat → Chat API route: sends message
- Chat API route → Advisor orchestration: handles turn (evidence: `backend/src/routes/chat.routes.ts`)
- Advisor orchestration → AI model service: extracts and answers (evidence: `backend/src/services/chat/advisor.service.ts`)
- Advisor orchestration → Profile repository: creates profile (evidence: `backend/src/services/chat/advisor.service.ts`)
- Advisor orchestration → Scheme matching: runs analysis (evidence: `backend/src/services/chat/advisor.service.ts`)
- AI model service → Gemini or Claude: sends prompt (evidence: `backend/src/services/claude.service.ts`)
- Profile repository → PostgreSQL: queries profiles (evidence: `backend/src/repositories/profile.repository.ts`)
- Scheme repository → PostgreSQL: queries schemes (evidence: `backend/src/repositories/scheme.repository.ts`)
- Match and plan repository → PostgreSQL: stores matches and plans (evidence: `backend/src/repositories/match.repository.ts`)
