# icssc/antalmanac architecture

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

- Interactive diagram: https://gitdiagram.com/icssc/antalmanac
- Repository: https://github.com/icssc/antalmanac

## Overview

AntAlmanac Scheduler is a UC Irvine quarterly course-planning web app, accompanied by an iOS WebView wrapper and AANTS, a service that emails subscribers about enrollment changes. The web workflow is course search, section inspection, and schedule planning, with calendar, map, grade, enrollment, and review features. Its backend exposes typed API access and persists user and schedule data. AANTS scans subscriptions, checks section changes, and queues rendered email notifications. Web backend wiring and several feature implementations are represented at directory level; the shown excerpts do not establish their precise call paths.

Main entry points: [`apps/antalmanac/src/app/(main)`](https://github.com/icssc/antalmanac/tree/main/apps/antalmanac/src/app/(main)) (Scheduler UI), [`apps/aants/src/index.ts`](https://github.com/icssc/antalmanac/blob/main/apps/aants/src/index.ts) (Subscription Scan), [`apps/antalmanac/src/components/RightPane/SectionTable`](https://github.com/icssc/antalmanac/tree/main/apps/antalmanac/src/components/RightPane/SectionTable) (Section Details), [`apps/antalmanac/src/backend/routers`](https://github.com/icssc/antalmanac/tree/main/apps/antalmanac/src/backend/routers) (API Routers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_planning["Course Planning"]
  node_scheduler["Scheduler UI"]
  node_course_search["Course Search"]
  node_section_info["Section Details"]
  node_calendar["Schedule Calendar"]
  node_schedule_state["Schedule State<br/>[Schedules.ts]"]
  node_map["Campus Map"]
  node_course_insights["Course Insights"]
  node_review_flow["Instructor Reviews"]
end

subgraph group_backend["Web Backend"]
  node_trpc_api["tRPC API<br/>[trpc.ts]"]
  node_routers["API Routers"]
  node_rds["RDS Access"]
end

subgraph group_notifications["Email Notifications"]
  node_aants_scan["Subscription Scan<br/>[index.ts]"]
  node_subscription_data["Subscription Data"]
  node_dispatch["Notification Dispatch"]
  node_email_template["Email Template"]
  node_email_queue["Email Queue<br/>[emailQueue.ts]"]
end

subgraph group_clients["Client Apps"]
  node_ios_wrapper["iOS WebView<br/>[WebView.swift]"]
  node_webview_controller["WebView Controller"]
end

subgraph group_shared["Shared Data"]
  node_anteater["Anteater API<br/>[index.ts]"]
  node_postgres[("PostgreSQL")]
end

node_student(("Student"))
node_email_services["AWS Email Services"]
node_ios_user(("iOS User"))

node_student -->|"uses"| node_scheduler
node_scheduler -.->|"searches"| node_course_search
node_course_search -.->|"selects sections"| node_section_info
node_scheduler -->|"previews schedule"| node_calendar
node_scheduler -->|"views locations"| node_map
node_section_info -->|"opens insights"| node_course_insights
node_section_info -->|"opens reviews"| node_review_flow
node_scheduler -.->|"updates"| node_schedule_state
node_scheduler -.->|"requests data"| node_trpc_api
node_trpc_api -.->|"dispatches"| node_routers
node_routers -.->|"accesses records"| node_rds
node_rds -.->|"reads and writes"| node_postgres
node_routers -.->|"fetches UCI data"| node_anteater
node_aants_scan -->|"loads subscriptions"| node_subscription_data
node_aants_scan -.->|"checks sections"| node_anteater
node_subscription_data -->|"reads and updates"| node_postgres
node_subscription_data -->|"creates client"| node_anteater
node_aants_scan -->|"sends notifications"| node_dispatch
node_dispatch -->|"renders"| node_email_template
node_dispatch -->|"queues email"| node_email_queue
node_email_queue -.->|"delivers via"| node_email_services
node_ios_user -->|"uses"| node_ios_wrapper
node_ios_wrapper -->|"delegates navigation"| node_webview_controller
node_webview_controller -->|"loads web app"| node_scheduler

click node_scheduler "https://github.com/icssc/antalmanac/tree/main/apps/antalmanac/src/app/(main)"
click node_course_search "https://github.com/icssc/antalmanac/tree/main/apps/antalmanac/src/components/RightPane/CoursePane"
click node_section_info "https://github.com/icssc/antalmanac/tree/main/apps/antalmanac/src/components/RightPane/SectionTable"
click node_calendar "https://github.com/icssc/antalmanac/tree/main/apps/antalmanac/src/components/Calendar"
click node_schedule_state "https://github.com/icssc/antalmanac/blob/main/apps/antalmanac/src/stores/Schedules.ts"
click node_map "https://github.com/icssc/antalmanac/tree/main/apps/antalmanac/src/components/Map"
click node_course_insights "https://github.com/icssc/antalmanac/tree/main/apps/antalmanac/src/components/RightPane/SectionTable/SectionTablePopover"
click node_review_flow "https://github.com/icssc/antalmanac/tree/main/apps/antalmanac/src/components/ReviewPrompt"
click node_trpc_api "https://github.com/icssc/antalmanac/blob/main/apps/antalmanac/src/backend/trpc.ts"
click node_routers "https://github.com/icssc/antalmanac/tree/main/apps/antalmanac/src/backend/routers"
click node_rds "https://github.com/icssc/antalmanac/tree/main/apps/antalmanac/src/backend/lib/rds"
click node_anteater "https://github.com/icssc/antalmanac/blob/main/packages/anteater-api/src/client/index.ts"
click node_postgres "https://github.com/icssc/antalmanac/tree/main/packages/db/src/schema"
click node_aants_scan "https://github.com/icssc/antalmanac/blob/main/apps/aants/src/index.ts"
click node_subscription_data "https://github.com/icssc/antalmanac/blob/main/apps/aants/src/helpers/subscriptionData.ts"
click node_dispatch "https://github.com/icssc/antalmanac/blob/main/apps/aants/src/helpers/notificationDispatch.ts"
click node_email_template "https://github.com/icssc/antalmanac/blob/main/apps/aants/src/emails/CourseNotificationEmail.tsx"
click node_email_queue "https://github.com/icssc/antalmanac/blob/main/apps/aants/src/helpers/emailQueue.ts"
click node_ios_wrapper "https://github.com/icssc/antalmanac/blob/main/apps/ios/src/AntAlmanac/WebView.swift"
click node_webview_controller "https://github.com/icssc/antalmanac/blob/main/apps/ios/src/AntAlmanac/ViewController.swift"

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_scheduler,node_course_search,node_section_info,node_calendar,node_schedule_state,node_map,node_course_insights,node_review_flow,node_ios_user toneBlue
class node_trpc_api,node_routers,node_rds toneAmber
class node_aants_scan,node_subscription_data,node_dispatch,node_email_template,node_email_queue toneMint
class node_ios_wrapper,node_webview_controller toneRose
class node_anteater,node_postgres,node_student,node_email_services toneIndigo
```

## Components

### Course Planning

- [Scheduler UI](https://github.com/icssc/antalmanac/tree/main/apps/antalmanac/src/app/(main)): `apps/antalmanac/src/app/(main)`
- [Course Search](https://github.com/icssc/antalmanac/tree/main/apps/antalmanac/src/components/RightPane/CoursePane): `apps/antalmanac/src/components/RightPane/CoursePane`
- [Section Details](https://github.com/icssc/antalmanac/tree/main/apps/antalmanac/src/components/RightPane/SectionTable): `apps/antalmanac/src/components/RightPane/SectionTable`
- [Schedule Calendar](https://github.com/icssc/antalmanac/tree/main/apps/antalmanac/src/components/Calendar): `apps/antalmanac/src/components/Calendar`
- [Schedule State](https://github.com/icssc/antalmanac/blob/main/apps/antalmanac/src/stores/Schedules.ts): `apps/antalmanac/src/stores/Schedules.ts`
- [Campus Map](https://github.com/icssc/antalmanac/tree/main/apps/antalmanac/src/components/Map): `apps/antalmanac/src/components/Map`
- [Course Insights](https://github.com/icssc/antalmanac/tree/main/apps/antalmanac/src/components/RightPane/SectionTable/SectionTablePopover): `apps/antalmanac/src/components/RightPane/SectionTable/SectionTablePopover`
- [Instructor Reviews](https://github.com/icssc/antalmanac/tree/main/apps/antalmanac/src/components/ReviewPrompt): `apps/antalmanac/src/components/ReviewPrompt`

### Web Backend

- [tRPC API](https://github.com/icssc/antalmanac/blob/main/apps/antalmanac/src/backend/trpc.ts): `apps/antalmanac/src/backend/trpc.ts`
- [API Routers](https://github.com/icssc/antalmanac/tree/main/apps/antalmanac/src/backend/routers): `apps/antalmanac/src/backend/routers`
- [RDS Access](https://github.com/icssc/antalmanac/tree/main/apps/antalmanac/src/backend/lib/rds): `apps/antalmanac/src/backend/lib/rds`

### Email Notifications

- [Subscription Scan](https://github.com/icssc/antalmanac/blob/main/apps/aants/src/index.ts): `apps/aants/src/index.ts`
- [Subscription Data](https://github.com/icssc/antalmanac/blob/main/apps/aants/src/helpers/subscriptionData.ts): `apps/aants/src/helpers/subscriptionData.ts`
- [Notification Dispatch](https://github.com/icssc/antalmanac/blob/main/apps/aants/src/helpers/notificationDispatch.ts): `apps/aants/src/helpers/notificationDispatch.ts`
- [Email Template](https://github.com/icssc/antalmanac/blob/main/apps/aants/src/emails/CourseNotificationEmail.tsx): `apps/aants/src/emails/CourseNotificationEmail.tsx`
- [Email Queue](https://github.com/icssc/antalmanac/blob/main/apps/aants/src/helpers/emailQueue.ts): `apps/aants/src/helpers/emailQueue.ts`

### Client Apps

- [iOS WebView](https://github.com/icssc/antalmanac/blob/main/apps/ios/src/AntAlmanac/WebView.swift): `apps/ios/src/AntAlmanac/WebView.swift`
- [WebView Controller](https://github.com/icssc/antalmanac/blob/main/apps/ios/src/AntAlmanac/ViewController.swift): `apps/ios/src/AntAlmanac/ViewController.swift`

### Shared Data

- [Anteater API](https://github.com/icssc/antalmanac/blob/main/packages/anteater-api/src/client/index.ts): `packages/anteater-api/src/client/index.ts`
- [PostgreSQL](https://github.com/icssc/antalmanac/tree/main/packages/db/src/schema): `packages/db/src/schema`

### Other components

- **Student**
- **AWS Email Services**
- **iOS User**

## Connections

- Student → Scheduler UI: uses (evidence: `README.md`)
- Scheduler UI → Course Search: searches
- Course Search → Section Details: selects sections
- Scheduler UI → Schedule Calendar: previews schedule (evidence: `README.md`)
- Scheduler UI → Campus Map: views locations (evidence: `README.md`)
- Section Details → Course Insights: opens insights (evidence: `README.md`)
- Section Details → Instructor Reviews: opens reviews (evidence: `README.md`)
- Scheduler UI → Schedule State: updates
- Scheduler UI → tRPC API: requests data
- tRPC API → API Routers: dispatches
- API Routers → RDS Access: accesses records
- RDS Access → PostgreSQL: reads and writes
- API Routers → Anteater API: fetches UCI data
- Subscription Scan → Subscription Data: loads subscriptions (evidence: `apps/aants/src/index.ts`)
- Subscription Scan → Anteater API: checks sections
- Subscription Data → PostgreSQL: reads and updates (evidence: `apps/aants/src/helpers/subscriptionData.ts`)
- Subscription Data → Anteater API: creates client (evidence: `apps/aants/src/helpers/subscriptionData.ts`)
- Subscription Scan → Notification Dispatch: sends notifications (evidence: `apps/aants/src/index.ts`)
- Notification Dispatch → Email Template: renders (evidence: `apps/aants/src/helpers/notificationDispatch.ts`)
- Notification Dispatch → Email Queue: queues email (evidence: `apps/aants/src/helpers/notificationDispatch.ts`)
- Email Queue → AWS Email Services: delivers via (evidence: `README.md`)
- iOS User → iOS WebView: uses (evidence: `README.md`)
- iOS WebView → WebView Controller: delegates navigation (evidence: `apps/ios/src/AntAlmanac/WebView.swift`)
- WebView Controller → Scheduler UI: loads web app (evidence: `README.md`)
