# tushardhokriya/claude-impact-lab architecture

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

- Interactive diagram: https://gitdiagram.com/tushardhokriya/claude-impact-lab
- Repository: https://github.com/tushardhokriya/claude-impact-lab

## Overview

Rastabaaz is a Mumbai road-accountability app: residents file photo-pinned road reports, while the public explores reports and synthetic municipal spending, repair outcomes, and contractor performance. Its main path runs from the report form through place search and report storage to map, place, and report views. A separate complaint-matching engine links complaints to issues and work orders; the assistant answers questions from that evidence, and ward and contractor pages present the rupee analysis. README documents the product branches; some unsampled report-submission wiring is left unverified.

Main entry points: [`src/lib/repo/context.ts`](https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/lib/repo/context.ts) (Repository selector), [`src/lib/assistant/service.ts`](https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/lib/assistant/service.ts) (Assistant service), [`src/lib/rupee/load.ts`](https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/lib/rupee/load.ts) (Rupee dataset and analysis), [`src/app/wards/[code]/page.tsx`](https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/app/wards/%5Bcode%5D/page.tsx) (Ward money trail)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_citizen["Citizen reports"]
  node_report_page["Report entry<br/>[page.tsx]"]
  node_report_form["Report form<br/>[ReportForm.tsx]"]
  node_report_review["Report review<br/>[ReportReview.tsx]"]
  node_place_search_api["Place search API<br/>[route.ts]"]
  node_places_search["Place search<br/>[places-search.ts]"]
end

subgraph group_public["Public records"]
  node_map_page["Report map<br/>[page.tsx]"]
  node_place_page["Place history<br/>[page.tsx]"]
  node_report_page_detail["Report detail<br/>[page.tsx]"]
  node_photo_route["Report photo<br/>[route.ts]"]
  node_place_preview["Place preview<br/>[PlacePreview.tsx]"]
end

subgraph group_rupee["Rupee accountability"]
  node_wards_page["Ward overview<br/>[page.tsx]"]
  node_ward_detail["Ward money trail<br/>[page.tsx]"]
  node_contractors_page["Contractor ranking<br/>[page.tsx]"]
  node_contractor_detail["Contractor scorecard<br/>[page.tsx]"]
  node_rupee_data["Rupee dataset and analysis<br/>[load.ts]"]
  node_ledger["Ledger and audit<br/>[ledger.ts]"]
  node_next_rupee["Next-rupee plan<br/>[next-rupee.ts]"]
  node_scorecards["Contractor scoring<br/>[index.ts]"]
end

subgraph group_intelligence["Complaint intelligence"]
  node_assistant_page["Assistant page<br/>[page.tsx]"]
  node_assistant_service["Assistant service<br/>[service.ts]"]
  node_matching_engine["Complaint matching<br/>[engine.ts]"]
  node_assistant_evidence["Evidence bundle<br/>[evidence.ts]"]
  node_claude["Claude tool answers<br/>[claude.ts]"]
end

subgraph group_platform["Repository and admin"]
  node_repo_context["Repository selector<br/>[context.ts]"]
  node_memory_repo[("Memory repository<br/>[memory.ts]")]
  node_dynamo_repo[("DynamoDB repository<br/>[dynamo.ts]")]
  node_admin_page["Report desk<br/>[page.tsx]"]
end

node_citizen(("Resident"))

node_citizen -->|"starts report"| node_report_page
node_report_page -->|"renders"| node_report_form
node_report_form -.->|"reviews answers"| node_report_review
node_report_form -.->|"searches places"| node_place_search_api
node_place_search_api -->|"searches"| node_places_search
node_map_page -->|"loads reports"| node_repo_context
node_place_page -.->|"loads place records"| node_repo_context
node_report_page_detail -.->|"loads report"| node_repo_context
node_photo_route -->|"reads photo"| node_repo_context
node_place_preview -->|"links to place"| node_place_page
node_place_preview -->|"links to report"| node_report_page_detail
node_repo_context -->|"selects"| node_memory_repo
node_repo_context -->|"selects"| node_dynamo_repo
node_admin_page -->|"loads catalog"| node_repo_context
node_wards_page -->|"reads rupee analysis"| node_rupee_data
node_ward_detail -->|"reads ward analysis"| node_rupee_data
node_ward_detail -->|"loads report counts"| node_repo_context
node_ward_detail -->|"shows spending plan"| node_next_rupee
node_contractors_page -.->|"shows ranking"| node_scorecards
node_contractor_detail -->|"loads scorecard"| node_scorecards
node_rupee_data -->|"feeds ledger"| node_ledger
node_assistant_page -.->|"submits question"| node_assistant_service
node_assistant_service -->|"uses complaint links"| node_matching_engine
node_assistant_service -->|"uses dataset"| node_rupee_data
node_assistant_service -->|"builds evidence"| node_assistant_evidence
node_assistant_service -->|"requests answer"| node_claude

click node_report_page "https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/app/page.tsx"
click node_report_form "https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/components/report/ReportForm.tsx"
click node_report_review "https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/components/report/ReportReview.tsx"
click node_place_search_api "https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/app/api/places/route.ts"
click node_places_search "https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/lib/places-search.ts"
click node_map_page "https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/app/map/page.tsx"
click node_place_page "https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/app/places/%5Bslug%5D/page.tsx"
click node_report_page_detail "https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/app/reports/%5Bid%5D/page.tsx"
click node_photo_route "https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/app/reports/%5Bid%5D/photo/route.ts"
click node_place_preview "https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/components/map/PlacePreview.tsx"
click node_repo_context "https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/lib/repo/context.ts"
click node_memory_repo "https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/lib/repo/memory.ts"
click node_dynamo_repo "https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/lib/repo/dynamo.ts"
click node_admin_page "https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/app/admin/page.tsx"
click node_wards_page "https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/app/wards/page.tsx"
click node_ward_detail "https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/app/wards/%5Bcode%5D/page.tsx"
click node_contractors_page "https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/app/contractors/page.tsx"
click node_contractor_detail "https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/app/contractors/%5Bid%5D/page.tsx"
click node_rupee_data "https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/lib/rupee/load.ts"
click node_ledger "https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/lib/rupee/ledger.ts"
click node_next_rupee "https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/lib/rupee/next-rupee.ts"
click node_scorecards "https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/lib/rupee/scorecard/index.ts"
click node_assistant_page "https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/app/assistant/page.tsx"
click node_assistant_service "https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/lib/assistant/service.ts"
click node_matching_engine "https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/lib/matching/engine.ts"
click node_assistant_evidence "https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/lib/assistant/evidence.ts"
click node_claude "https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/lib/assistant/claude.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_report_page,node_report_form,node_report_review,node_place_search_api,node_places_search toneBlue
class node_map_page,node_place_page,node_report_page_detail,node_photo_route,node_place_preview toneAmber
class node_wards_page,node_ward_detail,node_contractors_page,node_contractor_detail,node_rupee_data,node_ledger,node_next_rupee,node_scorecards toneMint
class node_assistant_page,node_assistant_service,node_matching_engine,node_assistant_evidence,node_claude toneRose
class node_repo_context,node_memory_repo,node_dynamo_repo,node_admin_page,node_citizen toneIndigo
```

## Components

### Citizen reports

- [Report entry](https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/app/page.tsx): `src/app/page.tsx`
- [Report form](https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/components/report/ReportForm.tsx): `src/components/report/ReportForm.tsx`
- [Report review](https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/components/report/ReportReview.tsx): `src/components/report/ReportReview.tsx`
- [Place search API](https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/app/api/places/route.ts): `src/app/api/places/route.ts`
- [Place search](https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/lib/places-search.ts): `src/lib/places-search.ts`

### Public records

- [Report map](https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/app/map/page.tsx): `src/app/map/page.tsx`
- [Place history](https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/app/places/%5Bslug%5D/page.tsx): `src/app/places/[slug]/page.tsx`
- [Report detail](https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/app/reports/%5Bid%5D/page.tsx): `src/app/reports/[id]/page.tsx`
- [Report photo](https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/app/reports/%5Bid%5D/photo/route.ts): `src/app/reports/[id]/photo/route.ts`
- [Place preview](https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/components/map/PlacePreview.tsx): `src/components/map/PlacePreview.tsx`

### Rupee accountability

- [Ward overview](https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/app/wards/page.tsx): `src/app/wards/page.tsx`
- [Ward money trail](https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/app/wards/%5Bcode%5D/page.tsx): `src/app/wards/[code]/page.tsx`
- [Contractor ranking](https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/app/contractors/page.tsx): `src/app/contractors/page.tsx`
- [Contractor scorecard](https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/app/contractors/%5Bid%5D/page.tsx): `src/app/contractors/[id]/page.tsx`
- [Rupee dataset and analysis](https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/lib/rupee/load.ts): `src/lib/rupee/load.ts`
- [Ledger and audit](https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/lib/rupee/ledger.ts): `src/lib/rupee/ledger.ts`
- [Next-rupee plan](https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/lib/rupee/next-rupee.ts): `src/lib/rupee/next-rupee.ts`
- [Contractor scoring](https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/lib/rupee/scorecard/index.ts): `src/lib/rupee/scorecard/index.ts`

### Complaint intelligence

- [Assistant page](https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/app/assistant/page.tsx): `src/app/assistant/page.tsx`
- [Assistant service](https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/lib/assistant/service.ts): `src/lib/assistant/service.ts`
- [Complaint matching](https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/lib/matching/engine.ts): `src/lib/matching/engine.ts`
- [Evidence bundle](https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/lib/assistant/evidence.ts): `src/lib/assistant/evidence.ts`
- [Claude tool answers](https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/lib/assistant/claude.ts): `src/lib/assistant/claude.ts`

### Repository and admin

- [Repository selector](https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/lib/repo/context.ts): `src/lib/repo/context.ts`
- [Memory repository](https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/lib/repo/memory.ts): `src/lib/repo/memory.ts`
- [DynamoDB repository](https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/lib/repo/dynamo.ts): `src/lib/repo/dynamo.ts`
- [Report desk](https://github.com/tushardhokriya/claude-impact-lab/blob/rasta-hisaab/src/app/admin/page.tsx): `src/app/admin/page.tsx`

### Other components

- **Resident**

## Connections

- Resident → Report entry: starts report (evidence: `README.md`)
- Report entry → Report form: renders (evidence: `src/app/page.tsx`)
- Report form → Report review: reviews answers
- Report form → Place search API: searches places
- Place search API → Place search: searches (evidence: `src/app/api/places/route.ts`)
- Report map → Repository selector: loads reports (evidence: `src/app/map/page.tsx`)
- Place history → Repository selector: loads place records
- Report detail → Repository selector: loads report
- Report photo → Repository selector: reads photo (evidence: `src/app/reports/[id]/photo/route.ts`)
- Place preview → Place history: links to place (evidence: `src/components/map/PlacePreview.tsx`)
- Place preview → Report detail: links to report (evidence: `src/components/map/PlacePreview.tsx`)
- Repository selector → Memory repository: selects (evidence: `src/lib/repo/context.ts`)
- Repository selector → DynamoDB repository: selects (evidence: `src/lib/repo/context.ts`)
- Report desk → Repository selector: loads catalog (evidence: `src/app/admin/page.tsx`)
- Ward overview → Rupee dataset and analysis: reads rupee analysis (evidence: `src/app/wards/page.tsx`)
- Ward money trail → Rupee dataset and analysis: reads ward analysis (evidence: `src/app/wards/[code]/page.tsx`)
- Ward money trail → Repository selector: loads report counts (evidence: `src/app/wards/[code]/page.tsx`)
- Ward money trail → Next-rupee plan: shows spending plan (evidence: `README.md`)
- Contractor ranking → Contractor scoring: shows ranking
- Contractor scorecard → Contractor scoring: loads scorecard (evidence: `src/app/contractors/[id]/page.tsx`)
- Rupee dataset and analysis → Ledger and audit: feeds ledger (evidence: `src/lib/rupee/index.ts`)
- Assistant page → Assistant service: submits question
- Assistant service → Complaint matching: uses complaint links (evidence: `src/lib/assistant/service.ts`)
- Assistant service → Rupee dataset and analysis: uses dataset (evidence: `src/lib/assistant/service.ts`)
- Assistant service → Evidence bundle: builds evidence (evidence: `src/lib/assistant/service.ts`)
- Assistant service → Claude tool answers: requests answer (evidence: `src/lib/assistant/service.ts`)
