# mnmryk/portalsalud-academia architecture

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

- Interactive diagram: https://gitdiagram.com/mnmryk/portalsalud-academia
- Repository: https://github.com/mnmryk/portalsalud-academia

## Overview

This is a React/TanStack Start demo template for an integrative-health portal. The main workflow is clinic staff signing in, managing patient records and consultations, then providing patients with educational courses and clinical resources. The README confirms patient management, an online academy, and a resource library; the route tree also documents portal, forms, billing, calendar, AI-assistant, and academy areas. Many feature files were not sampled, so those branches are represented at their exact paths without asserting unverified calls or persistence.

Main entry points: [`src/routes/__root.tsx`](https://github.com/mnmryk/portalsalud-academia/blob/main/src/routes/__root.tsx) (Application providers), [`src/routeTree.gen.ts`](https://github.com/mnmryk/portalsalud-academia/blob/main/src/routeTree.gen.ts) (Route system), [`src/components/dashboard/Pacientes.tsx`](https://github.com/mnmryk/portalsalud-academia/blob/main/src/components/dashboard/Pacientes.tsx) (Patient records), [`src/components/dashboard/Academia.tsx`](https://github.com/mnmryk/portalsalud-academia/blob/main/src/components/dashboard/Academia.tsx) (Academy)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and identity"]
  node_route["Route system<br/>[routeTree.gen.ts]"]
  node_authview["Sign-in<br/>[LoginView.tsx]"]
  node_authstate["Authentication<br/>[AuthContext.tsx]"]
end

subgraph group_care["Clinical management"]
  node_patientrecords["Patient records<br/>[Pacientes.tsx]"]
  node_recordstate["Record state"]
  node_consultations["Consultations"]
  node_calendar["Calendar<br/>[Calendario.tsx]"]
  node_tasks["Patient tasks<br/>[TasksContext.tsx]"]
  node_forms["Patient forms"]
  node_billing["Billing<br/>[Facturacion.tsx]"]
end

subgraph group_learning["Learning and resources"]
  node_academy["Academy<br/>[Academia.tsx]"]
  node_academydata["Course state<br/>[AcademyContext.tsx]"]
  node_community["Academy community"]
  node_resources["Clinical resources<br/>[Recursos.tsx]"]
  node_portal["Patient portal<br/>[Portal.tsx]"]
end

subgraph group_platform["Shared platform"]
  node_assistant["AI assistant<br/>[AsistenteIA.tsx]"]
  node_chatapi["Chat endpoint<br/>[chat.ts]"]
  node_root["Application providers<br/>[__root.tsx]"]
  node_supabase["Supabase integration<br/>[client.ts]"]
end

node_clinic(("Clinic staff"))
node_patient(("Patient"))

node_clinic -->|"signs in"| node_authview
node_patient -->|"signs in"| node_authview
node_route -.->|"routes to"| node_authview
node_route -.->|"routes to"| node_patientrecords
node_clinic -->|"manages records"| node_patientrecords
node_patientrecords -.->|"uses"| node_recordstate
node_clinic -.->|"manages care"| node_consultations
node_clinic -.->|"schedules care"| node_calendar
node_clinic -.->|"tracks tasks"| node_tasks
node_clinic -.->|"manages forms"| node_forms
node_clinic -.->|"manages billing"| node_billing
node_clinic -->|"manages courses"| node_academy
node_patient -->|"learns online"| node_academy
node_academy -.->|"uses course state"| node_academydata
node_patient -.->|"joins community"| node_community
node_patient -->|"accesses resources"| node_resources
node_patient -.->|"uses portal"| node_portal
node_clinic -.->|"uses assistant"| node_assistant
node_assistant -->|"calls"| node_chatapi
node_root -->|"provides context"| node_authstate
node_root -->|"provides context"| node_recordstate
node_root -->|"provides context"| node_consultations
node_root -->|"provides context"| node_tasks
node_route -->|"includes root"| node_root

click node_route "https://github.com/mnmryk/portalsalud-academia/blob/main/src/routeTree.gen.ts"
click node_authview "https://github.com/mnmryk/portalsalud-academia/blob/main/src/components/auth/LoginView.tsx"
click node_authstate "https://github.com/mnmryk/portalsalud-academia/blob/main/src/context/AuthContext.tsx"
click node_patientrecords "https://github.com/mnmryk/portalsalud-academia/blob/main/src/components/dashboard/Pacientes.tsx"
click node_recordstate "https://github.com/mnmryk/portalsalud-academia/blob/main/src/context/PatientRecordsContext.tsx"
click node_consultations "https://github.com/mnmryk/portalsalud-academia/blob/main/src/context/ConsultationsContext.tsx"
click node_calendar "https://github.com/mnmryk/portalsalud-academia/blob/main/src/components/dashboard/Calendario.tsx"
click node_tasks "https://github.com/mnmryk/portalsalud-academia/blob/main/src/context/TasksContext.tsx"
click node_forms "https://github.com/mnmryk/portalsalud-academia/blob/main/src/routes/formularios.index.tsx"
click node_billing "https://github.com/mnmryk/portalsalud-academia/blob/main/src/components/dashboard/Facturacion.tsx"
click node_academy "https://github.com/mnmryk/portalsalud-academia/blob/main/src/components/dashboard/Academia.tsx"
click node_academydata "https://github.com/mnmryk/portalsalud-academia/blob/main/src/context/AcademyContext.tsx"
click node_community "https://github.com/mnmryk/portalsalud-academia/blob/main/src/components/dashboard/AcademiaComunidad.tsx"
click node_resources "https://github.com/mnmryk/portalsalud-academia/blob/main/src/components/dashboard/Recursos.tsx"
click node_portal "https://github.com/mnmryk/portalsalud-academia/blob/main/src/components/dashboard/Portal.tsx"
click node_assistant "https://github.com/mnmryk/portalsalud-academia/blob/main/src/components/dashboard/AsistenteIA.tsx"
click node_chatapi "https://github.com/mnmryk/portalsalud-academia/blob/main/src/routes/api/chat.ts"
click node_root "https://github.com/mnmryk/portalsalud-academia/blob/main/src/routes/__root.tsx"
click node_supabase "https://github.com/mnmryk/portalsalud-academia/blob/main/src/integrations/supabase/client.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_route,node_authview,node_authstate toneBlue
class node_patientrecords,node_recordstate,node_consultations,node_calendar,node_tasks,node_forms,node_billing toneAmber
class node_academy,node_academydata,node_community,node_resources,node_portal toneMint
class node_assistant,node_chatapi,node_root,node_supabase toneRose
class node_clinic,node_patient toneIndigo
```

## Components

### Entry and identity

- [Route system](https://github.com/mnmryk/portalsalud-academia/blob/main/src/routeTree.gen.ts): `src/routeTree.gen.ts`
- [Sign-in](https://github.com/mnmryk/portalsalud-academia/blob/main/src/components/auth/LoginView.tsx): `src/components/auth/LoginView.tsx`
- [Authentication](https://github.com/mnmryk/portalsalud-academia/blob/main/src/context/AuthContext.tsx): `src/context/AuthContext.tsx`

### Clinical management

- [Patient records](https://github.com/mnmryk/portalsalud-academia/blob/main/src/components/dashboard/Pacientes.tsx): `src/components/dashboard/Pacientes.tsx`
- [Record state](https://github.com/mnmryk/portalsalud-academia/blob/main/src/context/PatientRecordsContext.tsx): `src/context/PatientRecordsContext.tsx`
- [Consultations](https://github.com/mnmryk/portalsalud-academia/blob/main/src/context/ConsultationsContext.tsx): `src/context/ConsultationsContext.tsx`
- [Calendar](https://github.com/mnmryk/portalsalud-academia/blob/main/src/components/dashboard/Calendario.tsx): `src/components/dashboard/Calendario.tsx`
- [Patient tasks](https://github.com/mnmryk/portalsalud-academia/blob/main/src/context/TasksContext.tsx): `src/context/TasksContext.tsx`
- [Patient forms](https://github.com/mnmryk/portalsalud-academia/blob/main/src/routes/formularios.index.tsx): `src/routes/formularios.index.tsx`
- [Billing](https://github.com/mnmryk/portalsalud-academia/blob/main/src/components/dashboard/Facturacion.tsx): `src/components/dashboard/Facturacion.tsx`

### Learning and resources

- [Academy](https://github.com/mnmryk/portalsalud-academia/blob/main/src/components/dashboard/Academia.tsx): `src/components/dashboard/Academia.tsx`
- [Course state](https://github.com/mnmryk/portalsalud-academia/blob/main/src/context/AcademyContext.tsx): `src/context/AcademyContext.tsx`
- [Academy community](https://github.com/mnmryk/portalsalud-academia/blob/main/src/components/dashboard/AcademiaComunidad.tsx): `src/components/dashboard/AcademiaComunidad.tsx`
- [Clinical resources](https://github.com/mnmryk/portalsalud-academia/blob/main/src/components/dashboard/Recursos.tsx): `src/components/dashboard/Recursos.tsx`
- [Patient portal](https://github.com/mnmryk/portalsalud-academia/blob/main/src/components/dashboard/Portal.tsx): `src/components/dashboard/Portal.tsx`

### Shared platform

- [AI assistant](https://github.com/mnmryk/portalsalud-academia/blob/main/src/components/dashboard/AsistenteIA.tsx): `src/components/dashboard/AsistenteIA.tsx`
- [Chat endpoint](https://github.com/mnmryk/portalsalud-academia/blob/main/src/routes/api/chat.ts): `src/routes/api/chat.ts`
- [Application providers](https://github.com/mnmryk/portalsalud-academia/blob/main/src/routes/__root.tsx): `src/routes/__root.tsx`
- [Supabase integration](https://github.com/mnmryk/portalsalud-academia/blob/main/src/integrations/supabase/client.ts): `src/integrations/supabase/client.ts`

### Other components

- **Clinic staff**
- **Patient**

## Connections

- Clinic staff → Sign-in: signs in
- Patient → Sign-in: signs in
- Route system → Sign-in: routes to
- Route system → Patient records: routes to
- Clinic staff → Patient records: manages records
- Patient records → Record state: uses (evidence: `src/components/dashboard/Pacientes.tsx`)
- Clinic staff → Consultations: manages care
- Clinic staff → Calendar: schedules care
- Clinic staff → Patient tasks: tracks tasks
- Clinic staff → Patient forms: manages forms
- Clinic staff → Billing: manages billing
- Clinic staff → Academy: manages courses
- Patient → Academy: learns online
- Academy → Course state: uses course state
- Patient → Academy community: joins community
- Patient → Clinical resources: accesses resources
- Patient → Patient portal: uses portal
- Clinic staff → AI assistant: uses assistant
- AI assistant → Chat endpoint: calls
- Application providers → Authentication: provides context (evidence: `src/routes/__root.tsx`)
- Application providers → Record state: provides context (evidence: `src/routes/__root.tsx`)
- Application providers → Consultations: provides context (evidence: `src/routes/__root.tsx`)
- Application providers → Patient tasks: provides context (evidence: `src/routes/__root.tsx`)
- Route system → Application providers: includes root (evidence: `src/routeTree.gen.ts`)
