# banfrij/imagenologiasigloxxi architecture

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

- Interactive diagram: https://gitdiagram.com/banfrij/imagenologiasigloxxi
- Repository: https://github.com/banfrij/imagenologiasigloxxi

## Overview

IMG XXI is a clinic-imaging operations dashboard. Staff sign in through Firebase Auth; the app checks allowed email addresses, then presents a section-based workspace for scheduling appointments, managing patients and studies, and reviewing reports. The agenda edits appointments and related activity in Firestore, while reports query appointment and audit data and provide PDF export. Studies management uses browser local storage. The supplied excerpts show the app shell, agenda, login, studies, and reports; some screen details are unsampled, so their internal behavior and links are not inferred.

Main entry points: [`src/App.tsx`](https://github.com/banfrij/imagenologiasigloxxi/blob/main/src/App.tsx) (App and routing), [`src/components/auth/LoginPanel.tsx`](https://github.com/banfrij/imagenologiasigloxxi/blob/main/src/components/auth/LoginPanel.tsx) (Login panel), [`src/screens/AgendaScreen.tsx`](https://github.com/banfrij/imagenologiasigloxxi/blob/main/src/screens/AgendaScreen.tsx) (Appointment agenda), [`src/firebase.ts`](https://github.com/banfrij/imagenologiasigloxxi/blob/main/src/firebase.ts) (Firebase client setup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and shell"]
  node_entry["React entry<br/>[main.tsx]"]
  node_app["App and routing<br/>[App.tsx]"]
  node_login["Login panel<br/>[LoginPanel.tsx]"]
  node_allowlist["Email allowlist<br/>[auth.ts]"]
  node_dashboard["Dashboard layout"]
  node_sidebar["Section navigation<br/>[Sidebar.tsx]"]
end

subgraph group_scheduling["Scheduling"]
  node_agenda["Appointment agenda<br/>[AgendaScreen.tsx]"]
  node_appointment_form["Appointment editor"]
end

subgraph group_operations["Clinic operations"]
  node_patients["Patient management"]
  node_patients_export["Patient screen export<br/>[Pacientes.tsx]"]
  node_studies["Study catalog<br/>[StudiesScreen.tsx]"]
  node_reports["Reports and export<br/>[ReportesScreen.tsx]"]
  node_home["Home screen<br/>[HomeScreen.tsx]"]
  node_placeholder["Placeholder sections"]
end

subgraph group_platform["Application services"]
  node_firebase_status["Firebase status<br/>[FirebaseStatus.tsx]"]
  node_firebase_config["Firebase client setup<br/>[firebase.ts]"]
end

node_staff(("Clinic staff"))
node_auth_service{{"Firebase Auth"}}
node_firestore[("Cloud Firestore")]
node_browser_storage[("Browser local storage")]

node_staff -->|"opens dashboard"| node_entry
node_entry -->|"renders"| node_app
node_app -->|"shows when signed out"| node_login
node_app -->|"shows when signed in"| node_dashboard
node_app -->|"checks email"| node_allowlist
node_login -->|"checks email"| node_allowlist
node_login -->|"signs in"| node_auth_service
node_app -->|"observes session"| node_auth_service
node_app -->|"listens for activity"| node_firestore
node_dashboard -->|"renders navigation"| node_sidebar
node_app -->|"routes section"| node_agenda
node_app -->|"routes section"| node_patients_export
node_patients_export -->|"re-exports screen"| node_patients
node_app -->|"routes section"| node_studies
node_app -->|"routes section"| node_reports
node_app -->|"renders default section"| node_home
node_app -->|"renders pending sections"| node_placeholder
node_agenda -->|"renders editor"| node_appointment_form
node_agenda -->|"reads and writes appointments"| node_firestore
node_reports -->|"queries records and audit"| node_firestore
node_studies -->|"reads and writes studies"| node_browser_storage
node_firebase_config -->|"initializes client"| node_auth_service
node_firebase_config -->|"initializes client"| node_firestore
node_firebase_status -->|"uses client"| node_firebase_config

click node_entry "https://github.com/banfrij/imagenologiasigloxxi/blob/main/src/main.tsx"
click node_app "https://github.com/banfrij/imagenologiasigloxxi/blob/main/src/App.tsx"
click node_login "https://github.com/banfrij/imagenologiasigloxxi/blob/main/src/components/auth/LoginPanel.tsx"
click node_allowlist "https://github.com/banfrij/imagenologiasigloxxi/blob/main/src/constants/auth.ts"
click node_dashboard "https://github.com/banfrij/imagenologiasigloxxi/blob/main/src/components/layout/DashboardLayout.tsx"
click node_sidebar "https://github.com/banfrij/imagenologiasigloxxi/blob/main/src/components/Sidebar.tsx"
click node_agenda "https://github.com/banfrij/imagenologiasigloxxi/blob/main/src/screens/AgendaScreen.tsx"
click node_appointment_form "https://github.com/banfrij/imagenologiasigloxxi/blob/main/src/components/AppointmentForm.tsx"
click node_patients "https://github.com/banfrij/imagenologiasigloxxi/blob/main/src/screens/PacientesScreen.tsx"
click node_patients_export "https://github.com/banfrij/imagenologiasigloxxi/blob/main/src/screens/Pacientes.tsx"
click node_studies "https://github.com/banfrij/imagenologiasigloxxi/blob/main/src/screens/StudiesScreen.tsx"
click node_reports "https://github.com/banfrij/imagenologiasigloxxi/blob/main/src/screens/ReportesScreen.tsx"
click node_home "https://github.com/banfrij/imagenologiasigloxxi/blob/main/src/screens/HomeScreen.tsx"
click node_placeholder "https://github.com/banfrij/imagenologiasigloxxi/blob/main/src/screens/PlaceholderScreen.tsx"
click node_firebase_status "https://github.com/banfrij/imagenologiasigloxxi/blob/main/src/components/FirebaseStatus.tsx"
click node_firebase_config "https://github.com/banfrij/imagenologiasigloxxi/blob/main/src/firebase.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_entry,node_app,node_login,node_allowlist,node_dashboard,node_sidebar toneBlue
class node_agenda,node_appointment_form,node_firestore,node_browser_storage toneAmber
class node_patients,node_patients_export,node_studies,node_reports,node_home,node_placeholder toneMint
class node_firebase_status,node_firebase_config toneRose
class node_staff,node_auth_service toneIndigo
```

## Components

### Access and shell

- [React entry](https://github.com/banfrij/imagenologiasigloxxi/blob/main/src/main.tsx): `src/main.tsx`
- [App and routing](https://github.com/banfrij/imagenologiasigloxxi/blob/main/src/App.tsx): `src/App.tsx`
- [Login panel](https://github.com/banfrij/imagenologiasigloxxi/blob/main/src/components/auth/LoginPanel.tsx): `src/components/auth/LoginPanel.tsx`
- [Email allowlist](https://github.com/banfrij/imagenologiasigloxxi/blob/main/src/constants/auth.ts): `src/constants/auth.ts`
- [Dashboard layout](https://github.com/banfrij/imagenologiasigloxxi/blob/main/src/components/layout/DashboardLayout.tsx): `src/components/layout/DashboardLayout.tsx`
- [Section navigation](https://github.com/banfrij/imagenologiasigloxxi/blob/main/src/components/Sidebar.tsx): `src/components/Sidebar.tsx`

### Scheduling

- [Appointment agenda](https://github.com/banfrij/imagenologiasigloxxi/blob/main/src/screens/AgendaScreen.tsx): `src/screens/AgendaScreen.tsx`
- [Appointment editor](https://github.com/banfrij/imagenologiasigloxxi/blob/main/src/components/AppointmentForm.tsx): `src/components/AppointmentForm.tsx`

### Clinic operations

- [Patient management](https://github.com/banfrij/imagenologiasigloxxi/blob/main/src/screens/PacientesScreen.tsx): `src/screens/PacientesScreen.tsx`
- [Patient screen export](https://github.com/banfrij/imagenologiasigloxxi/blob/main/src/screens/Pacientes.tsx): `src/screens/Pacientes.tsx`
- [Study catalog](https://github.com/banfrij/imagenologiasigloxxi/blob/main/src/screens/StudiesScreen.tsx): `src/screens/StudiesScreen.tsx`
- [Reports and export](https://github.com/banfrij/imagenologiasigloxxi/blob/main/src/screens/ReportesScreen.tsx): `src/screens/ReportesScreen.tsx`
- [Home screen](https://github.com/banfrij/imagenologiasigloxxi/blob/main/src/screens/HomeScreen.tsx): `src/screens/HomeScreen.tsx`
- [Placeholder sections](https://github.com/banfrij/imagenologiasigloxxi/blob/main/src/screens/PlaceholderScreen.tsx): `src/screens/PlaceholderScreen.tsx`

### Application services

- [Firebase status](https://github.com/banfrij/imagenologiasigloxxi/blob/main/src/components/FirebaseStatus.tsx): `src/components/FirebaseStatus.tsx`
- [Firebase client setup](https://github.com/banfrij/imagenologiasigloxxi/blob/main/src/firebase.ts): `src/firebase.ts`

### Other components

- **Clinic staff**
- **Firebase Auth**
- **Cloud Firestore**
- **Browser local storage**

## Connections

- Clinic staff → React entry: opens dashboard (evidence: `src/main.tsx`)
- React entry → App and routing: renders (evidence: `src/main.tsx`)
- App and routing → Login panel: shows when signed out (evidence: `src/App.tsx`)
- App and routing → Dashboard layout: shows when signed in (evidence: `src/App.tsx`)
- App and routing → Email allowlist: checks email (evidence: `src/App.tsx`)
- Login panel → Email allowlist: checks email (evidence: `src/components/auth/LoginPanel.tsx`)
- Login panel → Firebase Auth: signs in (evidence: `src/components/auth/LoginPanel.tsx`)
- App and routing → Firebase Auth: observes session (evidence: `src/App.tsx`)
- App and routing → Cloud Firestore: listens for activity (evidence: `src/App.tsx`)
- Dashboard layout → Section navigation: renders navigation (evidence: `src/components/layout/DashboardLayout.tsx`)
- App and routing → Appointment agenda: routes section (evidence: `src/App.tsx`)
- App and routing → Patient screen export: routes section (evidence: `src/App.tsx`)
- Patient screen export → Patient management: re-exports screen (evidence: `src/screens/Pacientes.tsx`)
- App and routing → Study catalog: routes section (evidence: `src/App.tsx`)
- App and routing → Reports and export: routes section (evidence: `src/App.tsx`)
- App and routing → Home screen: renders default section (evidence: `src/App.tsx`)
- App and routing → Placeholder sections: renders pending sections (evidence: `src/App.tsx`)
- Appointment agenda → Appointment editor: renders editor (evidence: `src/screens/AgendaScreen.tsx`)
- Appointment agenda → Cloud Firestore: reads and writes appointments (evidence: `src/screens/AgendaScreen.tsx`)
- Reports and export → Cloud Firestore: queries records and audit (evidence: `src/screens/ReportesScreen.tsx`)
- Study catalog → Browser local storage: reads and writes studies (evidence: `src/screens/StudiesScreen.tsx`)
- Firebase client setup → Firebase Auth: initializes client (evidence: `src/firebase.ts`)
- Firebase client setup → Cloud Firestore: initializes client (evidence: `src/firebase.ts`)
- Firebase status → Firebase client setup: uses client (evidence: `src/components/FirebaseStatus.tsx`)
