# shreya0223/sahayak architecture

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

- Interactive diagram: https://gitdiagram.com/shreya0223/sahayak
- Repository: https://github.com/shreya0223/sahayak

## Overview

SahayaK is a role-based, AI-assisted agriculture and healthcare problem-to-solution ecosystem. Its principal journey runs from community problem reporting and analysis through discovery/team formation and project work, then expert and community validation to impact tracking. The README also describes knowledge sharing, blueprints, grants, voice support, and role-specific oversight. The in-browser Zustand store is the documented mock API and persisted state layer; Supabase is used for the optional email OTP handshake. Source excerpts are partial, so edges are limited to documented or indexed relationships.

Main entry points: [`src/data/store.ts`](https://github.com/shreya0223/sahayak/blob/main/src/data/store.ts) (Persisted mock API), [`src/App.tsx`](https://github.com/shreya0223/sahayak/blob/main/src/App.tsx) (Application routes), [`src/pages/Discover.tsx`](https://github.com/shreya0223/sahayak/blob/main/src/pages/Discover.tsx) (Discover problems), [`src/pages/ProjectWorkspace.tsx`](https://github.com/shreya0223/sahayak/blob/main/src/pages/ProjectWorkspace.tsx) (Project workspace)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_journey["Problem to impact"]
  node_problem_report["Report problem<br/>[ReportProblem.tsx]"]
  node_problem_analysis["AI analysis and matching<br/>[store.ts]"]
  node_discover["Discover problems<br/>[Discover.tsx]"]
  node_problem_detail["Problem detail<br/>[ProblemDetail.tsx]"]
  node_community_validation["Field testing and feedback"]
  node_impact["Impact measurement<br/>[Impact.tsx]"]
end

subgraph group_collaboration["Teams and knowledge"]
  node_workspace["Project workspace"]
  node_team_matching["Student matching"]
  node_knowledge["Knowledge Ground"]
  node_teams["Teams<br/>[Teams.tsx]"]
end

subgraph group_programs["Solution resources"]
  node_blueprints["Solution blueprints<br/>[Blueprints.tsx]"]
  node_program_catalog["Blueprint and grant data<br/>[programs.ts]"]
  node_grants["Grants<br/>[Grants.tsx]"]
  node_voice["Voice helpline<br/>[VoiceHelpline.tsx]"]
end

subgraph group_operations["Roles and oversight"]
  node_auth["Authentication and onboarding<br/>[Auth.tsx]"]
  node_onboarding["Onboarding<br/>[Onboarding.tsx]"]
  node_expert_review["Expert validation<br/>[ExpertConsole.tsx]"]
  node_admin["Administration and audit<br/>[AdminDashboard.tsx]"]
  node_community_dashboard["Community dashboard"]
  node_industry["Industry console"]
  node_profile["Profile<br/>[Profile.tsx]"]
  node_notifications["Notifications<br/>[Notifications.tsx]"]
  node_home["Home<br/>[Home.tsx]"]
end

subgraph group_platform["Application and state"]
  node_store["Persisted mock API<br/>[store.ts]"]
  node_seed["Demo dataset<br/>[seed.ts]"]
  node_domain_types["Domain model<br/>[types.ts]"]
  node_app_router["Application routes<br/>[App.tsx]"]
  node_supabase_auth["Supabase Auth<br/>[supabase.ts]"]
  node_i18n["Translations<br/>[i18n.ts]"]
  node_common_ui["Shared UI components<br/>[common.tsx]"]
end

node_citizen(("Community member"))
node_student(("Student"))
node_expert(("Domain expert"))
node_supabase_service["Supabase"]

node_citizen -->|"reports"| node_problem_report
node_problem_report -->|"submits problem"| node_store
node_store -->|"initializes from"| node_seed
node_store -->|"uses models"| node_domain_types
node_store -->|"analyzes and matches"| node_problem_analysis
node_student -->|"browses"| node_discover
node_discover -->|"reads problems"| node_store
node_discover -->|"opens"| node_problem_detail
node_problem_detail -->|"reads problem"| node_store
node_student -->|"seeks matches"| node_team_matching
node_team_matching -->|"creates project"| node_workspace
node_workspace -->|"updates tasks and files"| node_store
node_workspace -->|"requests validation"| node_expert_review
node_expert -->|"reviews solution"| node_expert_review
node_expert_review -->|"records review"| node_store
node_citizen -->|"tests solution"| node_community_validation
node_community_validation -->|"records feedback"| node_store
node_impact -->|"reads outcomes"| node_store
node_citizen -.->|"shares knowledge"| node_knowledge
node_knowledge -->|"reads and writes posts"| node_store
node_blueprints -->|"reads blueprints"| node_program_catalog
node_grants -->|"reads grants"| node_program_catalog
node_voice -->|"uses helpline data"| node_store
node_auth -->|"uses account state"| node_store
node_auth -->|"uses OTP client"| node_supabase_auth
node_supabase_auth -->|"verifies OTP"| node_supabase_service
node_student -.->|"sets up account"| node_onboarding
node_onboarding -->|"updates profile"| node_store
node_admin -->|"monitors pipeline"| node_store
node_community_dashboard -->|"reads community state"| node_store
node_industry -->|"reads project state"| node_store
node_profile -->|"reads profile"| node_store
node_notifications -->|"reads notifications"| node_store
node_home -->|"reads dashboard state"| node_store
node_app_router -->|"routes to"| node_auth
node_app_router -->|"routes to"| node_problem_report
node_app_router -->|"routes to"| node_discover
node_app_router -->|"routes to"| node_workspace
node_app_router -->|"uses translations"| node_i18n
node_i18n -->|"reads language"| node_store
node_app_router -->|"renders shared UI"| node_common_ui

click node_problem_report "https://github.com/shreya0223/sahayak/blob/main/src/pages/ReportProblem.tsx"
click node_problem_analysis "https://github.com/shreya0223/sahayak/blob/main/src/data/store.ts"
click node_discover "https://github.com/shreya0223/sahayak/blob/main/src/pages/Discover.tsx"
click node_problem_detail "https://github.com/shreya0223/sahayak/blob/main/src/pages/ProblemDetail.tsx"
click node_community_validation "https://github.com/shreya0223/sahayak/blob/main/src/pages/ProblemCommunityPage.tsx"
click node_impact "https://github.com/shreya0223/sahayak/blob/main/src/pages/Impact.tsx"
click node_workspace "https://github.com/shreya0223/sahayak/blob/main/src/pages/ProjectWorkspace.tsx"
click node_team_matching "https://github.com/shreya0223/sahayak/blob/main/src/pages/StudentDashboard.tsx"
click node_knowledge "https://github.com/shreya0223/sahayak/blob/main/src/pages/KnowledgeGround.tsx"
click node_teams "https://github.com/shreya0223/sahayak/blob/main/src/pages/Teams.tsx"
click node_blueprints "https://github.com/shreya0223/sahayak/blob/main/src/pages/Blueprints.tsx"
click node_program_catalog "https://github.com/shreya0223/sahayak/blob/main/src/data/programs.ts"
click node_grants "https://github.com/shreya0223/sahayak/blob/main/src/pages/Grants.tsx"
click node_voice "https://github.com/shreya0223/sahayak/blob/main/src/pages/VoiceHelpline.tsx"
click node_auth "https://github.com/shreya0223/sahayak/blob/main/src/pages/Auth.tsx"
click node_onboarding "https://github.com/shreya0223/sahayak/blob/main/src/pages/Onboarding.tsx"
click node_expert_review "https://github.com/shreya0223/sahayak/blob/main/src/pages/ExpertConsole.tsx"
click node_admin "https://github.com/shreya0223/sahayak/blob/main/src/pages/AdminDashboard.tsx"
click node_community_dashboard "https://github.com/shreya0223/sahayak/blob/main/src/pages/CommunityDashboard.tsx"
click node_industry "https://github.com/shreya0223/sahayak/blob/main/src/pages/IndustryConsole.tsx"
click node_profile "https://github.com/shreya0223/sahayak/blob/main/src/pages/Profile.tsx"
click node_notifications "https://github.com/shreya0223/sahayak/blob/main/src/pages/Notifications.tsx"
click node_home "https://github.com/shreya0223/sahayak/blob/main/src/pages/Home.tsx"
click node_store "https://github.com/shreya0223/sahayak/blob/main/src/data/store.ts"
click node_seed "https://github.com/shreya0223/sahayak/blob/main/src/data/seed.ts"
click node_domain_types "https://github.com/shreya0223/sahayak/blob/main/src/data/types.ts"
click node_app_router "https://github.com/shreya0223/sahayak/blob/main/src/App.tsx"
click node_supabase_auth "https://github.com/shreya0223/sahayak/blob/main/src/lib/supabase.ts"
click node_i18n "https://github.com/shreya0223/sahayak/blob/main/src/i18n.ts"
click node_common_ui "https://github.com/shreya0223/sahayak/blob/main/src/ui/common.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_problem_report,node_problem_analysis,node_discover,node_problem_detail,node_community_validation,node_impact toneBlue
class node_workspace,node_team_matching,node_knowledge,node_teams toneAmber
class node_blueprints,node_program_catalog,node_grants,node_voice toneMint
class node_auth,node_onboarding,node_expert_review,node_admin,node_community_dashboard,node_industry,node_profile,node_notifications,node_home toneRose
class node_store,node_seed,node_domain_types,node_app_router,node_supabase_auth,node_i18n,node_common_ui,node_citizen,node_student,node_expert,node_supabase_service toneIndigo
```

## Components

### Problem to impact

- [Report problem](https://github.com/shreya0223/sahayak/blob/main/src/pages/ReportProblem.tsx): `src/pages/ReportProblem.tsx`
- [AI analysis and matching](https://github.com/shreya0223/sahayak/blob/main/src/data/store.ts): `src/data/store.ts`
- [Discover problems](https://github.com/shreya0223/sahayak/blob/main/src/pages/Discover.tsx): `src/pages/Discover.tsx`
- [Problem detail](https://github.com/shreya0223/sahayak/blob/main/src/pages/ProblemDetail.tsx): `src/pages/ProblemDetail.tsx`
- [Field testing and feedback](https://github.com/shreya0223/sahayak/blob/main/src/pages/ProblemCommunityPage.tsx): `src/pages/ProblemCommunityPage.tsx`
- [Impact measurement](https://github.com/shreya0223/sahayak/blob/main/src/pages/Impact.tsx): `src/pages/Impact.tsx`

### Teams and knowledge

- [Project workspace](https://github.com/shreya0223/sahayak/blob/main/src/pages/ProjectWorkspace.tsx): `src/pages/ProjectWorkspace.tsx`
- [Student matching](https://github.com/shreya0223/sahayak/blob/main/src/pages/StudentDashboard.tsx): `src/pages/StudentDashboard.tsx`
- [Knowledge Ground](https://github.com/shreya0223/sahayak/blob/main/src/pages/KnowledgeGround.tsx): `src/pages/KnowledgeGround.tsx`
- [Teams](https://github.com/shreya0223/sahayak/blob/main/src/pages/Teams.tsx): `src/pages/Teams.tsx`

### Solution resources

- [Solution blueprints](https://github.com/shreya0223/sahayak/blob/main/src/pages/Blueprints.tsx): `src/pages/Blueprints.tsx`
- [Blueprint and grant data](https://github.com/shreya0223/sahayak/blob/main/src/data/programs.ts): `src/data/programs.ts`
- [Grants](https://github.com/shreya0223/sahayak/blob/main/src/pages/Grants.tsx): `src/pages/Grants.tsx`
- [Voice helpline](https://github.com/shreya0223/sahayak/blob/main/src/pages/VoiceHelpline.tsx): `src/pages/VoiceHelpline.tsx`

### Roles and oversight

- [Authentication and onboarding](https://github.com/shreya0223/sahayak/blob/main/src/pages/Auth.tsx): `src/pages/Auth.tsx`
- [Onboarding](https://github.com/shreya0223/sahayak/blob/main/src/pages/Onboarding.tsx): `src/pages/Onboarding.tsx`
- [Expert validation](https://github.com/shreya0223/sahayak/blob/main/src/pages/ExpertConsole.tsx): `src/pages/ExpertConsole.tsx`
- [Administration and audit](https://github.com/shreya0223/sahayak/blob/main/src/pages/AdminDashboard.tsx): `src/pages/AdminDashboard.tsx`
- [Community dashboard](https://github.com/shreya0223/sahayak/blob/main/src/pages/CommunityDashboard.tsx): `src/pages/CommunityDashboard.tsx`
- [Industry console](https://github.com/shreya0223/sahayak/blob/main/src/pages/IndustryConsole.tsx): `src/pages/IndustryConsole.tsx`
- [Profile](https://github.com/shreya0223/sahayak/blob/main/src/pages/Profile.tsx): `src/pages/Profile.tsx`
- [Notifications](https://github.com/shreya0223/sahayak/blob/main/src/pages/Notifications.tsx): `src/pages/Notifications.tsx`
- [Home](https://github.com/shreya0223/sahayak/blob/main/src/pages/Home.tsx): `src/pages/Home.tsx`

### Application and state

- [Persisted mock API](https://github.com/shreya0223/sahayak/blob/main/src/data/store.ts): `src/data/store.ts`
- [Demo dataset](https://github.com/shreya0223/sahayak/blob/main/src/data/seed.ts): `src/data/seed.ts`
- [Domain model](https://github.com/shreya0223/sahayak/blob/main/src/data/types.ts): `src/data/types.ts`
- [Application routes](https://github.com/shreya0223/sahayak/blob/main/src/App.tsx): `src/App.tsx`
- [Supabase Auth](https://github.com/shreya0223/sahayak/blob/main/src/lib/supabase.ts): `src/lib/supabase.ts`
- [Translations](https://github.com/shreya0223/sahayak/blob/main/src/i18n.ts): `src/i18n.ts`
- [Shared UI components](https://github.com/shreya0223/sahayak/blob/main/src/ui/common.tsx): `src/ui/common.tsx`

### Other components

- **Community member**
- **Student**
- **Domain expert**
- **Supabase**

## Connections

- Community member → Report problem: reports (evidence: `README.md`)
- Report problem → Persisted mock API: submits problem (evidence: `src/pages/ReportProblem.tsx`)
- Persisted mock API → Demo dataset: initializes from (evidence: `src/data/store.ts`)
- Persisted mock API → Domain model: uses models (evidence: `src/data/store.ts`)
- Persisted mock API → AI analysis and matching: analyzes and matches (evidence: `README.md`)
- Student → Discover problems: browses (evidence: `README.md`)
- Discover problems → Persisted mock API: reads problems (evidence: `src/pages/Discover.tsx`)
- Discover problems → Problem detail: opens (evidence: `src/pages/Discover.tsx`)
- Problem detail → Persisted mock API: reads problem (evidence: `src/pages/ProblemDetail.tsx`)
- Student → Student matching: seeks matches (evidence: `README.md`)
- Student matching → Project workspace: creates project (evidence: `README.md`)
- Project workspace → Persisted mock API: updates tasks and files (evidence: `src/pages/ProjectWorkspace.tsx`)
- Project workspace → Expert validation: requests validation (evidence: `README.md`)
- Domain expert → Expert validation: reviews solution (evidence: `README.md`)
- Expert validation → Persisted mock API: records review (evidence: `src/pages/ExpertConsole.tsx`)
- Community member → Field testing and feedback: tests solution (evidence: `README.md`)
- Field testing and feedback → Persisted mock API: records feedback (evidence: `src/pages/ProblemCommunityPage.tsx`)
- Impact measurement → Persisted mock API: reads outcomes (evidence: `src/pages/Impact.tsx`)
- Community member → Knowledge Ground: shares knowledge
- Knowledge Ground → Persisted mock API: reads and writes posts (evidence: `src/pages/KnowledgeGround.tsx`)
- Solution blueprints → Blueprint and grant data: reads blueprints (evidence: `src/pages/Blueprints.tsx`)
- Grants → Blueprint and grant data: reads grants (evidence: `src/pages/Grants.tsx`)
- Voice helpline → Persisted mock API: uses helpline data (evidence: `src/pages/VoiceHelpline.tsx`)
- Authentication and onboarding → Persisted mock API: uses account state (evidence: `src/pages/Auth.tsx`)
- Authentication and onboarding → Supabase Auth: uses OTP client (evidence: `src/pages/Auth.tsx`)
- Supabase Auth → Supabase: verifies OTP (evidence: `src/lib/supabase.ts`)
- Student → Onboarding: sets up account
- Onboarding → Persisted mock API: updates profile (evidence: `src/pages/Onboarding.tsx`)
- Administration and audit → Persisted mock API: monitors pipeline (evidence: `src/pages/AdminDashboard.tsx`)
- Community dashboard → Persisted mock API: reads community state (evidence: `src/pages/CommunityDashboard.tsx`)
- Industry console → Persisted mock API: reads project state (evidence: `src/pages/IndustryConsole.tsx`)
- Profile → Persisted mock API: reads profile (evidence: `src/pages/Profile.tsx`)
- Notifications → Persisted mock API: reads notifications (evidence: `src/pages/Notifications.tsx`)
- Home → Persisted mock API: reads dashboard state (evidence: `src/pages/Home.tsx`)
- Application routes → Authentication and onboarding: routes to (evidence: `src/App.tsx`)
- Application routes → Report problem: routes to (evidence: `src/App.tsx`)
- Application routes → Discover problems: routes to (evidence: `src/App.tsx`)
- Application routes → Project workspace: routes to (evidence: `src/App.tsx`)
- Application routes → Translations: uses translations (evidence: `src/App.tsx`)
- Translations → Persisted mock API: reads language (evidence: `src/i18n.ts`)
- Application routes → Shared UI components: renders shared UI (evidence: `src/App.tsx`)
