# shubhamshevkar2000-maker/lifepass_ai_repoforge architecture

> Architecture diagram of the GitHub repository shubhamshevkar2000-maker/lifepass_ai_repoforge, 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/shubhamshevkar2000-maker/lifepass_ai_repoforge
- Repository: https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge

## Overview

LifePass AI is a two-sided, consent-driven record and verification platform: citizens manage records and respond to institutions’ access requests, while institutions manage applications. The mobile app also guides citizens from a natural-language goal through requirements, record matching, and consent; the AI service provides document intelligence and task interpretation. The tree and excerpts support several client and AI call paths, but not most Edge Function internals or their database operations, so those connections are omitted. Major capabilities are represented without assuming unsampled wiring.

Main entry points: [`apps/mobile/App.tsx`](https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/apps/mobile/App.tsx) (Mobile app router), [`services/ai/app/main.py`](https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/services/ai/app/main.py) (AI API), [`apps/web/src/components/InstitutionDashboardFoundation.tsx`](https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/apps/web/src/components/InstitutionDashboardFoundation.tsx) (Institution workspace), [`apps/mobile/src/services/consentService.ts`](https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/apps/mobile/src/services/consentService.ts) (Consent service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_citizen["Citizen mobile"]
  node_mobile_app["Mobile app router<br/>[App.tsx]"]
  node_mobile_auth["Citizen authentication<br/>[AuthContext.tsx]"]
  node_citizen_records["Record vault"]
  node_record_upload["Record upload"]
  node_record_service["Record service<br/>[recordService.ts]"]
  node_goal_entry["Goal entry"]
  node_task_review["Task interpretation"]
  node_ai_client["AI requirement client"]
  node_matching_results["Matching results"]
  node_sharing_review["Sharing review"]
  node_consent_screen["Consent decision<br/>[ConsentScreen.tsx]"]
  node_consent_service["Consent service<br/>[consentService.ts]"]
  node_citizen_requests["Access requests<br/>[RequestsScreen.tsx]"]
end

subgraph group_institution["Institution portal"]
  node_web_app["Institution app<br/>[App.tsx]"]
  node_institution_auth["Institution authentication"]
  node_institution_dashboard["Institution workspace"]
  node_application_detail["Application review"]
  node_request_creation["Request creation"]
  node_institution_service["Institution service"]
end

subgraph group_ai["AI intelligence"]
  node_ai_api["AI API<br/>[main.py]"]
  node_document_pipeline["Document processing<br/>[pipeline.py]"]
  node_context_engine["Life-stage context engine<br/>[engine.py]"]
  node_llm_client["Groq client<br/>[llm_client.py]"]
  node_retrieval["Record retrieval"]
  node_explanation["Readiness explanation<br/>[explanation.py]"]
  node_ai_schemas["AI contracts"]
end

subgraph group_backend["Backend functions"]
  node_supabase["Supabase services"]
  node_consent_function["Consent decision function<br/>[index.ts]"]
  node_request_functions["Request functions<br/>[index.ts]"]
  node_record_function["Record function<br/>[index.ts]"]
  node_matching_function["Matching function<br/>[index.ts]"]
end

subgraph group_shared["Shared contracts"]
  node_shared_contracts["Shared TypeScript contracts<br/>[index.ts]"]
end

node_citizen(("Citizen"))
node_institution_user(("Institution user"))

node_mobile_app -->|"uses"| node_mobile_auth
node_mobile_app -->|"routes to"| node_goal_entry
node_mobile_app -->|"routes to"| node_citizen_records
node_mobile_app -->|"routes to"| node_record_upload
node_mobile_app -->|"routes to"| node_task_review
node_goal_entry -->|"uses"| node_ai_client
node_task_review -->|"fetches requirements"| node_ai_client
node_citizen_records -->|"uses"| node_record_service
node_consent_screen -->|"uses"| node_consent_service
node_consent_service -->|"invokes"| node_consent_function
node_web_app -->|"provides"| node_institution_auth
node_web_app -->|"routes to"| node_institution_dashboard
node_institution_dashboard -.->|"workspace includes"| node_application_detail
node_institution_dashboard -.->|"workspace includes"| node_request_creation
node_institution_dashboard -.->|"uses"| node_institution_service
node_ai_api -->|"calls"| node_document_pipeline
node_ai_api -->|"calls"| node_context_engine
node_ai_api -->|"calls"| node_explanation
node_ai_api -->|"calls"| node_retrieval
node_context_engine -->|"uses"| node_llm_client
node_ai_api -->|"uses"| node_ai_schemas
node_mobile_auth -->|"uses"| node_shared_contracts
node_institution_auth -->|"uses"| node_shared_contracts
node_consent_service -->|"uses"| node_shared_contracts
node_citizen -.->|"uses"| node_mobile_app
node_institution_user -.->|"uses"| node_web_app

click node_mobile_app "https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/apps/mobile/App.tsx"
click node_mobile_auth "https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/apps/mobile/src/context/AuthContext.tsx"
click node_citizen_records "https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/apps/mobile/src/screens/MyRecordsScreen.tsx"
click node_record_upload "https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/apps/mobile/src/screens/UploadRecordScreen.tsx"
click node_record_service "https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/apps/mobile/src/services/recordService.ts"
click node_goal_entry "https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/apps/mobile/src/screens/AiTaskEntryScreen.tsx"
click node_task_review "https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/apps/mobile/src/screens/InterpretedTaskScreen.tsx"
click node_ai_client "https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/apps/mobile/src/services/aiRequirementService.ts"
click node_matching_results "https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/apps/mobile/src/screens/MatchingResultsScreen.tsx"
click node_sharing_review "https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/apps/mobile/src/screens/ReviewShareScreen.tsx"
click node_consent_screen "https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/apps/mobile/src/screens/ConsentScreen.tsx"
click node_consent_service "https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/apps/mobile/src/services/consentService.ts"
click node_citizen_requests "https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/apps/mobile/src/screens/RequestsScreen.tsx"
click node_web_app "https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/apps/web/src/App.tsx"
click node_institution_auth "https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/apps/web/src/context/InstitutionAuthContext.tsx"
click node_institution_dashboard "https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/apps/web/src/components/InstitutionDashboardFoundation.tsx"
click node_application_detail "https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/apps/web/src/components/ApplicationDetailWorkspace.tsx"
click node_request_creation "https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/apps/web/src/components/CreateRequestView.tsx"
click node_institution_service "https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/apps/web/src/services/institutionService.ts"
click node_ai_api "https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/services/ai/app/main.py"
click node_document_pipeline "https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/services/ai/app/document/pipeline.py"
click node_context_engine "https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/services/ai/app/context/engine.py"
click node_llm_client "https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/services/ai/app/context/llm_client.py"
click node_retrieval "https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/tree/main/services/ai/app/retrieval"
click node_explanation "https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/services/ai/app/context/explanation.py"
click node_ai_schemas "https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/tree/main/services/ai/app/schemas"
click node_supabase "https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/tree/main/supabase/functions"
click node_consent_function "https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/supabase/functions/consent_decision/index.ts"
click node_request_functions "https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/supabase/functions/requests/index.ts"
click node_record_function "https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/supabase/functions/records/index.ts"
click node_matching_function "https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/supabase/functions/matching_evaluate/index.ts"
click node_shared_contracts "https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/packages/shared/src/index.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_mobile_app,node_mobile_auth,node_citizen_records,node_record_upload,node_record_service,node_goal_entry,node_task_review,node_ai_client,node_matching_results,node_sharing_review,node_consent_screen,node_consent_service,node_citizen_requests,node_institution_user toneBlue
class node_web_app,node_institution_auth,node_institution_dashboard,node_application_detail,node_request_creation,node_institution_service toneAmber
class node_ai_api,node_document_pipeline,node_context_engine,node_llm_client,node_retrieval,node_explanation,node_ai_schemas toneMint
class node_supabase,node_consent_function,node_request_functions,node_record_function,node_matching_function toneRose
class node_shared_contracts,node_citizen toneIndigo
```

## Components

### Citizen mobile

- [Mobile app router](https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/apps/mobile/App.tsx): `apps/mobile/App.tsx`
- [Citizen authentication](https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/apps/mobile/src/context/AuthContext.tsx): `apps/mobile/src/context/AuthContext.tsx`
- [Record vault](https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/apps/mobile/src/screens/MyRecordsScreen.tsx): `apps/mobile/src/screens/MyRecordsScreen.tsx`
- [Record upload](https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/apps/mobile/src/screens/UploadRecordScreen.tsx): `apps/mobile/src/screens/UploadRecordScreen.tsx`
- [Record service](https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/apps/mobile/src/services/recordService.ts): `apps/mobile/src/services/recordService.ts`
- [Goal entry](https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/apps/mobile/src/screens/AiTaskEntryScreen.tsx): `apps/mobile/src/screens/AiTaskEntryScreen.tsx`
- [Task interpretation](https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/apps/mobile/src/screens/InterpretedTaskScreen.tsx): `apps/mobile/src/screens/InterpretedTaskScreen.tsx`
- [AI requirement client](https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/apps/mobile/src/services/aiRequirementService.ts): `apps/mobile/src/services/aiRequirementService.ts`
- [Matching results](https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/apps/mobile/src/screens/MatchingResultsScreen.tsx): `apps/mobile/src/screens/MatchingResultsScreen.tsx`
- [Sharing review](https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/apps/mobile/src/screens/ReviewShareScreen.tsx): `apps/mobile/src/screens/ReviewShareScreen.tsx`
- [Consent decision](https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/apps/mobile/src/screens/ConsentScreen.tsx): `apps/mobile/src/screens/ConsentScreen.tsx`
- [Consent service](https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/apps/mobile/src/services/consentService.ts): `apps/mobile/src/services/consentService.ts`
- [Access requests](https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/apps/mobile/src/screens/RequestsScreen.tsx): `apps/mobile/src/screens/RequestsScreen.tsx`

### Institution portal

- [Institution app](https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/apps/web/src/App.tsx): `apps/web/src/App.tsx`
- [Institution authentication](https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/apps/web/src/context/InstitutionAuthContext.tsx): `apps/web/src/context/InstitutionAuthContext.tsx`
- [Institution workspace](https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/apps/web/src/components/InstitutionDashboardFoundation.tsx): `apps/web/src/components/InstitutionDashboardFoundation.tsx`
- [Application review](https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/apps/web/src/components/ApplicationDetailWorkspace.tsx): `apps/web/src/components/ApplicationDetailWorkspace.tsx`
- [Request creation](https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/apps/web/src/components/CreateRequestView.tsx): `apps/web/src/components/CreateRequestView.tsx`
- [Institution service](https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/apps/web/src/services/institutionService.ts): `apps/web/src/services/institutionService.ts`

### AI intelligence

- [AI API](https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/services/ai/app/main.py): `services/ai/app/main.py`
- [Document processing](https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/services/ai/app/document/pipeline.py): `services/ai/app/document/pipeline.py`
- [Life-stage context engine](https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/services/ai/app/context/engine.py): `services/ai/app/context/engine.py`
- [Groq client](https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/services/ai/app/context/llm_client.py): `services/ai/app/context/llm_client.py`
- [Record retrieval](https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/tree/main/services/ai/app/retrieval): `services/ai/app/retrieval`
- [Readiness explanation](https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/services/ai/app/context/explanation.py): `services/ai/app/context/explanation.py`
- [AI contracts](https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/tree/main/services/ai/app/schemas): `services/ai/app/schemas`

### Backend functions

- [Supabase services](https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/tree/main/supabase/functions): `supabase/functions`
- [Consent decision function](https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/supabase/functions/consent_decision/index.ts): `supabase/functions/consent_decision/index.ts`
- [Request functions](https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/supabase/functions/requests/index.ts): `supabase/functions/requests/index.ts`
- [Record function](https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/supabase/functions/records/index.ts): `supabase/functions/records/index.ts`
- [Matching function](https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/supabase/functions/matching_evaluate/index.ts): `supabase/functions/matching_evaluate/index.ts`

### Shared contracts

- [Shared TypeScript contracts](https://github.com/shubhamshevkar2000-maker/lifepass_ai_repoforge/blob/main/packages/shared/src/index.ts): `packages/shared/src/index.ts`

### Other components

- **Citizen**
- **Institution user**

## Connections

- Mobile app router → Citizen authentication: uses (evidence: `apps/mobile/App.tsx`)
- Mobile app router → Goal entry: routes to (evidence: `apps/mobile/App.tsx`)
- Mobile app router → Record vault: routes to (evidence: `apps/mobile/App.tsx`)
- Mobile app router → Record upload: routes to (evidence: `apps/mobile/App.tsx`)
- Mobile app router → Task interpretation: routes to (evidence: `apps/mobile/App.tsx`)
- Goal entry → AI requirement client: uses (evidence: `apps/mobile/src/screens/AiTaskEntryScreen.tsx`)
- Task interpretation → AI requirement client: fetches requirements (evidence: `apps/mobile/src/screens/InterpretedTaskScreen.tsx`)
- Record vault → Record service: uses (evidence: `apps/mobile/src/services/recordService.ts`)
- Consent decision → Consent service: uses (evidence: `apps/mobile/src/screens/ConsentScreen.tsx`)
- Consent service → Consent decision function: invokes (evidence: `apps/mobile/src/services/consentService.ts`)
- Institution app → Institution authentication: provides (evidence: `apps/web/src/App.tsx`)
- Institution app → Institution workspace: routes to (evidence: `apps/web/src/App.tsx`)
- Institution workspace → Application review: workspace includes
- Institution workspace → Request creation: workspace includes
- Institution workspace → Institution service: uses
- AI API → Document processing: calls (evidence: `services/ai/app/main.py`)
- AI API → Life-stage context engine: calls (evidence: `services/ai/app/main.py`)
- AI API → Readiness explanation: calls (evidence: `services/ai/app/main.py`)
- AI API → Record retrieval: calls (evidence: `services/ai/app/main.py`)
- Life-stage context engine → Groq client: uses (evidence: `services/ai/app/context/engine.py`)
- AI API → AI contracts: uses (evidence: `services/ai/app/main.py`)
- Citizen authentication → Shared TypeScript contracts: uses (evidence: `apps/mobile/src/context/AuthContext.tsx`)
- Institution authentication → Shared TypeScript contracts: uses (evidence: `apps/web/src/context/InstitutionAuthContext.tsx`)
- Consent service → Shared TypeScript contracts: uses (evidence: `apps/mobile/src/services/consentService.ts`)
- Citizen → Mobile app router: uses
- Institution user → Institution app: uses
