# viniflix/nello architecture

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

- Interactive diagram: https://gitdiagram.com/viniflix/nello
- Repository: https://github.com/viniflix/nello

## Overview

Nello is a digital practice platform for nutritionists, patients, and administrators. The main workflow is a nutritionist managing a patient’s clinical information and appointments, creating a meal plan, then supporting the patient’s ongoing tracking and communication; administration provides a separate operational experience. The graph also captures authentication, shared read coordination, Supabase persistence, privacy, and analytics. Edges are limited to README-documented capabilities and references visible in the supplied source index or excerpts; unsampled subsystems are represented at their existing directory paths.

Main entry points: [`src/App.jsx`](https://github.com/viniflix/nello/blob/main/src/App.jsx) (Web application), [`src/infrastructure/supabase/client.js`](https://github.com/viniflix/nello/blob/main/src/infrastructure/supabase/client.js) (Supabase client), [`src/contexts/AuthContext.jsx`](https://github.com/viniflix/nello/blob/main/src/contexts/AuthContext.jsx) (Authentication), [`src/app/router/index.jsx`](https://github.com/viniflix/nello/blob/main/src/app/router/index.jsx) (Role-based routing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_application["Application entry"]
  node_app["Web application<br/>[App.jsx]"]
  node_auth["Authentication<br/>[AuthContext.jsx]"]
  node_router["Role-based routing<br/>[index.jsx]"]
end

subgraph group_care["Clinical care"]
  node_clinical_records["Clinical records"]
  node_assessment["Anamnesis and assessment"]
  node_anthropometry["Anthropometry"]
  node_meal_planning["Meal planning"]
  node_agenda["Agenda"]
  node_finance["Finance"]
end

subgraph group_patient["Patient experience"]
  node_patient_hub["Patient hub"]
  node_patient_tracking["Progress tracking"]
  node_communication["Chat and check-ins<br/>[ChatContext.jsx]"]
end

subgraph group_platform["Platform services"]
  node_read_coordination["Coordinated reads"]
  node_resource_snapshot["Resource snapshots"]
  node_supabase_client["Supabase client<br/>[client.js]"]
  node_supabase[("Supabase backend")]
  node_privacy["Privacy and consent"]
  node_analytics["Product analytics<br/>[posthog.js]"]
end

subgraph group_operations["Administration"]
  node_admin["Administration tools"]
end

node_nutritionist(("Nutritionist"))
node_patient_actor(("Patient"))
node_admin_actor(("Administrator"))

node_nutritionist -->|"uses"| node_app
node_patient_actor -->|"uses"| node_app
node_admin_actor -->|"uses"| node_app
node_app -->|"provides session"| node_auth
node_app -->|"mounts routes"| node_router
node_auth -->|"uses"| node_supabase_client
node_router -->|"routes to"| node_clinical_records
node_nutritionist -->|"manages records"| node_clinical_records
node_nutritionist -->|"conducts assessment"| node_assessment
node_nutritionist -->|"records measurements"| node_anthropometry
node_nutritionist -->|"prescribes meals"| node_meal_planning
node_nutritionist -->|"manages appointments"| node_agenda
node_nutritionist -->|"manages finances"| node_finance
node_patient_actor -->|"views care"| node_patient_hub
node_patient_actor -->|"tracks progress"| node_patient_tracking
node_patient_actor -->|"communicates"| node_communication
node_meal_planning -->|"loads resources"| node_read_coordination
node_anthropometry -->|"loads resources"| node_read_coordination
node_agenda -->|"loads resources"| node_read_coordination
node_patient_tracking -->|"stores view state"| node_resource_snapshot
node_patient_tracking -->|"queries backend"| node_supabase_client
node_meal_planning -->|"queries backend"| node_supabase_client
node_anthropometry -->|"queries backend"| node_supabase_client
node_supabase_client -->|"connects to"| node_supabase
node_auth -->|"clears private state"| node_privacy
node_auth -->|"identifies user"| node_analytics
node_admin_actor -->|"operates product"| node_admin
node_router -->|"routes to"| node_admin

click node_app "https://github.com/viniflix/nello/blob/main/src/App.jsx"
click node_auth "https://github.com/viniflix/nello/blob/main/src/contexts/AuthContext.jsx"
click node_router "https://github.com/viniflix/nello/blob/main/src/app/router/index.jsx"
click node_clinical_records "https://github.com/viniflix/nello/tree/main/src/features/clinical-records"
click node_assessment "https://github.com/viniflix/nello/tree/main/src/components/anamnesis"
click node_anthropometry "https://github.com/viniflix/nello/blob/main/src/hooks/useAnthropometryController.js"
click node_meal_planning "https://github.com/viniflix/nello/blob/main/src/hooks/useMealPlanController.js"
click node_agenda "https://github.com/viniflix/nello/blob/main/src/hooks/useAgendaController.js"
click node_finance "https://github.com/viniflix/nello/tree/main/src/components/financial"
click node_patient_hub "https://github.com/viniflix/nello/tree/main/src/components/patient-hub"
click node_patient_tracking "https://github.com/viniflix/nello/blob/main/src/pages/patient/usePatientProgressPageController.jsx"
click node_communication "https://github.com/viniflix/nello/blob/main/src/contexts/ChatContext.jsx"
click node_read_coordination "https://github.com/viniflix/nello/blob/main/src/hooks/useCoordinatedLoader.js"
click node_resource_snapshot "https://github.com/viniflix/nello/blob/main/src/hooks/useResourceSnapshot.js"
click node_supabase_client "https://github.com/viniflix/nello/blob/main/src/infrastructure/supabase/client.js"
click node_privacy "https://github.com/viniflix/nello/tree/main/src/features/privacy"
click node_analytics "https://github.com/viniflix/nello/blob/main/src/infrastructure/analytics/posthog.js"
click node_admin "https://github.com/viniflix/nello/tree/main/src/features/admin"

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_app,node_auth,node_router toneBlue
class node_clinical_records,node_assessment,node_anthropometry,node_meal_planning,node_agenda,node_finance toneAmber
class node_patient_hub,node_patient_tracking,node_communication toneMint
class node_read_coordination,node_resource_snapshot,node_supabase_client,node_supabase,node_privacy,node_analytics toneRose
class node_admin,node_nutritionist,node_patient_actor,node_admin_actor toneIndigo
```

## Components

### Application entry

- [Web application](https://github.com/viniflix/nello/blob/main/src/App.jsx): `src/App.jsx`
- [Authentication](https://github.com/viniflix/nello/blob/main/src/contexts/AuthContext.jsx): `src/contexts/AuthContext.jsx`
- [Role-based routing](https://github.com/viniflix/nello/blob/main/src/app/router/index.jsx): `src/app/router/index.jsx`

### Clinical care

- [Clinical records](https://github.com/viniflix/nello/tree/main/src/features/clinical-records): `src/features/clinical-records`
- [Anamnesis and assessment](https://github.com/viniflix/nello/tree/main/src/components/anamnesis): `src/components/anamnesis`
- [Anthropometry](https://github.com/viniflix/nello/blob/main/src/hooks/useAnthropometryController.js): `src/hooks/useAnthropometryController.js`
- [Meal planning](https://github.com/viniflix/nello/blob/main/src/hooks/useMealPlanController.js): `src/hooks/useMealPlanController.js`
- [Agenda](https://github.com/viniflix/nello/blob/main/src/hooks/useAgendaController.js): `src/hooks/useAgendaController.js`
- [Finance](https://github.com/viniflix/nello/tree/main/src/components/financial): `src/components/financial`

### Patient experience

- [Patient hub](https://github.com/viniflix/nello/tree/main/src/components/patient-hub): `src/components/patient-hub`
- [Progress tracking](https://github.com/viniflix/nello/blob/main/src/pages/patient/usePatientProgressPageController.jsx): `src/pages/patient/usePatientProgressPageController.jsx`
- [Chat and check-ins](https://github.com/viniflix/nello/blob/main/src/contexts/ChatContext.jsx): `src/contexts/ChatContext.jsx`

### Platform services

- [Coordinated reads](https://github.com/viniflix/nello/blob/main/src/hooks/useCoordinatedLoader.js): `src/hooks/useCoordinatedLoader.js`
- [Resource snapshots](https://github.com/viniflix/nello/blob/main/src/hooks/useResourceSnapshot.js): `src/hooks/useResourceSnapshot.js`
- [Supabase client](https://github.com/viniflix/nello/blob/main/src/infrastructure/supabase/client.js): `src/infrastructure/supabase/client.js`
- **Supabase backend**
- [Privacy and consent](https://github.com/viniflix/nello/tree/main/src/features/privacy): `src/features/privacy`
- [Product analytics](https://github.com/viniflix/nello/blob/main/src/infrastructure/analytics/posthog.js): `src/infrastructure/analytics/posthog.js`

### Administration

- [Administration tools](https://github.com/viniflix/nello/tree/main/src/features/admin): `src/features/admin`

### Other components

- **Nutritionist**
- **Patient**
- **Administrator**

## Connections

- Nutritionist → Web application: uses (evidence: `README.md`)
- Patient → Web application: uses (evidence: `README.md`)
- Administrator → Web application: uses (evidence: `README.md`)
- Web application → Authentication: provides session (evidence: `src/App.jsx`)
- Web application → Role-based routing: mounts routes (evidence: `src/App.jsx`)
- Authentication → Supabase client: uses (evidence: `src/contexts/AuthContext.jsx`)
- Role-based routing → Clinical records: routes to
- Nutritionist → Clinical records: manages records (evidence: `README.md`)
- Nutritionist → Anamnesis and assessment: conducts assessment (evidence: `README.md`)
- Nutritionist → Anthropometry: records measurements (evidence: `README.md`)
- Nutritionist → Meal planning: prescribes meals (evidence: `README.md`)
- Nutritionist → Agenda: manages appointments (evidence: `README.md`)
- Nutritionist → Finance: manages finances (evidence: `README.md`)
- Patient → Patient hub: views care (evidence: `README.md`)
- Patient → Progress tracking: tracks progress (evidence: `README.md`)
- Patient → Chat and check-ins: communicates (evidence: `README.md`)
- Meal planning → Coordinated reads: loads resources (evidence: `src/hooks/useMealPlanController.js`)
- Anthropometry → Coordinated reads: loads resources (evidence: `src/hooks/useAnthropometryController.js`)
- Agenda → Coordinated reads: loads resources (evidence: `src/hooks/useAgendaController.js`)
- Progress tracking → Resource snapshots: stores view state (evidence: `src/pages/patient/usePatientProgressPageController.jsx`)
- Progress tracking → Supabase client: queries backend (evidence: `src/pages/patient/usePatientProgressPageController.jsx`)
- Meal planning → Supabase client: queries backend (evidence: `src/hooks/useMealPlanController.js`)
- Anthropometry → Supabase client: queries backend (evidence: `src/hooks/useAnthropometryController.js`)
- Supabase client → Supabase backend: connects to (evidence: `src/infrastructure/supabase/client.js`)
- Authentication → Privacy and consent: clears private state (evidence: `src/contexts/AuthContext.jsx`)
- Authentication → Product analytics: identifies user (evidence: `src/contexts/AuthContext.jsx`)
- Administrator → Administration tools: operates product (evidence: `README.md`)
- Role-based routing → Administration tools: routes to
