# iggy14/remindu architecture

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

- Interactive diagram: https://gitdiagram.com/iggy14/remindu
- Repository: https://github.com/iggy14/remindu

## Overview

RemindU turns a person’s natural-language request into a confirmed reminder, stores it as private or group-shared responsibility, computes due dates deterministically, and delivers scheduled push notifications. The main path runs from chat through server-side AI interpretation and rule validation to reminder persistence; users can also manage reminders directly, organize a shared group, and configure notifications. The graph preserves documented features and indicates where unsampled implementation details limit relationship evidence.

Main entry points: [`src/ai/server/respond.ts`](https://github.com/iggy14/remindu/blob/main/src/ai/server/respond.ts) (AI response builder), [`api/send-reminders.ts`](https://github.com/iggy14/remindu/blob/main/api/send-reminders.ts) (Scheduled reminder sender), [`src/App.tsx`](https://github.com/iggy14/remindu/blob/main/src/App.tsx) (App shell), [`api/ai/chat.ts`](https://github.com/iggy14/remindu/blob/main/api/ai/chat.ts) (AI chat endpoint)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["App experience"]
  node_app["App shell<br/>[App.tsx]"]
  node_chat_ui["Chat UI<br/>[Chat.tsx]"]
  node_chat_hook["Chat workflow<br/>[useReminderChat.ts]"]
  node_reminder_ui["Reminder screens<br/>[Reminders.tsx]"]
  node_settings_groups["Settings and groups"]
  node_auth_ui["Sign-in screen<br/>[AuthScreen.tsx]"]
end

subgraph group_ai["AI interpretation"]
  node_api_chat["AI chat endpoint<br/>[chat.ts]"]
  node_ai_response["AI response builder<br/>[respond.ts]"]
  node_ai_prompt["Prompt and model<br/>[prompt.ts]"]
  node_intent_router["Intent router<br/>[route.ts]"]
  node_interpretation["Draft interpretation<br/>[interpret.ts]"]
  node_edit_logic["Edit handling<br/>[applyEdit.ts]"]
  node_ai_schema["AI schema<br/>[schema.ts]"]
  node_date_resolution["Date resolution<br/>[resolveDate.ts]"]
end

subgraph group_rules["Reminder rules"]
  node_rule_engine{{"Rule scheduler<br/>[index.ts]"}}
  node_rule_dates["Date calculations<br/>[dates.ts]"]
end

subgraph group_data["Identity and data"]
  node_responsibility_hook["Reminder data hook"]
  node_responsibilities["Reminder persistence"]
  node_supabase_client["Supabase client<br/>[supabase.ts]"]
  node_auth["Auth context<br/>[auth.ts]"]
end

subgraph group_delivery["Notification delivery"]
  node_reminder_job["Scheduled reminder sender<br/>[send-reminders.ts]"]
  node_push_payload["Push payload builder<br/>[pushPayload.ts]"]
  node_service_worker["Push service worker<br/>[push-sw.js]"]
end

node_person(("Person"))
node_supabase[("Supabase Auth and Postgres")]
node_push_service["Web Push service"]
node_cron["Supabase pg_cron"]

node_person -->|"uses"| node_app
node_app -->|"shows when signed out"| node_auth_ui
node_app -->|"checks configuration"| node_supabase_client
node_person -->|"describes reminder"| node_chat_ui
node_chat_ui -->|"uses workflow"| node_chat_hook
node_chat_hook -.->|"submits chat"| node_api_chat
node_api_chat -->|"delegates response"| node_ai_response
node_api_chat -->|"authenticates and loads items"| node_supabase
node_ai_response -->|"builds response"| node_ai_prompt
node_ai_response -->|"routes extracted intent"| node_intent_router
node_ai_response -->|"validates extraction"| node_ai_schema
node_intent_router -->|"interprets additions"| node_interpretation
node_intent_router -->|"applies edits"| node_edit_logic
node_interpretation -->|"resolves dates"| node_date_resolution
node_interpretation -->|"uses extracted fields"| node_ai_schema
node_person -->|"manages reminders"| node_reminder_ui
node_reminder_ui -->|"loads and mutates"| node_responsibility_hook
node_responsibility_hook -->|"calls data operations"| node_responsibilities
node_responsibilities -->|"reads and writes"| node_supabase_client
node_responsibilities -->|"plans reminder dates"| node_rule_engine
node_rule_engine -->|"uses date functions"| node_rule_dates
node_auth -.->|"provides authentication"| node_supabase
node_person -->|"configures group and alerts"| node_settings_groups
node_cron -->|"invokes periodically"| node_reminder_job
node_reminder_job -->|"queries due reminders"| node_supabase
node_reminder_job -->|"builds notification"| node_push_payload
node_push_payload -->|"formats due dates"| node_rule_dates
node_reminder_job -->|"sends push"| node_push_service
node_push_service -.->|"delivers notification"| node_service_worker

click node_app "https://github.com/iggy14/remindu/blob/main/src/App.tsx"
click node_chat_ui "https://github.com/iggy14/remindu/blob/main/src/pages/Chat.tsx"
click node_chat_hook "https://github.com/iggy14/remindu/blob/main/src/hooks/useReminderChat.ts"
click node_reminder_ui "https://github.com/iggy14/remindu/blob/main/src/pages/Reminders.tsx"
click node_settings_groups "https://github.com/iggy14/remindu/tree/main/src/components"
click node_auth_ui "https://github.com/iggy14/remindu/blob/main/src/components/AuthScreen.tsx"
click node_api_chat "https://github.com/iggy14/remindu/blob/main/api/ai/chat.ts"
click node_ai_response "https://github.com/iggy14/remindu/blob/main/src/ai/server/respond.ts"
click node_ai_prompt "https://github.com/iggy14/remindu/blob/main/src/ai/server/prompt.ts"
click node_intent_router "https://github.com/iggy14/remindu/blob/main/src/ai/route.ts"
click node_interpretation "https://github.com/iggy14/remindu/blob/main/src/ai/interpret.ts"
click node_edit_logic "https://github.com/iggy14/remindu/blob/main/src/ai/applyEdit.ts"
click node_ai_schema "https://github.com/iggy14/remindu/blob/main/src/ai/schema.ts"
click node_date_resolution "https://github.com/iggy14/remindu/blob/main/src/ai/resolveDate.ts"
click node_rule_engine "https://github.com/iggy14/remindu/blob/main/src/ruleEngine/index.ts"
click node_rule_dates "https://github.com/iggy14/remindu/blob/main/src/ruleEngine/dates.ts"
click node_responsibility_hook "https://github.com/iggy14/remindu/blob/main/src/hooks/useResponsibilities.ts"
click node_responsibilities "https://github.com/iggy14/remindu/blob/main/src/lib/responsibilities.ts"
click node_supabase_client "https://github.com/iggy14/remindu/blob/main/src/lib/supabase.ts"
click node_auth "https://github.com/iggy14/remindu/blob/main/src/lib/auth.ts"
click node_reminder_job "https://github.com/iggy14/remindu/blob/main/api/send-reminders.ts"
click node_push_payload "https://github.com/iggy14/remindu/blob/main/api/_lib/pushPayload.ts"
click node_service_worker "https://github.com/iggy14/remindu/blob/main/public/push-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_chat_ui,node_chat_hook,node_reminder_ui,node_settings_groups,node_auth_ui toneBlue
class node_api_chat,node_ai_response,node_ai_prompt,node_intent_router,node_interpretation,node_edit_logic,node_ai_schema,node_date_resolution,node_supabase toneAmber
class node_rule_engine,node_rule_dates toneMint
class node_responsibility_hook,node_responsibilities,node_supabase_client,node_auth toneRose
class node_reminder_job,node_push_payload,node_service_worker,node_person,node_push_service,node_cron toneIndigo
```

## Components

### App experience

- [App shell](https://github.com/iggy14/remindu/blob/main/src/App.tsx): `src/App.tsx`
- [Chat UI](https://github.com/iggy14/remindu/blob/main/src/pages/Chat.tsx): `src/pages/Chat.tsx`
- [Chat workflow](https://github.com/iggy14/remindu/blob/main/src/hooks/useReminderChat.ts): `src/hooks/useReminderChat.ts`
- [Reminder screens](https://github.com/iggy14/remindu/blob/main/src/pages/Reminders.tsx): `src/pages/Reminders.tsx`
- [Settings and groups](https://github.com/iggy14/remindu/tree/main/src/components): `src/components`
- [Sign-in screen](https://github.com/iggy14/remindu/blob/main/src/components/AuthScreen.tsx): `src/components/AuthScreen.tsx`

### AI interpretation

- [AI chat endpoint](https://github.com/iggy14/remindu/blob/main/api/ai/chat.ts): `api/ai/chat.ts`
- [AI response builder](https://github.com/iggy14/remindu/blob/main/src/ai/server/respond.ts): `src/ai/server/respond.ts`
- [Prompt and model](https://github.com/iggy14/remindu/blob/main/src/ai/server/prompt.ts): `src/ai/server/prompt.ts`
- [Intent router](https://github.com/iggy14/remindu/blob/main/src/ai/route.ts): `src/ai/route.ts`
- [Draft interpretation](https://github.com/iggy14/remindu/blob/main/src/ai/interpret.ts): `src/ai/interpret.ts`
- [Edit handling](https://github.com/iggy14/remindu/blob/main/src/ai/applyEdit.ts): `src/ai/applyEdit.ts`
- [AI schema](https://github.com/iggy14/remindu/blob/main/src/ai/schema.ts): `src/ai/schema.ts`
- [Date resolution](https://github.com/iggy14/remindu/blob/main/src/ai/resolveDate.ts): `src/ai/resolveDate.ts`

### Reminder rules

- [Rule scheduler](https://github.com/iggy14/remindu/blob/main/src/ruleEngine/index.ts): `src/ruleEngine/index.ts`
- [Date calculations](https://github.com/iggy14/remindu/blob/main/src/ruleEngine/dates.ts): `src/ruleEngine/dates.ts`

### Identity and data

- [Reminder data hook](https://github.com/iggy14/remindu/blob/main/src/hooks/useResponsibilities.ts): `src/hooks/useResponsibilities.ts`
- [Reminder persistence](https://github.com/iggy14/remindu/blob/main/src/lib/responsibilities.ts): `src/lib/responsibilities.ts`
- [Supabase client](https://github.com/iggy14/remindu/blob/main/src/lib/supabase.ts): `src/lib/supabase.ts`
- [Auth context](https://github.com/iggy14/remindu/blob/main/src/lib/auth.ts): `src/lib/auth.ts`

### Notification delivery

- [Scheduled reminder sender](https://github.com/iggy14/remindu/blob/main/api/send-reminders.ts): `api/send-reminders.ts`
- [Push payload builder](https://github.com/iggy14/remindu/blob/main/api/_lib/pushPayload.ts): `api/_lib/pushPayload.ts`
- [Push service worker](https://github.com/iggy14/remindu/blob/main/public/push-sw.js): `public/push-sw.js`

### Other components

- **Person**
- **Supabase Auth and Postgres**
- **Web Push service**
- **Supabase pg_cron**

## Connections

- Person → App shell: uses
- App shell → Sign-in screen: shows when signed out (evidence: `src/App.tsx`)
- App shell → Supabase client: checks configuration (evidence: `src/App.tsx`)
- Person → Chat UI: describes reminder
- Chat UI → Chat workflow: uses workflow (evidence: `src/pages/Chat.tsx`)
- Chat workflow → AI chat endpoint: submits chat
- AI chat endpoint → AI response builder: delegates response (evidence: `api/ai/chat.ts`)
- AI chat endpoint → Supabase Auth and Postgres: authenticates and loads items (evidence: `api/ai/chat.ts`)
- AI response builder → Prompt and model: builds response (evidence: `src/ai/server/respond.ts`)
- AI response builder → Intent router: routes extracted intent (evidence: `src/ai/server/respond.ts`)
- AI response builder → AI schema: validates extraction (evidence: `src/ai/server/respond.ts`)
- Intent router → Draft interpretation: interprets additions (evidence: `src/ai/route.ts`)
- Intent router → Edit handling: applies edits (evidence: `src/ai/route.ts`)
- Draft interpretation → Date resolution: resolves dates (evidence: `src/ai/interpret.ts`)
- Draft interpretation → AI schema: uses extracted fields (evidence: `src/ai/interpret.ts`)
- Person → Reminder screens: manages reminders
- Reminder screens → Reminder data hook: loads and mutates (evidence: `src/pages/Reminders.tsx`)
- Reminder data hook → Reminder persistence: calls data operations (evidence: `src/hooks/useResponsibilities.ts`)
- Reminder persistence → Supabase client: reads and writes (evidence: `src/lib/responsibilities.ts`)
- Reminder persistence → Rule scheduler: plans reminder dates (evidence: `src/lib/responsibilities.ts`)
- Rule scheduler → Date calculations: uses date functions (evidence: `src/ruleEngine/index.ts`)
- Auth context → Supabase Auth and Postgres: provides authentication
- Person → Settings and groups: configures group and alerts
- Supabase pg_cron → Scheduled reminder sender: invokes periodically
- Scheduled reminder sender → Supabase Auth and Postgres: queries due reminders
- Scheduled reminder sender → Push payload builder: builds notification (evidence: `api/send-reminders.ts`)
- Push payload builder → Date calculations: formats due dates (evidence: `api/_lib/pushPayload.ts`)
- Scheduled reminder sender → Web Push service: sends push
- Web Push service → Push service worker: delivers notification
