# cxrphly/uniagenda-rev2 architecture

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

- Interactive diagram: https://gitdiagram.com/cxrphly/uniagenda-rev2
- Repository: https://github.com/cxrphly/uniagenda-rev2

## Overview

UniAgenda is a university agenda for organizing courses, class schedules, tasks, events, and notes. The user enters through the routed React app, signs in when Supabase is configured (or uses demo/offline mode), and manages academic records through the pages backed by a shared data context. That context writes locally and queues changes for synchronization; it also performs a full sync after login. Settings, dashboard, map display, reminders, and PWA installation are additional product branches. The README is empty and several page and sync implementations were not sampled, so uncertain internal calls are omitted.

Main entry points: [`client/src/App.tsx`](https://github.com/cxrphly/uniagenda-rev2/blob/main/client/src/App.tsx) (App routing), [`client/src/contexts/DataContext.tsx`](https://github.com/cxrphly/uniagenda-rev2/blob/main/client/src/contexts/DataContext.tsx) (Academic data), [`client/src/contexts/AuthContext.tsx`](https://github.com/cxrphly/uniagenda-rev2/blob/main/client/src/contexts/AuthContext.tsx) (Authentication), [`client/src/pages/Tarefas.tsx`](https://github.com/cxrphly/uniagenda-rev2/blob/main/client/src/pages/Tarefas.tsx) (Tasks)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and access"]
  node_app["App routing<br/>[App.tsx]"]
  node_auth["Authentication<br/>[AuthContext.tsx]"]
  node_login["Login page<br/>[Login.tsx]"]
end

subgraph group_academic["Academic planning"]
  node_dashboard["Dashboard<br/>[Dashboard.tsx]"]
  node_courses["Courses<br/>[Disciplinas.tsx]"]
  node_timetable["Class schedule<br/>[Horarios.tsx]"]
  node_tasks["Tasks<br/>[Tarefas.tsx]"]
  node_events["Events<br/>[Eventos.tsx]"]
  node_notes["Notes<br/>[Anotacoes.tsx]"]
  node_settings["Settings<br/>[Configuracoes.tsx]"]
  node_map["Map view<br/>[Map.tsx]"]
end

subgraph group_data["Data and sync"]
  node_data_context["Academic data<br/>[DataContext.tsx]"]
  node_localdb[("Local database<br/>[db.ts]")]
  node_sync["Sync engine<br/>[sync.ts]"]
  node_supabase_client["Supabase client<br/>[supabase.ts]"]
end

subgraph group_experience["App experience"]
  node_notifications["Task reminders<br/>[notifications.ts]"]
  node_pwa_banner["Install banner"]
  node_pwa_hook["PWA support<br/>[usePWA.ts]"]
  node_service_worker["Service worker<br/>[sw.js]"]
end

node_student(("Student"))
node_supabase[("Supabase service")]

node_student -->|"opens"| node_app
node_app -->|"provides auth"| node_auth
node_app -->|"shows when signed out"| node_login
node_auth -->|"uses"| node_supabase_client
node_supabase_client -->|"connects"| node_supabase
node_app -->|"routes"| node_dashboard
node_app -->|"routes"| node_courses
node_app -->|"routes"| node_timetable
node_app -->|"routes"| node_tasks
node_app -->|"routes"| node_events
node_app -->|"routes"| node_notes
node_app -->|"routes"| node_settings
node_app -->|"renders"| node_map
node_app -->|"provides data"| node_data_context
node_data_context -->|"reads user"| node_auth
node_data_context -->|"reads and writes"| node_localdb
node_data_context -->|"queues changes"| node_sync
node_data_context -->|"starts full sync"| node_sync
node_data_context -->|"provides data"| node_dashboard
node_data_context -->|"provides data"| node_courses
node_data_context -->|"provides data"| node_timetable
node_data_context -->|"provides data"| node_tasks
node_data_context -->|"provides data"| node_events
node_data_context -->|"provides data"| node_notes
node_tasks -->|"schedules reminders"| node_notifications
node_app -->|"renders"| node_pwa_banner
node_pwa_banner -->|"uses"| node_pwa_hook
node_pwa_hook -->|"registers"| node_service_worker

click node_app "https://github.com/cxrphly/uniagenda-rev2/blob/main/client/src/App.tsx"
click node_auth "https://github.com/cxrphly/uniagenda-rev2/blob/main/client/src/contexts/AuthContext.tsx"
click node_login "https://github.com/cxrphly/uniagenda-rev2/blob/main/client/src/pages/Login.tsx"
click node_dashboard "https://github.com/cxrphly/uniagenda-rev2/blob/main/client/src/pages/Dashboard.tsx"
click node_courses "https://github.com/cxrphly/uniagenda-rev2/blob/main/client/src/pages/Disciplinas.tsx"
click node_timetable "https://github.com/cxrphly/uniagenda-rev2/blob/main/client/src/pages/Horarios.tsx"
click node_tasks "https://github.com/cxrphly/uniagenda-rev2/blob/main/client/src/pages/Tarefas.tsx"
click node_events "https://github.com/cxrphly/uniagenda-rev2/blob/main/client/src/pages/Eventos.tsx"
click node_notes "https://github.com/cxrphly/uniagenda-rev2/blob/main/client/src/pages/Anotacoes.tsx"
click node_settings "https://github.com/cxrphly/uniagenda-rev2/blob/main/client/src/pages/Configuracoes.tsx"
click node_map "https://github.com/cxrphly/uniagenda-rev2/blob/main/client/src/components/Map.tsx"
click node_data_context "https://github.com/cxrphly/uniagenda-rev2/blob/main/client/src/contexts/DataContext.tsx"
click node_localdb "https://github.com/cxrphly/uniagenda-rev2/blob/main/client/src/lib/db.ts"
click node_sync "https://github.com/cxrphly/uniagenda-rev2/blob/main/client/src/lib/sync.ts"
click node_supabase_client "https://github.com/cxrphly/uniagenda-rev2/blob/main/client/src/lib/supabase.ts"
click node_notifications "https://github.com/cxrphly/uniagenda-rev2/blob/main/client/src/lib/notifications.ts"
click node_pwa_banner "https://github.com/cxrphly/uniagenda-rev2/blob/main/client/src/components/PWAInstallBanner.tsx"
click node_pwa_hook "https://github.com/cxrphly/uniagenda-rev2/blob/main/client/src/hooks/usePWA.ts"
click node_service_worker "https://github.com/cxrphly/uniagenda-rev2/blob/main/client/public/sw.js"

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_login toneBlue
class node_dashboard,node_courses,node_timetable,node_tasks,node_events,node_notes,node_settings,node_map,node_supabase toneAmber
class node_data_context,node_localdb,node_sync,node_supabase_client toneMint
class node_notifications,node_pwa_banner,node_pwa_hook,node_service_worker toneRose
class node_student toneIndigo
```

## Components

### App and access

- [App routing](https://github.com/cxrphly/uniagenda-rev2/blob/main/client/src/App.tsx): `client/src/App.tsx`
- [Authentication](https://github.com/cxrphly/uniagenda-rev2/blob/main/client/src/contexts/AuthContext.tsx): `client/src/contexts/AuthContext.tsx`
- [Login page](https://github.com/cxrphly/uniagenda-rev2/blob/main/client/src/pages/Login.tsx): `client/src/pages/Login.tsx`

### Academic planning

- [Dashboard](https://github.com/cxrphly/uniagenda-rev2/blob/main/client/src/pages/Dashboard.tsx): `client/src/pages/Dashboard.tsx`
- [Courses](https://github.com/cxrphly/uniagenda-rev2/blob/main/client/src/pages/Disciplinas.tsx): `client/src/pages/Disciplinas.tsx`
- [Class schedule](https://github.com/cxrphly/uniagenda-rev2/blob/main/client/src/pages/Horarios.tsx): `client/src/pages/Horarios.tsx`
- [Tasks](https://github.com/cxrphly/uniagenda-rev2/blob/main/client/src/pages/Tarefas.tsx): `client/src/pages/Tarefas.tsx`
- [Events](https://github.com/cxrphly/uniagenda-rev2/blob/main/client/src/pages/Eventos.tsx): `client/src/pages/Eventos.tsx`
- [Notes](https://github.com/cxrphly/uniagenda-rev2/blob/main/client/src/pages/Anotacoes.tsx): `client/src/pages/Anotacoes.tsx`
- [Settings](https://github.com/cxrphly/uniagenda-rev2/blob/main/client/src/pages/Configuracoes.tsx): `client/src/pages/Configuracoes.tsx`
- [Map view](https://github.com/cxrphly/uniagenda-rev2/blob/main/client/src/components/Map.tsx): `client/src/components/Map.tsx`

### Data and sync

- [Academic data](https://github.com/cxrphly/uniagenda-rev2/blob/main/client/src/contexts/DataContext.tsx): `client/src/contexts/DataContext.tsx`
- [Local database](https://github.com/cxrphly/uniagenda-rev2/blob/main/client/src/lib/db.ts): `client/src/lib/db.ts`
- [Sync engine](https://github.com/cxrphly/uniagenda-rev2/blob/main/client/src/lib/sync.ts): `client/src/lib/sync.ts`
- [Supabase client](https://github.com/cxrphly/uniagenda-rev2/blob/main/client/src/lib/supabase.ts): `client/src/lib/supabase.ts`

### App experience

- [Task reminders](https://github.com/cxrphly/uniagenda-rev2/blob/main/client/src/lib/notifications.ts): `client/src/lib/notifications.ts`
- [Install banner](https://github.com/cxrphly/uniagenda-rev2/blob/main/client/src/components/PWAInstallBanner.tsx): `client/src/components/PWAInstallBanner.tsx`
- [PWA support](https://github.com/cxrphly/uniagenda-rev2/blob/main/client/src/hooks/usePWA.ts): `client/src/hooks/usePWA.ts`
- [Service worker](https://github.com/cxrphly/uniagenda-rev2/blob/main/client/public/sw.js): `client/public/sw.js`

### Other components

- **Student**
- **Supabase service**

## Connections

- Student → App routing: opens
- App routing → Authentication: provides auth
- App routing → Login page: shows when signed out
- Authentication → Supabase client: uses
- Supabase client → Supabase service: connects
- App routing → Dashboard: routes
- App routing → Courses: routes
- App routing → Class schedule: routes
- App routing → Tasks: routes
- App routing → Events: routes
- App routing → Notes: routes
- App routing → Settings: routes
- App routing → Map view: renders
- App routing → Academic data: provides data
- Academic data → Authentication: reads user
- Academic data → Local database: reads and writes
- Academic data → Sync engine: queues changes
- Academic data → Sync engine: starts full sync
- Academic data → Dashboard: provides data
- Academic data → Courses: provides data
- Academic data → Class schedule: provides data
- Academic data → Tasks: provides data
- Academic data → Events: provides data
- Academic data → Notes: provides data
- Tasks → Task reminders: schedules reminders
- App routing → Install banner: renders
- Install banner → PWA support: uses
- PWA support → Service worker: registers
