# iamamritjha/lifeledger_frontend architecture

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

## Overview

LifeLedger is a healthcare web application with patient and doctor workspaces, authentication, medical records, care discovery, emergency information, and AI-related features. The principal patient workflow is to enter the authenticated workspace, review health information, then manage records or seek care; doctors have a separate workspace for appointments and practice details. Feature modules and API-client infrastructure form the internal layer. Relationships below are limited to README descriptions and SOURCE INDEX references; most feature internals and backend integrations were not sampled.

Main entry points: [`src/components/dashboard/dashboard-shell.tsx`](https://github.com/iamamritjha/lifeledger_frontend/blob/main/src/components/dashboard/dashboard-shell.tsx) (Patient workspace shell), [`src/features/auth/auth-context.tsx`](https://github.com/iamamritjha/lifeledger_frontend/blob/main/src/features/auth/auth-context.tsx) (Authentication), [`src/app/doctor/profile/page.tsx`](https://github.com/iamamritjha/lifeledger_frontend/blob/main/src/app/doctor/profile/page.tsx) (Doctor profile), [`src/app/(auth)/signin/page.tsx`](https://github.com/iamamritjha/lifeledger_frontend/blob/main/src/app/(auth)/signin/page.tsx) (Sign in and signup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and identity"]
  node_public_pages["Public pages<br/>[page.tsx]"]
  node_auth_pages["Sign in and signup<br/>[page.tsx]"]
  node_auth_context["Authentication<br/>[auth-context.tsx]"]
end

subgraph group_patient["Patient workspace"]
  node_patient_shell["Patient workspace shell"]
  node_patient_dashboard["Health dashboard<br/>[page.tsx]"]
end

subgraph group_care["Care and records"]
  node_appointments["Appointments<br/>[page.tsx]"]
  node_doctor_discovery["Doctor discovery"]
  node_hospitals["Hospital discovery<br/>[page.tsx]"]
  node_reports["Medical reports<br/>[page.tsx]"]
  node_timeline["Health timeline<br/>[page.tsx]"]
  node_ai["AI health features<br/>[ai-api.ts]"]
  node_emergency["Emergency contacts"]
  node_doctor_workspace["Doctor workspace<br/>[doctor-shell.tsx]"]
  node_doctor_appointments["Doctor appointments<br/>[page.tsx]"]
  node_doctor_profile["Doctor profile<br/>[page.tsx]"]
end

subgraph group_internal["Application internals"]
  node_feature_api["Feature APIs and hooks"]
  node_api_client["HTTP API client<br/>[api-client.ts]"]
  node_query_provider["Query provider<br/>[query-provider.tsx]"]
end

node_patient_actor(("Patient"))
node_doctor_actor(("Doctor"))

node_patient_actor -->|"signs in"| node_auth_pages
node_doctor_actor -->|"signs in"| node_auth_pages
node_auth_pages -.->|"authenticates"| node_auth_context
node_patient_actor -.->|"visits"| node_public_pages
node_patient_dashboard -.->|"uses shell"| node_patient_shell
node_patient_shell -->|"reads identity"| node_auth_context
node_appointments -->|"uses discovery"| node_doctor_discovery
node_hospitals -->|"uses shell"| node_patient_shell
node_reports -->|"uses AI feature"| node_ai
node_reports -->|"uses shell"| node_patient_shell
node_timeline -->|"uses shell"| node_patient_shell
node_emergency -->|"uses query hooks"| node_feature_api
node_doctor_appointments -->|"uses shell"| node_doctor_workspace
node_doctor_profile -->|"uses shell"| node_doctor_workspace
node_doctor_profile -->|"reads identity"| node_auth_context
node_doctor_profile -->|"uses doctor queries"| node_feature_api
node_auth_context -->|"calls API client"| node_api_client

click node_public_pages "https://github.com/iamamritjha/lifeledger_frontend/blob/main/src/app/page.tsx"
click node_auth_pages "https://github.com/iamamritjha/lifeledger_frontend/blob/main/src/app/(auth)/signin/page.tsx"
click node_auth_context "https://github.com/iamamritjha/lifeledger_frontend/blob/main/src/features/auth/auth-context.tsx"
click node_patient_shell "https://github.com/iamamritjha/lifeledger_frontend/blob/main/src/components/dashboard/dashboard-shell.tsx"
click node_patient_dashboard "https://github.com/iamamritjha/lifeledger_frontend/blob/main/src/app/(user)/dashboard/page.tsx"
click node_appointments "https://github.com/iamamritjha/lifeledger_frontend/blob/main/src/app/(user)/appointments/page.tsx"
click node_doctor_discovery "https://github.com/iamamritjha/lifeledger_frontend/blob/main/src/features/doctors/doctor-discovery-api.ts"
click node_hospitals "https://github.com/iamamritjha/lifeledger_frontend/blob/main/src/app/(user)/hospitals/page.tsx"
click node_reports "https://github.com/iamamritjha/lifeledger_frontend/blob/main/src/app/(user)/reports/%5BreportId%5D/page.tsx"
click node_timeline "https://github.com/iamamritjha/lifeledger_frontend/blob/main/src/app/(user)/timeline/page.tsx"
click node_ai "https://github.com/iamamritjha/lifeledger_frontend/blob/main/src/features/ai/ai-api.ts"
click node_emergency "https://github.com/iamamritjha/lifeledger_frontend/blob/main/src/features/emergency/components/EmergencyContactsManager.tsx"
click node_doctor_workspace "https://github.com/iamamritjha/lifeledger_frontend/blob/main/src/components/doctor/doctor-shell.tsx"
click node_doctor_appointments "https://github.com/iamamritjha/lifeledger_frontend/blob/main/src/app/doctor/appointments/page.tsx"
click node_doctor_profile "https://github.com/iamamritjha/lifeledger_frontend/blob/main/src/app/doctor/profile/page.tsx"
click node_feature_api "https://github.com/iamamritjha/lifeledger_frontend/tree/main/src/features"
click node_api_client "https://github.com/iamamritjha/lifeledger_frontend/blob/main/src/lib/api-client.ts"
click node_query_provider "https://github.com/iamamritjha/lifeledger_frontend/blob/main/src/providers/query-provider.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_public_pages,node_auth_pages,node_auth_context toneBlue
class node_patient_shell,node_patient_dashboard toneAmber
class node_appointments,node_doctor_discovery,node_hospitals,node_reports,node_timeline,node_ai,node_emergency,node_doctor_workspace,node_doctor_appointments,node_doctor_profile toneMint
class node_feature_api,node_api_client,node_query_provider toneRose
class node_patient_actor,node_doctor_actor toneIndigo
```

## Components

### Entry and identity

- [Public pages](https://github.com/iamamritjha/lifeledger_frontend/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Sign in and signup](https://github.com/iamamritjha/lifeledger_frontend/blob/main/src/app/(auth)/signin/page.tsx): `src/app/(auth)/signin/page.tsx`
- [Authentication](https://github.com/iamamritjha/lifeledger_frontend/blob/main/src/features/auth/auth-context.tsx): `src/features/auth/auth-context.tsx`

### Patient workspace

- [Patient workspace shell](https://github.com/iamamritjha/lifeledger_frontend/blob/main/src/components/dashboard/dashboard-shell.tsx): `src/components/dashboard/dashboard-shell.tsx`
- [Health dashboard](https://github.com/iamamritjha/lifeledger_frontend/blob/main/src/app/(user)/dashboard/page.tsx): `src/app/(user)/dashboard/page.tsx`

### Care and records

- [Appointments](https://github.com/iamamritjha/lifeledger_frontend/blob/main/src/app/(user)/appointments/page.tsx): `src/app/(user)/appointments/page.tsx`
- [Doctor discovery](https://github.com/iamamritjha/lifeledger_frontend/blob/main/src/features/doctors/doctor-discovery-api.ts): `src/features/doctors/doctor-discovery-api.ts`
- [Hospital discovery](https://github.com/iamamritjha/lifeledger_frontend/blob/main/src/app/(user)/hospitals/page.tsx): `src/app/(user)/hospitals/page.tsx`
- [Medical reports](https://github.com/iamamritjha/lifeledger_frontend/blob/main/src/app/(user)/reports/%5BreportId%5D/page.tsx): `src/app/(user)/reports/[reportId]/page.tsx`
- [Health timeline](https://github.com/iamamritjha/lifeledger_frontend/blob/main/src/app/(user)/timeline/page.tsx): `src/app/(user)/timeline/page.tsx`
- [AI health features](https://github.com/iamamritjha/lifeledger_frontend/blob/main/src/features/ai/ai-api.ts): `src/features/ai/ai-api.ts`
- [Emergency contacts](https://github.com/iamamritjha/lifeledger_frontend/blob/main/src/features/emergency/components/EmergencyContactsManager.tsx): `src/features/emergency/components/EmergencyContactsManager.tsx`
- [Doctor workspace](https://github.com/iamamritjha/lifeledger_frontend/blob/main/src/components/doctor/doctor-shell.tsx): `src/components/doctor/doctor-shell.tsx`
- [Doctor appointments](https://github.com/iamamritjha/lifeledger_frontend/blob/main/src/app/doctor/appointments/page.tsx): `src/app/doctor/appointments/page.tsx`
- [Doctor profile](https://github.com/iamamritjha/lifeledger_frontend/blob/main/src/app/doctor/profile/page.tsx): `src/app/doctor/profile/page.tsx`

### Application internals

- [Feature APIs and hooks](https://github.com/iamamritjha/lifeledger_frontend/tree/main/src/features): `src/features`
- [HTTP API client](https://github.com/iamamritjha/lifeledger_frontend/blob/main/src/lib/api-client.ts): `src/lib/api-client.ts`
- [Query provider](https://github.com/iamamritjha/lifeledger_frontend/blob/main/src/providers/query-provider.tsx): `src/providers/query-provider.tsx`

### Other components

- **Patient**
- **Doctor**

## Connections

- Patient → Sign in and signup: signs in (evidence: `README.md`)
- Doctor → Sign in and signup: signs in (evidence: `README.md`)
- Sign in and signup → Authentication: authenticates
- Patient → Public pages: visits
- Health dashboard → Patient workspace shell: uses shell
- Patient workspace shell → Authentication: reads identity (evidence: `src/components/dashboard/dashboard-shell.tsx`)
- Appointments → Doctor discovery: uses discovery (evidence: `src/app/(user)/appointments/page.tsx`)
- Hospital discovery → Patient workspace shell: uses shell (evidence: `src/app/(user)/hospitals/page.tsx`)
- Medical reports → AI health features: uses AI feature (evidence: `src/app/(user)/reports/[reportId]/page.tsx`)
- Medical reports → Patient workspace shell: uses shell (evidence: `src/app/(user)/reports/[reportId]/page.tsx`)
- Health timeline → Patient workspace shell: uses shell (evidence: `src/app/(user)/timeline/page.tsx`)
- Emergency contacts → Feature APIs and hooks: uses query hooks (evidence: `src/features/emergency/components/EmergencyContactsManager.tsx`)
- Doctor appointments → Doctor workspace: uses shell (evidence: `src/app/doctor/appointments/page.tsx`)
- Doctor profile → Doctor workspace: uses shell (evidence: `src/app/doctor/profile/page.tsx`)
- Doctor profile → Authentication: reads identity (evidence: `src/app/doctor/profile/page.tsx`)
- Doctor profile → Feature APIs and hooks: uses doctor queries (evidence: `src/app/doctor/profile/page.tsx`)
- Authentication → HTTP API client: calls API client (evidence: `src/features/auth/auth-context.tsx`)
