# fatimaariv/consultorio-medico architecture

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

- Interactive diagram: https://gitdiagram.com/fatimaariv/consultorio-medico
- Repository: https://github.com/fatimaariv/consultorio-medico

## Overview

MediTrak is a role-based clinic-management mobile app. Users register or sign in, then the navigator presents patient, doctor, or administrator workflows; patients schedule and review appointments, doctors manage their agenda and consultations, and administrators manage clinic resources and reporting. Screens access Supabase directly or through service modules, while shared auth state supplies session and role information. The README is empty, so unsampled capabilities and their interactions are represented only where the source index identifies them; edges are limited to excerpted relationships or indexed references.

Main entry points: [`src/navigation/AppNavigator.tsx`](https://github.com/fatimaariv/consultorio-medico/blob/main/src/navigation/AppNavigator.tsx) (Role navigation), [`src/supabase/supabase.ts`](https://github.com/fatimaariv/consultorio-medico/blob/main/src/supabase/supabase.ts) (Supabase client), [`App.tsx`](https://github.com/fatimaariv/consultorio-medico/blob/main/App.tsx) (App root), [`src/Pantallas/Pantallas Admi/GestiónDoctores/GestionarDoctores.tsx`](https://github.com/fatimaariv/consultorio-medico/blob/main/src/Pantallas/Pantallas%20Admi/Gesti%C3%B3nDoctores/GestionarDoctores.tsx) (Doctor management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["App entry"]
  node_app["App root<br/>[App.tsx]"]
  node_navigator["Role navigation<br/>[AppNavigator.tsx]"]
  node_supabase_client["Supabase client<br/>[supabase.ts]"]
end

subgraph group_auth["Identity and access"]
  node_auth_context["Auth state<br/>[AuthContext.tsx]"]
  node_login["Sign in<br/>[LoginScreen.tsx]"]
  node_registration["Patient registration<br/>[RegisterScreen.tsx]"]
  node_verification["Code verification"]
  node_password_reset["Password recovery"]
  node_auth_service["Login service<br/>[authService.ts]"]
end

subgraph group_patient["Patient workflows"]
  node_patient_home["Patient home<br/>[HomeScreen.tsx]"]
  node_schedule["Appointment scheduling<br/>[ScheduleScreen.tsx]"]
  node_patient_history["Patient history<br/>[HistoryScreen.tsx]"]
  node_patient_profile["Patient profile<br/>[PatientProfile.tsx]"]
end

subgraph group_clinical["Clinical workflows"]
  node_doctor_home["Doctor dashboard<br/>[DoctorHome.tsx]"]
  node_doctor_agenda["Doctor agenda<br/>[Agenda.tsx]"]
  node_consultation["Consultation record<br/>[Consulta.tsx]"]
  node_doctor_history["Appointment history"]
  node_doctor_profile["Doctor profile<br/>[PerfilDoc.tsx]"]
end

subgraph group_admin["Administration"]
  node_admin_home["Admin dashboard<br/>[AdmiHome.tsx]"]
  node_admin_appointments["Appointment management<br/>[GestionarCitas.tsx]"]
  node_clinic_management["Clinic rooms<br/>[index.tsx]"]
  node_clinic_editor["Room editor"]
  node_clinic_service["Room service"]
  node_user_management["User management"]
  node_doctor_management["Doctor management"]
  node_doctor_form["Doctor editor"]
  node_doctor_admin_service["Doctor admin service"]
  node_reports["Reports<br/>[Reportes.tsx]"]
end

node_user(("App user"))
node_supabase_backend[("Supabase data and auth")]

node_user -->|"opens"| node_app
node_app -->|"provides auth"| node_auth_context
node_app -->|"renders"| node_navigator
node_navigator -->|"reads role"| node_auth_context
node_navigator -->|"routes to"| node_login
node_navigator -->|"routes to"| node_registration
node_navigator -->|"routes to"| node_verification
node_navigator -->|"routes to"| node_password_reset
node_navigator -->|"routes by role"| node_patient_home
node_navigator -->|"routes by role"| node_schedule
node_navigator -->|"routes by role"| node_patient_history
node_navigator -->|"routes by role"| node_patient_profile
node_navigator -->|"routes by role"| node_doctor_home
node_navigator -->|"routes by role"| node_doctor_agenda
node_navigator -->|"routes by role"| node_consultation
node_navigator -->|"routes by role"| node_doctor_history
node_navigator -->|"routes by role"| node_doctor_profile
node_navigator -->|"routes by role"| node_admin_home
node_navigator -->|"routes by role"| node_admin_appointments
node_navigator -->|"routes by role"| node_clinic_management
node_navigator -->|"routes by role"| node_user_management
node_navigator -->|"routes by role"| node_doctor_management
node_navigator -->|"routes by role"| node_reports
node_login -->|"calls login"| node_auth_service
node_auth_service -->|"authenticates and reads"| node_supabase_client
node_auth_context -->|"tracks auth"| node_supabase_client
node_registration -->|"creates account"| node_supabase_client
node_clinic_management -->|"uses service"| node_clinic_service
node_clinic_editor -->|"uses service"| node_clinic_service
node_doctor_management -->|"uses service"| node_doctor_admin_service
node_doctor_management -->|"opens editor"| node_doctor_form
node_clinic_service -->|"reads and writes"| node_supabase_client
node_doctor_admin_service -->|"reads and writes"| node_supabase_client
node_patient_home -->|"queries data"| node_supabase_client
node_schedule -->|"queries availability"| node_supabase_client
node_patient_history -->|"queries history"| node_supabase_client
node_patient_profile -->|"queries profile"| node_supabase_client
node_doctor_home -->|"queries agenda"| node_supabase_client
node_doctor_agenda -->|"queries appointments"| node_supabase_client
node_consultation -->|"queries records"| node_supabase_client
node_doctor_history -->|"queries history"| node_supabase_client
node_doctor_profile -->|"queries profile"| node_supabase_client
node_admin_home -->|"queries data"| node_supabase_client
node_admin_appointments -->|"queries appointments"| node_supabase_client
node_user_management -->|"queries users"| node_supabase_client
node_doctor_form -->|"queries data"| node_supabase_client
node_reports -->|"queries data"| node_supabase_client
node_supabase_client -.->|"connects to"| node_supabase_backend

click node_app "https://github.com/fatimaariv/consultorio-medico/blob/main/App.tsx"
click node_navigator "https://github.com/fatimaariv/consultorio-medico/blob/main/src/navigation/AppNavigator.tsx"
click node_auth_context "https://github.com/fatimaariv/consultorio-medico/blob/main/src/context/AuthContext.tsx"
click node_login "https://github.com/fatimaariv/consultorio-medico/blob/main/src/Pantallas/LoginScreen.tsx"
click node_registration "https://github.com/fatimaariv/consultorio-medico/blob/main/src/Pantallas/RegisterScreen.tsx"
click node_verification "https://github.com/fatimaariv/consultorio-medico/blob/main/src/Pantallas/VerifyCodeScreen.tsx"
click node_password_reset "https://github.com/fatimaariv/consultorio-medico/blob/main/src/Pantallas/ForgotPasswordScreen.tsx"
click node_auth_service "https://github.com/fatimaariv/consultorio-medico/blob/main/src/services/authService.ts"
click node_patient_home "https://github.com/fatimaariv/consultorio-medico/blob/main/src/Pantallas/Pantallas%20Paciente/HomeScreen.tsx"
click node_schedule "https://github.com/fatimaariv/consultorio-medico/blob/main/src/Pantallas/Pantallas%20Paciente/ScheduleScreen.tsx"
click node_patient_history "https://github.com/fatimaariv/consultorio-medico/blob/main/src/Pantallas/Pantallas%20Paciente/HistoryScreen.tsx"
click node_patient_profile "https://github.com/fatimaariv/consultorio-medico/blob/main/src/Pantallas/Pantallas%20Paciente/PatientProfile.tsx"
click node_doctor_home "https://github.com/fatimaariv/consultorio-medico/blob/main/src/Pantallas/Pantallas%20Doctor/DoctorHome.tsx"
click node_doctor_agenda "https://github.com/fatimaariv/consultorio-medico/blob/main/src/Pantallas/Pantallas%20Doctor/Agenda.tsx"
click node_consultation "https://github.com/fatimaariv/consultorio-medico/blob/main/src/Pantallas/Pantallas%20Doctor/Consulta.tsx"
click node_doctor_history "https://github.com/fatimaariv/consultorio-medico/blob/main/src/Pantallas/Pantallas%20Doctor/HistorialDeCitas.tsx"
click node_doctor_profile "https://github.com/fatimaariv/consultorio-medico/blob/main/src/Pantallas/Pantallas%20Doctor/PerfilDoc.tsx"
click node_admin_home "https://github.com/fatimaariv/consultorio-medico/blob/main/src/Pantallas/Pantallas%20Admi/AdmiHome.tsx"
click node_admin_appointments "https://github.com/fatimaariv/consultorio-medico/blob/main/src/Pantallas/Pantallas%20Admi/GestionarCitas/GestionarCitas.tsx"
click node_clinic_management "https://github.com/fatimaariv/consultorio-medico/blob/main/src/Pantallas/Pantallas%20Admi/GestionarConsultorios/index.tsx"
click node_clinic_editor "https://github.com/fatimaariv/consultorio-medico/blob/main/src/Pantallas/Pantallas%20Admi/GestionarConsultorios/ConsultorioModal.tsx"
click node_clinic_service "https://github.com/fatimaariv/consultorio-medico/blob/main/src/services/consultoriosService.ts"
click node_user_management "https://github.com/fatimaariv/consultorio-medico/blob/main/src/Pantallas/Pantallas%20Admi/GestionarUsuarios/GestionarUsuarios.tsx"
click node_doctor_management "https://github.com/fatimaariv/consultorio-medico/blob/main/src/Pantallas/Pantallas%20Admi/Gesti%C3%B3nDoctores/GestionarDoctores.tsx"
click node_doctor_form "https://github.com/fatimaariv/consultorio-medico/blob/main/src/Pantallas/Pantallas%20Admi/Gesti%C3%B3nDoctores/Formulariodoctor.tsx"
click node_doctor_admin_service "https://github.com/fatimaariv/consultorio-medico/blob/main/src/services/Doctoresadminservice.ts"
click node_reports "https://github.com/fatimaariv/consultorio-medico/blob/main/src/Pantallas/Pantallas%20Admi/Reportes/Reportes.tsx"
click node_supabase_client "https://github.com/fatimaariv/consultorio-medico/blob/main/src/supabase/supabase.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_app,node_navigator,node_supabase_client,node_user toneBlue
class node_auth_context,node_login,node_registration,node_verification,node_password_reset,node_auth_service,node_supabase_backend toneAmber
class node_patient_home,node_schedule,node_patient_history,node_patient_profile toneMint
class node_doctor_home,node_doctor_agenda,node_consultation,node_doctor_history,node_doctor_profile toneRose
class node_admin_home,node_admin_appointments,node_clinic_management,node_clinic_editor,node_clinic_service,node_user_management,node_doctor_management,node_doctor_form,node_doctor_admin_service,node_reports toneIndigo
```

## Components

### App entry

- [App root](https://github.com/fatimaariv/consultorio-medico/blob/main/App.tsx): `App.tsx`
- [Role navigation](https://github.com/fatimaariv/consultorio-medico/blob/main/src/navigation/AppNavigator.tsx): `src/navigation/AppNavigator.tsx`
- [Supabase client](https://github.com/fatimaariv/consultorio-medico/blob/main/src/supabase/supabase.ts): `src/supabase/supabase.ts`

### Identity and access

- [Auth state](https://github.com/fatimaariv/consultorio-medico/blob/main/src/context/AuthContext.tsx): `src/context/AuthContext.tsx`
- [Sign in](https://github.com/fatimaariv/consultorio-medico/blob/main/src/Pantallas/LoginScreen.tsx): `src/Pantallas/LoginScreen.tsx`
- [Patient registration](https://github.com/fatimaariv/consultorio-medico/blob/main/src/Pantallas/RegisterScreen.tsx): `src/Pantallas/RegisterScreen.tsx`
- [Code verification](https://github.com/fatimaariv/consultorio-medico/blob/main/src/Pantallas/VerifyCodeScreen.tsx): `src/Pantallas/VerifyCodeScreen.tsx`
- [Password recovery](https://github.com/fatimaariv/consultorio-medico/blob/main/src/Pantallas/ForgotPasswordScreen.tsx): `src/Pantallas/ForgotPasswordScreen.tsx`
- [Login service](https://github.com/fatimaariv/consultorio-medico/blob/main/src/services/authService.ts): `src/services/authService.ts`

### Patient workflows

- [Patient home](https://github.com/fatimaariv/consultorio-medico/blob/main/src/Pantallas/Pantallas%20Paciente/HomeScreen.tsx): `src/Pantallas/Pantallas Paciente/HomeScreen.tsx`
- [Appointment scheduling](https://github.com/fatimaariv/consultorio-medico/blob/main/src/Pantallas/Pantallas%20Paciente/ScheduleScreen.tsx): `src/Pantallas/Pantallas Paciente/ScheduleScreen.tsx`
- [Patient history](https://github.com/fatimaariv/consultorio-medico/blob/main/src/Pantallas/Pantallas%20Paciente/HistoryScreen.tsx): `src/Pantallas/Pantallas Paciente/HistoryScreen.tsx`
- [Patient profile](https://github.com/fatimaariv/consultorio-medico/blob/main/src/Pantallas/Pantallas%20Paciente/PatientProfile.tsx): `src/Pantallas/Pantallas Paciente/PatientProfile.tsx`

### Clinical workflows

- [Doctor dashboard](https://github.com/fatimaariv/consultorio-medico/blob/main/src/Pantallas/Pantallas%20Doctor/DoctorHome.tsx): `src/Pantallas/Pantallas Doctor/DoctorHome.tsx`
- [Doctor agenda](https://github.com/fatimaariv/consultorio-medico/blob/main/src/Pantallas/Pantallas%20Doctor/Agenda.tsx): `src/Pantallas/Pantallas Doctor/Agenda.tsx`
- [Consultation record](https://github.com/fatimaariv/consultorio-medico/blob/main/src/Pantallas/Pantallas%20Doctor/Consulta.tsx): `src/Pantallas/Pantallas Doctor/Consulta.tsx`
- [Appointment history](https://github.com/fatimaariv/consultorio-medico/blob/main/src/Pantallas/Pantallas%20Doctor/HistorialDeCitas.tsx): `src/Pantallas/Pantallas Doctor/HistorialDeCitas.tsx`
- [Doctor profile](https://github.com/fatimaariv/consultorio-medico/blob/main/src/Pantallas/Pantallas%20Doctor/PerfilDoc.tsx): `src/Pantallas/Pantallas Doctor/PerfilDoc.tsx`

### Administration

- [Admin dashboard](https://github.com/fatimaariv/consultorio-medico/blob/main/src/Pantallas/Pantallas%20Admi/AdmiHome.tsx): `src/Pantallas/Pantallas Admi/AdmiHome.tsx`
- [Appointment management](https://github.com/fatimaariv/consultorio-medico/blob/main/src/Pantallas/Pantallas%20Admi/GestionarCitas/GestionarCitas.tsx): `src/Pantallas/Pantallas Admi/GestionarCitas/GestionarCitas.tsx`
- [Clinic rooms](https://github.com/fatimaariv/consultorio-medico/blob/main/src/Pantallas/Pantallas%20Admi/GestionarConsultorios/index.tsx): `src/Pantallas/Pantallas Admi/GestionarConsultorios/index.tsx`
- [Room editor](https://github.com/fatimaariv/consultorio-medico/blob/main/src/Pantallas/Pantallas%20Admi/GestionarConsultorios/ConsultorioModal.tsx): `src/Pantallas/Pantallas Admi/GestionarConsultorios/ConsultorioModal.tsx`
- [Room service](https://github.com/fatimaariv/consultorio-medico/blob/main/src/services/consultoriosService.ts): `src/services/consultoriosService.ts`
- [User management](https://github.com/fatimaariv/consultorio-medico/blob/main/src/Pantallas/Pantallas%20Admi/GestionarUsuarios/GestionarUsuarios.tsx): `src/Pantallas/Pantallas Admi/GestionarUsuarios/GestionarUsuarios.tsx`
- [Doctor management](https://github.com/fatimaariv/consultorio-medico/blob/main/src/Pantallas/Pantallas%20Admi/Gesti%C3%B3nDoctores/GestionarDoctores.tsx): `src/Pantallas/Pantallas Admi/GestiónDoctores/GestionarDoctores.tsx`
- [Doctor editor](https://github.com/fatimaariv/consultorio-medico/blob/main/src/Pantallas/Pantallas%20Admi/Gesti%C3%B3nDoctores/Formulariodoctor.tsx): `src/Pantallas/Pantallas Admi/GestiónDoctores/Formulariodoctor.tsx`
- [Doctor admin service](https://github.com/fatimaariv/consultorio-medico/blob/main/src/services/Doctoresadminservice.ts): `src/services/Doctoresadminservice.ts`
- [Reports](https://github.com/fatimaariv/consultorio-medico/blob/main/src/Pantallas/Pantallas%20Admi/Reportes/Reportes.tsx): `src/Pantallas/Pantallas Admi/Reportes/Reportes.tsx`

### Other components

- **App user**
- **Supabase data and auth**

## Connections

- App user → App root: opens (evidence: `App.tsx`)
- App root → Auth state: provides auth (evidence: `App.tsx`)
- App root → Role navigation: renders (evidence: `App.tsx`)
- Role navigation → Auth state: reads role (evidence: `src/navigation/AppNavigator.tsx`)
- Role navigation → Sign in: routes to (evidence: `src/navigation/AppNavigator.tsx`)
- Role navigation → Patient registration: routes to (evidence: `src/navigation/AppNavigator.tsx`)
- Role navigation → Code verification: routes to (evidence: `src/navigation/AppNavigator.tsx`)
- Role navigation → Password recovery: routes to (evidence: `src/navigation/AppNavigator.tsx`)
- Role navigation → Patient home: routes by role (evidence: `src/navigation/AppNavigator.tsx`)
- Role navigation → Appointment scheduling: routes by role (evidence: `src/navigation/AppNavigator.tsx`)
- Role navigation → Patient history: routes by role (evidence: `src/navigation/AppNavigator.tsx`)
- Role navigation → Patient profile: routes by role (evidence: `src/navigation/AppNavigator.tsx`)
- Role navigation → Doctor dashboard: routes by role (evidence: `src/navigation/AppNavigator.tsx`)
- Role navigation → Doctor agenda: routes by role (evidence: `src/navigation/AppNavigator.tsx`)
- Role navigation → Consultation record: routes by role (evidence: `src/navigation/AppNavigator.tsx`)
- Role navigation → Appointment history: routes by role (evidence: `src/navigation/AppNavigator.tsx`)
- Role navigation → Doctor profile: routes by role (evidence: `src/navigation/AppNavigator.tsx`)
- Role navigation → Admin dashboard: routes by role (evidence: `src/navigation/AppNavigator.tsx`)
- Role navigation → Appointment management: routes by role (evidence: `src/navigation/AppNavigator.tsx`)
- Role navigation → Clinic rooms: routes by role (evidence: `src/navigation/AppNavigator.tsx`)
- Role navigation → User management: routes by role (evidence: `src/navigation/AppNavigator.tsx`)
- Role navigation → Doctor management: routes by role (evidence: `src/navigation/AppNavigator.tsx`)
- Role navigation → Reports: routes by role (evidence: `src/navigation/AppNavigator.tsx`)
- Sign in → Login service: calls login (evidence: `src/Pantallas/LoginScreen.tsx`)
- Login service → Supabase client: authenticates and reads (evidence: `src/services/authService.ts`)
- Auth state → Supabase client: tracks auth (evidence: `src/context/AuthContext.tsx`)
- Patient registration → Supabase client: creates account (evidence: `src/Pantallas/RegisterScreen.tsx`)
- Clinic rooms → Room service: uses service (evidence: `src/Pantallas/Pantallas Admi/GestionarConsultorios/index.tsx`)
- Room editor → Room service: uses service (evidence: `src/Pantallas/Pantallas Admi/GestionarConsultorios/ConsultorioModal.tsx`)
- Doctor management → Doctor admin service: uses service (evidence: `src/Pantallas/Pantallas Admi/GestiónDoctores/GestionarDoctores.tsx`)
- Doctor management → Doctor editor: opens editor (evidence: `src/Pantallas/Pantallas Admi/GestiónDoctores/GestionarDoctores.tsx`)
- Room service → Supabase client: reads and writes (evidence: `src/services/consultoriosService.ts`)
- Doctor admin service → Supabase client: reads and writes (evidence: `src/services/Doctoresadminservice.ts`)
- Patient home → Supabase client: queries data (evidence: `src/Pantallas/Pantallas Paciente/HomeScreen.tsx`)
- Appointment scheduling → Supabase client: queries availability (evidence: `src/Pantallas/Pantallas Paciente/ScheduleScreen.tsx`)
- Patient history → Supabase client: queries history (evidence: `src/Pantallas/Pantallas Paciente/HistoryScreen.tsx`)
- Patient profile → Supabase client: queries profile (evidence: `src/Pantallas/Pantallas Paciente/PatientProfile.tsx`)
- Doctor dashboard → Supabase client: queries agenda (evidence: `src/Pantallas/Pantallas Doctor/DoctorHome.tsx`)
- Doctor agenda → Supabase client: queries appointments (evidence: `src/Pantallas/Pantallas Doctor/Agenda.tsx`)
- Consultation record → Supabase client: queries records (evidence: `src/Pantallas/Pantallas Doctor/Consulta.tsx`)
- Appointment history → Supabase client: queries history (evidence: `src/Pantallas/Pantallas Doctor/HistorialDeCitas.tsx`)
- Doctor profile → Supabase client: queries profile (evidence: `src/Pantallas/Pantallas Doctor/PerfilDoc.tsx`)
- Admin dashboard → Supabase client: queries data (evidence: `src/Pantallas/Pantallas Admi/AdmiHome.tsx`)
- Appointment management → Supabase client: queries appointments (evidence: `src/Pantallas/Pantallas Admi/GestionarCitas/GestionarCitas.tsx`)
- User management → Supabase client: queries users (evidence: `src/Pantallas/Pantallas Admi/GestionarUsuarios/GestionarUsuarios.tsx`)
- Doctor editor → Supabase client: queries data (evidence: `src/Pantallas/Pantallas Admi/GestiónDoctores/Formulariodoctor.tsx`)
- Reports → Supabase client: queries data (evidence: `src/Pantallas/Pantallas Admi/Reportes/Reportes.tsx`)
- Supabase client → Supabase data and auth: connects to
