# kairu9k/nutrimatch architecture

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

- Interactive diagram: https://gitdiagram.com/kairu9k/nutrimatch
- Repository: https://github.com/kairu9k/nutrimatch

## Overview

NutriMatch is a web-based clinical nutrition consultation platform for clients, Registered Nutritionist-Dietitians (RNDs), and administrators. The principal client journey runs from account onboarding and pre-consultation screening through finding an RND, booking and paying, then consultation and ongoing nutrition care. RNDs deliver consultations, maintain Nutrition Care Process records, plan meals, and request labs; administrators handle verification, billing, payouts, and reporting. The README documents these capabilities, but the excerpts do not show most frontend-to-API wiring, so those relationships are documented rather than inferred from imports.

Main entry points: [`backend/scheduling`](https://github.com/kairu9k/nutrimatch/tree/main/backend/scheduling) (Booking and rescheduling), [`backend/scheduling/video_call.py`](https://github.com/kairu9k/nutrimatch/blob/main/backend/scheduling/video_call.py) (Video consultation), [`backend/profiles`](https://github.com/kairu9k/nutrimatch/tree/main/backend/profiles) (Find an RND), [`backend/scheduling/closing.py`](https://github.com/kairu9k/nutrimatch/blob/main/backend/scheduling/closing.py) (Attendance and closure)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client journey"]
  node_onboarding["Account onboarding"]
  node_screening["Pre-consult screening"]
  node_rnd_discovery["Find an RND"]
  node_booking["Booking and rescheduling"]
  node_profiles["RND profiles and availability"]
end

subgraph group_care["Clinical care"]
  node_consultation["Video consultation<br/>[video_call.py]"]
  node_consultation_closure["Attendance and closure<br/>[closing.py]"]
  node_ncp["NCP records and labs"]
  node_meal_planning["Meal plans and logs"]
  node_progress["Progress tracking"]
  node_relationships[("Client relationships<br/>[models.py]")]
end

subgraph group_platform["Platform services"]
  node_billing["Payments and refunds"]
  node_communication["Messages and reminders"]
end

subgraph group_admin["Administration"]
  node_admin_verification["RND verification"]
  node_admin_users["User administration"]
  node_admin_finance["Billing and payouts"]
  node_admin_reporting["Reports and audit"]
end

node_client_actor(("Client"))
node_rnd_actor(("RND"))
node_admin_actor(("Administrator"))

node_client_actor -->|"registers"| node_onboarding
node_client_actor -->|"completes screening"| node_screening
node_client_actor -->|"finds RND"| node_rnd_discovery
node_rnd_discovery -.->|"lists bookable profiles"| node_profiles
node_client_actor -->|"books consultation"| node_booking
node_booking -.->|"creates care relationship"| node_relationships
node_client_actor -->|"pays online"| node_billing
node_booking -.->|"schedules"| node_consultation
node_rnd_actor -->|"confirms bookings"| node_booking
node_client_actor -->|"joins consultation"| node_consultation
node_rnd_actor -->|"joins consultation"| node_consultation
node_consultation -->|"records attendance"| node_consultation_closure
node_consultation_closure -.->|"settles consultation"| node_billing
node_rnd_actor -->|"records care"| node_ncp
node_rnd_actor -->|"plans meals"| node_meal_planning
node_client_actor -->|"follows and logs"| node_meal_planning
node_client_actor -->|"tracks progress"| node_progress
node_client_actor -.->|"messages and receives reminders"| node_communication
node_rnd_actor -.->|"messages and sends reminders"| node_communication
node_admin_actor -->|"verifies licenses"| node_admin_verification
node_admin_actor -->|"manages users"| node_admin_users
node_admin_actor -->|"manages billing and payouts"| node_admin_finance
node_admin_actor -->|"reviews reports and audit log"| node_admin_reporting

click node_onboarding "https://github.com/kairu9k/nutrimatch/tree/main/backend/accounts"
click node_screening "https://github.com/kairu9k/nutrimatch/tree/main/backend/clinical"
click node_rnd_discovery "https://github.com/kairu9k/nutrimatch/tree/main/backend/profiles"
click node_booking "https://github.com/kairu9k/nutrimatch/tree/main/backend/scheduling"
click node_billing "https://github.com/kairu9k/nutrimatch/tree/main/backend/billing"
click node_consultation "https://github.com/kairu9k/nutrimatch/blob/main/backend/scheduling/video_call.py"
click node_consultation_closure "https://github.com/kairu9k/nutrimatch/blob/main/backend/scheduling/closing.py"
click node_ncp "https://github.com/kairu9k/nutrimatch/tree/main/backend/clinical"
click node_meal_planning "https://github.com/kairu9k/nutrimatch/tree/main/backend/nutrition"
click node_progress "https://github.com/kairu9k/nutrimatch/blob/main/frontend/app/components/ClientDashboard.vue"
click node_communication "https://github.com/kairu9k/nutrimatch/tree/main/backend/communication"
click node_relationships "https://github.com/kairu9k/nutrimatch/blob/main/backend/scheduling/models.py"
click node_profiles "https://github.com/kairu9k/nutrimatch/tree/main/backend/profiles"
click node_admin_verification "https://github.com/kairu9k/nutrimatch/tree/main/backend/accounts"
click node_admin_users "https://github.com/kairu9k/nutrimatch/tree/main/backend/accounts"
click node_admin_finance "https://github.com/kairu9k/nutrimatch/tree/main/backend/billing"
click node_admin_reporting "https://github.com/kairu9k/nutrimatch/tree/main/backend/core"

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_onboarding,node_screening,node_rnd_discovery,node_booking,node_profiles,node_client_actor toneBlue
class node_consultation,node_consultation_closure,node_ncp,node_meal_planning,node_progress,node_relationships toneAmber
class node_billing,node_communication toneMint
class node_admin_verification,node_admin_users,node_admin_finance,node_admin_reporting toneRose
class node_rnd_actor,node_admin_actor toneIndigo
```

## Components

### Client journey

- [Account onboarding](https://github.com/kairu9k/nutrimatch/tree/main/backend/accounts): `backend/accounts`
- [Pre-consult screening](https://github.com/kairu9k/nutrimatch/tree/main/backend/clinical): `backend/clinical`
- [Find an RND](https://github.com/kairu9k/nutrimatch/tree/main/backend/profiles): `backend/profiles`
- [Booking and rescheduling](https://github.com/kairu9k/nutrimatch/tree/main/backend/scheduling): `backend/scheduling`
- [RND profiles and availability](https://github.com/kairu9k/nutrimatch/tree/main/backend/profiles): `backend/profiles`

### Clinical care

- [Video consultation](https://github.com/kairu9k/nutrimatch/blob/main/backend/scheduling/video_call.py): `backend/scheduling/video_call.py`
- [Attendance and closure](https://github.com/kairu9k/nutrimatch/blob/main/backend/scheduling/closing.py): `backend/scheduling/closing.py`
- [NCP records and labs](https://github.com/kairu9k/nutrimatch/tree/main/backend/clinical): `backend/clinical`
- [Meal plans and logs](https://github.com/kairu9k/nutrimatch/tree/main/backend/nutrition): `backend/nutrition`
- [Progress tracking](https://github.com/kairu9k/nutrimatch/blob/main/frontend/app/components/ClientDashboard.vue): `frontend/app/components/ClientDashboard.vue`
- [Client relationships](https://github.com/kairu9k/nutrimatch/blob/main/backend/scheduling/models.py): `backend/scheduling/models.py`

### Platform services

- [Payments and refunds](https://github.com/kairu9k/nutrimatch/tree/main/backend/billing): `backend/billing`
- [Messages and reminders](https://github.com/kairu9k/nutrimatch/tree/main/backend/communication): `backend/communication`

### Administration

- [RND verification](https://github.com/kairu9k/nutrimatch/tree/main/backend/accounts): `backend/accounts`
- [User administration](https://github.com/kairu9k/nutrimatch/tree/main/backend/accounts): `backend/accounts`
- [Billing and payouts](https://github.com/kairu9k/nutrimatch/tree/main/backend/billing): `backend/billing`
- [Reports and audit](https://github.com/kairu9k/nutrimatch/tree/main/backend/core): `backend/core`

### Other components

- **Client**
- **RND**
- **Administrator**

## Connections

- Client → Account onboarding: registers
- Client → Pre-consult screening: completes screening
- Client → Find an RND: finds RND
- Find an RND → RND profiles and availability: lists bookable profiles
- Client → Booking and rescheduling: books consultation
- Booking and rescheduling → Client relationships: creates care relationship (evidence: `backend/scheduling/apps.py`)
- Client → Payments and refunds: pays online
- Booking and rescheduling → Video consultation: schedules (evidence: `backend/scheduling/closing.py`)
- RND → Booking and rescheduling: confirms bookings
- Client → Video consultation: joins consultation
- RND → Video consultation: joins consultation
- Video consultation → Attendance and closure: records attendance (evidence: `backend/scheduling/closing.py`)
- Attendance and closure → Payments and refunds: settles consultation (evidence: `backend/scheduling/closing.py`)
- RND → NCP records and labs: records care
- RND → Meal plans and logs: plans meals
- Client → Meal plans and logs: follows and logs
- Client → Progress tracking: tracks progress
- Client → Messages and reminders: messages and receives reminders
- RND → Messages and reminders: messages and sends reminders
- Administrator → RND verification: verifies licenses
- Administrator → User administration: manages users
- Administrator → Billing and payouts: manages billing and payouts
- Administrator → Reports and audit: reviews reports and audit log
