# nitheesh-git-project/claude architecture

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

- Interactive diagram: https://gitdiagram.com/nitheesh-git-project/claude
- Repository: https://github.com/nitheesh-git-project/claude

## Overview

MoveRestore is a physiotherapy practice web app serving patients, therapists, hospitals, and clinic administrators. A patient discovers services, books a virtual consultation or home visit, pays, and manages sessions; therapists handle scheduling and care, while hospitals submit referrals and admins oversee operations and finances. The graph preserves these documented product branches and the shared Supabase, Razorpay, and Google Calendar integrations. Source excerpts confirm selected booking, payment-webhook, and admin behaviors; other links reflect README descriptions, not inspection of every route.

Main entry points: [`src/app/api/admin`](https://github.com/nitheesh-git-project/claude/tree/staging/src/app/api/admin) (Admin operations), [`src/components/BookingWizard.tsx`](https://github.com/nitheesh-git-project/claude/blob/staging/src/components/BookingWizard.tsx) (Booking experience), [`src/app/api/appointments`](https://github.com/nitheesh-git-project/claude/tree/staging/src/app/api/appointments) (Appointment booking), [`src/app/api/razorpay/webhook/route.ts`](https://github.com/nitheesh-git-project/claude/blob/staging/src/app/api/razorpay/webhook/route.ts) (Payment webhook)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Public discovery"]
  node_public_site["Marketing site"]
  node_service_catalog["Service catalog<br/>[serviceOptions.ts]"]
end

subgraph group_care["Patient care"]
  node_booking_ui["Booking experience<br/>[BookingWizard.tsx]"]
  node_appointment_api["Appointment booking"]
  node_home_visit_api["Home visit booking"]
  node_patient_portal["Patient dashboard"]
  node_care_plan_api["Care plans"]
  node_payments["Payment processing"]
  node_payment_webhook["Payment webhook<br/>[route.ts]"]
end

subgraph group_operations["Care operations"]
  node_therapist_portal["Therapist dashboard"]
  node_session_ops["Session operations"]
  node_hospital_portal["Hospital dashboard"]
  node_referrals["Hospital referrals"]
end

subgraph group_administration["Clinic administration"]
  node_admin_portal["Admin dashboard"]
  node_admin_api["Admin operations"]
end

subgraph group_platform["Shared platform"]
  node_razorpay["Razorpay"]
  node_calendar_sync["Calendar and Meet"]
  node_admin_guard["Admin access control<br/>[requireAdmin.ts]"]
  node_audit_log[("Admin activity log")]
  node_user_auth["User authentication<br/>[server.ts]"]
  node_supabase[("Supabase")]
end

node_visitor(("Patient or visitor"))

node_visitor -->|"explores services"| node_public_site
node_public_site -->|"presents services"| node_service_catalog
node_visitor -->|"starts booking"| node_booking_ui
node_booking_ui -->|"submits booking"| node_appointment_api
node_booking_ui -->|"books home visits"| node_home_visit_api
node_appointment_api -->|"creates payment order"| node_payments
node_home_visit_api -.->|"supports purchase"| node_payments
node_payments -->|"processes payment"| node_razorpay
node_razorpay -->|"sends payment events"| node_payment_webhook
node_payment_webhook -->|"creates session link"| node_calendar_sync
node_patient_portal -.->|"manages care plans"| node_care_plan_api
node_therapist_portal -->|"manages sessions"| node_session_ops
node_session_ops -.->|"syncs session links"| node_calendar_sync
node_hospital_portal -->|"submits referrals"| node_referrals
node_admin_portal -->|"manages clinic"| node_admin_api
node_admin_api -->|"checks admin scope"| node_admin_guard
node_admin_api -->|"records actions"| node_audit_log
node_appointment_api -->|"checks patient session"| node_user_auth
node_admin_guard -->|"reads signed-in user"| node_user_auth
node_user_auth -->|"authenticates users"| node_supabase
node_payment_webhook -->|"records payment"| node_supabase
node_admin_api -->|"updates clinic data"| node_supabase

click node_public_site "https://github.com/nitheesh-git-project/claude/tree/staging/src/app"
click node_service_catalog "https://github.com/nitheesh-git-project/claude/blob/staging/src/lib/serviceOptions.ts"
click node_booking_ui "https://github.com/nitheesh-git-project/claude/blob/staging/src/components/BookingWizard.tsx"
click node_appointment_api "https://github.com/nitheesh-git-project/claude/tree/staging/src/app/api/appointments"
click node_home_visit_api "https://github.com/nitheesh-git-project/claude/tree/staging/src/app/api/home-visit"
click node_patient_portal "https://github.com/nitheesh-git-project/claude/tree/staging/src/app/patient/dashboard"
click node_care_plan_api "https://github.com/nitheesh-git-project/claude/tree/staging/src/app/api/care-plan"
click node_payments "https://github.com/nitheesh-git-project/claude/tree/staging/src/app/api/razorpay"
click node_payment_webhook "https://github.com/nitheesh-git-project/claude/blob/staging/src/app/api/razorpay/webhook/route.ts"
click node_therapist_portal "https://github.com/nitheesh-git-project/claude/tree/staging/src/app/therapist/dashboard"
click node_session_ops "https://github.com/nitheesh-git-project/claude/tree/staging/src/app/api/appointments"
click node_calendar_sync "https://github.com/nitheesh-git-project/claude/blob/staging/src/lib/googleCalendarSync.ts"
click node_hospital_portal "https://github.com/nitheesh-git-project/claude/tree/staging/src/app/hospital/dashboard"
click node_referrals "https://github.com/nitheesh-git-project/claude/tree/staging/src/app/api/hospital"
click node_admin_portal "https://github.com/nitheesh-git-project/claude/tree/staging/src/app/admin/dashboard"
click node_admin_api "https://github.com/nitheesh-git-project/claude/tree/staging/src/app/api/admin"
click node_admin_guard "https://github.com/nitheesh-git-project/claude/blob/staging/src/lib/supabase/requireAdmin.ts"
click node_audit_log "https://github.com/nitheesh-git-project/claude/blob/staging/src/lib/adminActivityLog.ts"
click node_user_auth "https://github.com/nitheesh-git-project/claude/blob/staging/src/lib/supabase/server.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_public_site,node_service_catalog toneBlue
class node_booking_ui,node_appointment_api,node_home_visit_api,node_patient_portal,node_care_plan_api,node_payments,node_payment_webhook toneAmber
class node_therapist_portal,node_session_ops,node_hospital_portal,node_referrals toneMint
class node_admin_portal,node_admin_api toneRose
class node_razorpay,node_calendar_sync,node_admin_guard,node_audit_log,node_user_auth,node_supabase,node_visitor toneIndigo
```

## Components

### Public discovery

- [Marketing site](https://github.com/nitheesh-git-project/claude/tree/staging/src/app): `src/app`
- [Service catalog](https://github.com/nitheesh-git-project/claude/blob/staging/src/lib/serviceOptions.ts): `src/lib/serviceOptions.ts`

### Patient care

- [Booking experience](https://github.com/nitheesh-git-project/claude/blob/staging/src/components/BookingWizard.tsx): `src/components/BookingWizard.tsx`
- [Appointment booking](https://github.com/nitheesh-git-project/claude/tree/staging/src/app/api/appointments): `src/app/api/appointments`
- [Home visit booking](https://github.com/nitheesh-git-project/claude/tree/staging/src/app/api/home-visit): `src/app/api/home-visit`
- [Patient dashboard](https://github.com/nitheesh-git-project/claude/tree/staging/src/app/patient/dashboard): `src/app/patient/dashboard`
- [Care plans](https://github.com/nitheesh-git-project/claude/tree/staging/src/app/api/care-plan): `src/app/api/care-plan`
- [Payment processing](https://github.com/nitheesh-git-project/claude/tree/staging/src/app/api/razorpay): `src/app/api/razorpay`
- [Payment webhook](https://github.com/nitheesh-git-project/claude/blob/staging/src/app/api/razorpay/webhook/route.ts): `src/app/api/razorpay/webhook/route.ts`

### Care operations

- [Therapist dashboard](https://github.com/nitheesh-git-project/claude/tree/staging/src/app/therapist/dashboard): `src/app/therapist/dashboard`
- [Session operations](https://github.com/nitheesh-git-project/claude/tree/staging/src/app/api/appointments): `src/app/api/appointments`
- [Hospital dashboard](https://github.com/nitheesh-git-project/claude/tree/staging/src/app/hospital/dashboard): `src/app/hospital/dashboard`
- [Hospital referrals](https://github.com/nitheesh-git-project/claude/tree/staging/src/app/api/hospital): `src/app/api/hospital`

### Clinic administration

- [Admin dashboard](https://github.com/nitheesh-git-project/claude/tree/staging/src/app/admin/dashboard): `src/app/admin/dashboard`
- [Admin operations](https://github.com/nitheesh-git-project/claude/tree/staging/src/app/api/admin): `src/app/api/admin`

### Shared platform

- **Razorpay**
- [Calendar and Meet](https://github.com/nitheesh-git-project/claude/blob/staging/src/lib/googleCalendarSync.ts): `src/lib/googleCalendarSync.ts`
- [Admin access control](https://github.com/nitheesh-git-project/claude/blob/staging/src/lib/supabase/requireAdmin.ts): `src/lib/supabase/requireAdmin.ts`
- [Admin activity log](https://github.com/nitheesh-git-project/claude/blob/staging/src/lib/adminActivityLog.ts): `src/lib/adminActivityLog.ts`
- [User authentication](https://github.com/nitheesh-git-project/claude/blob/staging/src/lib/supabase/server.ts): `src/lib/supabase/server.ts`
- **Supabase**

### Other components

- **Patient or visitor**

## Connections

- Patient or visitor → Marketing site: explores services (evidence: `README.md`)
- Marketing site → Service catalog: presents services
- Patient or visitor → Booking experience: starts booking (evidence: `README.md`)
- Booking experience → Appointment booking: submits booking (evidence: `src/app/api/appointments/create/route.ts`)
- Booking experience → Home visit booking: books home visits (evidence: `README.md`)
- Appointment booking → Payment processing: creates payment order (evidence: `src/app/api/appointments/create/route.ts`)
- Home visit booking → Payment processing: supports purchase
- Payment processing → Razorpay: processes payment (evidence: `README.md`)
- Razorpay → Payment webhook: sends payment events (evidence: `src/app/api/razorpay/webhook/route.ts`)
- Payment webhook → Calendar and Meet: creates session link (evidence: `src/app/api/razorpay/webhook/route.ts`)
- Patient dashboard → Care plans: manages care plans
- Therapist dashboard → Session operations: manages sessions (evidence: `README.md`)
- Session operations → Calendar and Meet: syncs session links
- Hospital dashboard → Hospital referrals: submits referrals (evidence: `README.md`)
- Admin dashboard → Admin operations: manages clinic
- Admin operations → Admin access control: checks admin scope (evidence: `src/app/api/admin/update-setting/route.ts`)
- Admin operations → Admin activity log: records actions (evidence: `src/app/api/admin/update-setting/route.ts`)
- Appointment booking → User authentication: checks patient session (evidence: `src/app/api/appointments/create/route.ts`)
- Admin access control → User authentication: reads signed-in user (evidence: `src/lib/supabase/requireAdmin.ts`)
- User authentication → Supabase: authenticates users (evidence: `src/lib/supabase/server.ts`)
- Payment webhook → Supabase: records payment (evidence: `src/app/api/razorpay/webhook/route.ts`)
- Admin operations → Supabase: updates clinic data (evidence: `src/app/api/admin/update-setting/route.ts`)
