# escall-dev/seijun architecture

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

- Interactive diagram: https://gitdiagram.com/escall-dev/seijun
- Repository: https://github.com/escall-dev/seijun

## Overview

Seijun is a reproductive-health tracking app whose main workflow is signing in, recording cycle and symptom data, and reviewing it through a dashboard and calendar. Notes, partner sharing, reminders, notifications, and account settings extend that workflow. Supabase provides server-side identity and data access; cycle calculations and cycle-context resolution supply shared domain logic. The graph follows documented and indexed references; unsampled modules are represented at subsystem level, and edges are limited to evidenced relationships.

Main entry points: [`lib/supabase/server.ts`](https://github.com/escall-dev/seijun/blob/main/lib/supabase/server.ts) (Server client), [`app/dashboard/page.tsx`](https://github.com/escall-dev/seijun/blob/main/app/dashboard/page.tsx) (Dashboard), [`components/calendar/calendar-view.tsx`](https://github.com/escall-dev/seijun/blob/main/components/calendar/calendar-view.tsx) (Calendar), [`lib/reminders/processor.ts`](https://github.com/escall-dev/seijun/blob/main/lib/reminders/processor.ts) (Reminder processor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_auth["Authentication<br/>[auth.ts]"]
  node_dashboard["Dashboard<br/>[page.tsx]"]
  node_settings["Settings<br/>[page.tsx]"]
end

subgraph group_tracking["Health tracking"]
  node_calendar["Calendar<br/>[calendar-view.tsx]"]
  node_cycles["Cycle tracking<br/>[cycles.ts]"]
  node_symptoms["Symptom logging<br/>[symptoms.ts]"]
  node_cyclemath["Cycle calculations"]
  node_notes["Daily notes<br/>[server.ts]"]
end

subgraph group_partner["Partner sharing"]
  node_partnerdash["Partner dashboard"]
  node_partneractions["Partner actions<br/>[partner-shared.ts]"]
  node_partnerservice["Partner services<br/>[service.ts]"]
  node_cyclecontext["Cycle context<br/>[server.ts]"]
end

subgraph group_messaging["Notifications"]
  node_notifications["Notifications<br/>[notifications.ts]"]
  node_remindercron["Reminder endpoint<br/>[route.ts]"]
  node_reminderprocessor["Reminder processor<br/>[processor.ts]"]
  node_reminderengine["Reminder engine<br/>[engine.ts]"]
  node_push["Push delivery<br/>[web-push.ts]"]
end

subgraph group_platform["Server and data"]
  node_supabaseclient["Server client<br/>[server.ts]"]
  node_profile["Profile lookup<br/>[profile.ts]"]
  node_database[("Supabase data<br/>[types.ts]")]
end

node_user(("User"))
node_browser(("Browser"))

node_user -->|"signs in"| node_auth
node_auth -->|"authenticates with"| node_supabaseclient
node_user -->|"views"| node_dashboard
node_dashboard -->|"loads"| node_cycles
node_dashboard -->|"loads"| node_symptoms
node_dashboard -->|"calculates with"| node_cyclemath
node_user -->|"reviews and logs"| node_calendar
node_calendar -->|"calls actions"| node_cycles
node_calendar -->|"calls actions"| node_symptoms
node_calendar -->|"opens editor"| node_notes
node_cycles -->|"calculates with"| node_cyclemath
node_cycles -->|"queries through"| node_supabaseclient
node_symptoms -->|"queries through"| node_supabaseclient
node_notes -->|"queries through"| node_supabaseclient
node_user -->|"views sharing"| node_partnerdash
node_partnerdash -->|"calls"| node_partneractions
node_partneractions -.->|"delegates to"| node_partnerservice
node_cyclecontext -->|"loads profile"| node_profile
node_cyclecontext -->|"reads relationship data"| node_supabaseclient
node_partneractions -->|"queries through"| node_supabaseclient
node_user -->|"configures account"| node_settings
node_settings -->|"loads preferences"| node_supabaseclient
node_remindercron -->|"invokes"| node_reminderprocessor
node_reminderprocessor -.->|"uses"| node_reminderengine
node_reminderprocessor -->|"sends via"| node_push
node_reminderprocessor -->|"reads and writes"| node_supabaseclient
node_notifications -.->|"queries through"| node_supabaseclient
node_supabaseclient -->|"accesses typed data"| node_database
node_browser -.->|"receives push"| node_push

click node_auth "https://github.com/escall-dev/seijun/blob/main/app/actions/auth.ts"
click node_dashboard "https://github.com/escall-dev/seijun/blob/main/app/dashboard/page.tsx"
click node_calendar "https://github.com/escall-dev/seijun/blob/main/components/calendar/calendar-view.tsx"
click node_cycles "https://github.com/escall-dev/seijun/blob/main/app/actions/cycles.ts"
click node_symptoms "https://github.com/escall-dev/seijun/blob/main/app/actions/symptoms.ts"
click node_cyclemath "https://github.com/escall-dev/seijun/blob/main/lib/calculations/cycle-calculations.ts"
click node_notes "https://github.com/escall-dev/seijun/blob/main/lib/notes/server.ts"
click node_partnerdash "https://github.com/escall-dev/seijun/blob/main/components/partner/partner-dashboard-view.tsx"
click node_partneractions "https://github.com/escall-dev/seijun/blob/main/app/actions/partner-shared.ts"
click node_partnerservice "https://github.com/escall-dev/seijun/blob/main/lib/partner/service.ts"
click node_cyclecontext "https://github.com/escall-dev/seijun/blob/main/lib/cycle-context/server.ts"
click node_settings "https://github.com/escall-dev/seijun/blob/main/app/settings/page.tsx"
click node_notifications "https://github.com/escall-dev/seijun/blob/main/app/actions/notifications.ts"
click node_remindercron "https://github.com/escall-dev/seijun/blob/main/app/api/cron/reminders/route.ts"
click node_reminderprocessor "https://github.com/escall-dev/seijun/blob/main/lib/reminders/processor.ts"
click node_reminderengine "https://github.com/escall-dev/seijun/blob/main/lib/reminders/engine.ts"
click node_push "https://github.com/escall-dev/seijun/blob/main/lib/server/web-push.ts"
click node_supabaseclient "https://github.com/escall-dev/seijun/blob/main/lib/supabase/server.ts"
click node_profile "https://github.com/escall-dev/seijun/blob/main/lib/server/profile.ts"
click node_database "https://github.com/escall-dev/seijun/blob/main/lib/supabase/types.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_auth,node_dashboard,node_settings,node_user,node_browser toneBlue
class node_calendar,node_cycles,node_symptoms,node_cyclemath,node_notes toneAmber
class node_partnerdash,node_partneractions,node_partnerservice,node_cyclecontext toneMint
class node_notifications,node_remindercron,node_reminderprocessor,node_reminderengine,node_push toneRose
class node_supabaseclient,node_profile,node_database toneIndigo
```

## Components

### User experience

- [Authentication](https://github.com/escall-dev/seijun/blob/main/app/actions/auth.ts): `app/actions/auth.ts`
- [Dashboard](https://github.com/escall-dev/seijun/blob/main/app/dashboard/page.tsx): `app/dashboard/page.tsx`
- [Settings](https://github.com/escall-dev/seijun/blob/main/app/settings/page.tsx): `app/settings/page.tsx`

### Health tracking

- [Calendar](https://github.com/escall-dev/seijun/blob/main/components/calendar/calendar-view.tsx): `components/calendar/calendar-view.tsx`
- [Cycle tracking](https://github.com/escall-dev/seijun/blob/main/app/actions/cycles.ts): `app/actions/cycles.ts`
- [Symptom logging](https://github.com/escall-dev/seijun/blob/main/app/actions/symptoms.ts): `app/actions/symptoms.ts`
- [Cycle calculations](https://github.com/escall-dev/seijun/blob/main/lib/calculations/cycle-calculations.ts): `lib/calculations/cycle-calculations.ts`
- [Daily notes](https://github.com/escall-dev/seijun/blob/main/lib/notes/server.ts): `lib/notes/server.ts`

### Partner sharing

- [Partner dashboard](https://github.com/escall-dev/seijun/blob/main/components/partner/partner-dashboard-view.tsx): `components/partner/partner-dashboard-view.tsx`
- [Partner actions](https://github.com/escall-dev/seijun/blob/main/app/actions/partner-shared.ts): `app/actions/partner-shared.ts`
- [Partner services](https://github.com/escall-dev/seijun/blob/main/lib/partner/service.ts): `lib/partner/service.ts`
- [Cycle context](https://github.com/escall-dev/seijun/blob/main/lib/cycle-context/server.ts): `lib/cycle-context/server.ts`

### Notifications

- [Notifications](https://github.com/escall-dev/seijun/blob/main/app/actions/notifications.ts): `app/actions/notifications.ts`
- [Reminder endpoint](https://github.com/escall-dev/seijun/blob/main/app/api/cron/reminders/route.ts): `app/api/cron/reminders/route.ts`
- [Reminder processor](https://github.com/escall-dev/seijun/blob/main/lib/reminders/processor.ts): `lib/reminders/processor.ts`
- [Reminder engine](https://github.com/escall-dev/seijun/blob/main/lib/reminders/engine.ts): `lib/reminders/engine.ts`
- [Push delivery](https://github.com/escall-dev/seijun/blob/main/lib/server/web-push.ts): `lib/server/web-push.ts`

### Server and data

- [Server client](https://github.com/escall-dev/seijun/blob/main/lib/supabase/server.ts): `lib/supabase/server.ts`
- [Profile lookup](https://github.com/escall-dev/seijun/blob/main/lib/server/profile.ts): `lib/server/profile.ts`
- [Supabase data](https://github.com/escall-dev/seijun/blob/main/lib/supabase/types.ts): `lib/supabase/types.ts`

### Other components

- **User**
- **Browser**

## Connections

- User → Authentication: signs in
- Authentication → Server client: authenticates with (evidence: `lib/supabase/server.ts`)
- User → Dashboard: views (evidence: `app/dashboard/page.tsx`)
- Dashboard → Cycle tracking: loads (evidence: `app/dashboard/page.tsx`)
- Dashboard → Symptom logging: loads (evidence: `app/dashboard/page.tsx`)
- Dashboard → Cycle calculations: calculates with (evidence: `app/dashboard/page.tsx`)
- User → Calendar: reviews and logs (evidence: `components/calendar/calendar-view.tsx`)
- Calendar → Cycle tracking: calls actions (evidence: `components/calendar/calendar-view.tsx`)
- Calendar → Symptom logging: calls actions (evidence: `components/calendar/calendar-view.tsx`)
- Calendar → Daily notes: opens editor (evidence: `components/calendar/calendar-view.tsx`)
- Cycle tracking → Cycle calculations: calculates with (evidence: `app/actions/cycles.ts`)
- Cycle tracking → Server client: queries through (evidence: `app/actions/cycles.ts`)
- Symptom logging → Server client: queries through (evidence: `app/actions/symptoms.ts`)
- Daily notes → Server client: queries through (evidence: `lib/notes/server.ts`)
- User → Partner dashboard: views sharing
- Partner dashboard → Partner actions: calls (evidence: `components/partner/partner-dashboard-view.tsx`)
- Partner actions → Partner services: delegates to
- Cycle context → Profile lookup: loads profile (evidence: `lib/cycle-context/server.ts`)
- Cycle context → Server client: reads relationship data (evidence: `lib/cycle-context/server.ts`)
- Partner actions → Server client: queries through (evidence: `app/actions/partner-shared.ts`)
- User → Settings: configures account (evidence: `app/settings/page.tsx`)
- Settings → Server client: loads preferences (evidence: `app/settings/page.tsx`)
- Reminder endpoint → Reminder processor: invokes (evidence: `app/api/cron/reminders/route.ts`)
- Reminder processor → Reminder engine: uses
- Reminder processor → Push delivery: sends via (evidence: `lib/reminders/processor.ts`)
- Reminder processor → Server client: reads and writes (evidence: `lib/reminders/processor.ts`)
- Notifications → Server client: queries through
- Server client → Supabase data: accesses typed data (evidence: `lib/supabase/server.ts`)
- Browser → Push delivery: receives push
