How errnolink/cadence-planner works
Purpose and Runtime
Cadence Planner is a client-side academic planner for organizing semesters, subjects, weekly timetables, calendar events, and attendance. It runs as a React 19 single-page application built and served by Vite, with Tailwind and CSS-variable theme styling. The browser client integrates with Supabase for authentication and persisted planner data.
Entry points:
• src/main.jsx mounts the React application.
• src/App.jsx composes the application shell and feature views.
• src/data/supabaseClient.js establishes the Supabase client boundary.
Application Composition and Navigation
App.jsx is the primary orchestration layer: it connects state hooks, authenticated data, selected-semester context, and the visible planner view. Layout controls provide desktop and mobile navigation plus global settings:
• src/App.jsx
• src/components/layout/ControlBar.jsx
• src/components/layout/MobileTabBar.jsx
Shared modal and dropdown primitives isolate interaction mechanics from domain-specific views:
• src/components/ui/Modal.jsx
• src/components/ui/Dropdown.jsx
• src/components/layout/SettingsModal.jsx
Identity, Persistence, and Sync Boundary
Authentication is handled in the UI and exposed through a dedicated React hook. Supabase-related client/API modules form the remote persistence boundary; feature components should consume domain hooks/API abstractions rather than directly own backend concerns.
• src/components/Auth.jsx
• src/hooks/useAuth.jsx
• src/data/api.js
• src/data/supabaseClient.js
SyncChip likely surfaces synchronization state to users, while initial data and constants support startup/default state:
• src/components/ui/SyncChip.jsx
• src/data/initialData.js
• src/data/constants.js
Semester and Subject Domain Flow
Semester selection drives the active working set. The semester hook manages semester-level state, and the roster renders/edit subjects within that selected term. Subject rows and GPA display are subordinate projections of subject metadata such as credits and grades.
• src/hooks/useSemesters.js
• src/components/layout/SemDropdown.jsx
• src/components/roster/SubjectRoster.jsx
• src/components/roster/SubjectRow.jsx
• src/components/roster/GpaBadge.jsx
Primary flow: authenticated user → semesters → active semester → subject roster → timetable/attendance/calendar records associated with subjects.
Timetable and Calendar Scheduling
The timetable is the weekly schedule authoring and visualization surface. A grid displays class instances, while modals provide creation/detail editing boundaries. Calendar provides date-oriented visibility and daily drill-down.
• src/components/timetable/TimetableGrid.jsx
• src/components/timetable/ClassInstanceModal.jsx
• src/components/timetable/TimetableModal.jsx
• src/components/calendar/CalendarView.jsx
• src/components/calendar/DayDetailModal.jsx
Scheduling data must bridge recurring/weekly timetable structure with dated calendar and attendance views without leaking UI modal state into persisted domain records.
Attendance Tracking
Attendance is a separate domain state layer, likely keyed by subject and date/class occurrence. Its hook centralizes attendance operations; the view exposes summaries while the subject modal supports detailed records.
• src/hooks/useAttendance.js
• src/components/attendance/AttendanceView.jsx
• src/components/attendance/SubjectAttendanceModal.jsx
Attendance depends on the active semester and subjects, and may use timetable/calendar events as the context for marking or reviewing classes.
Themes, Resilience, and Deployment Instrumentation
Theme context selects and applies visual systems, including the “nerv” and “minimal” theme packages. Error isolation prevents a feature failure from taking down the SPA. Vercel Analytics is a deployment-time external telemetry integration.
• src/themes/ThemeContext.jsx
• src/themes/nerv/styles.css
• src/themes/minimal/styles.css
• src/components/ErrorBoundary.jsx
• src/VercelAnalytics.jsx
Main entry points: App.jsx App orchestrator · useSemesters.js Semester state · useAttendance.js Attendance state · TimetableGrid.jsx Weekly timetable
Components 21
React SPA
Client-side planner application.
- Application entry
src/main.jsx - App orchestrator · Connects authentication, active data, navigation, and visible views.
src/App.jsx - Authentication UI
src/components/Auth.jsx - Auth hook
src/hooks/useAuth.jsx - Desktop and mobile navigation
src/components/layout/ControlBar.jsx - Settings modal
src/components/layout/SettingsModal.jsx - Error boundary · Prevents feature failures from taking down the SPA.
src/components/ErrorBoundary.jsx
Planner domains
Semester-scoped planning features.
- Semester state · Selects the active semester and its working set.
src/hooks/useSemesters.js - Semester picker
src/components/layout/SemDropdown.jsx - Subject roster · Renders and edits subjects for the active term.
src/components/roster/SubjectRoster.jsx - Weekly timetable · Authors and visualizes recurring class instances.
src/components/timetable/TimetableGrid.jsx - Class editors · Creation and detail editing boundary for timetable classes.
src/components/timetable/ClassInstanceModal.jsx - Calendar · Provides date-oriented schedule visibility and drill-down.
src/components/calendar/CalendarView.jsx - Day detail
src/components/calendar/DayDetailModal.jsx - Attendance state · Centralizes attendance operations by subject and occurrence.
src/hooks/useAttendance.js - Attendance view
src/components/attendance/AttendanceView.jsx - Subject attendance detail
src/components/attendance/SubjectAttendanceModal.jsx
Platform services
Remote persistence, styling, and telemetry boundaries.
- Planner API · Domain-facing persistence boundary for planner data.
src/data/api.js - Supabase client · Authentication and persisted planner-data integration.
src/data/supabaseClient.js - Theme context · Applies selectable CSS-variable themes.
src/themes/ThemeContext.jsx - Vercel Analytics
src/VercelAnalytics.jsx
Connections 26
- Application entry → App orchestrator: mounts
- App orchestrator → Error boundary: isolates UI
- App orchestrator → Authentication UI: renders signed-out flow
- Authentication UI → Auth hook: uses
- Auth hook → Supabase client: authenticates with
- App orchestrator → Desktop and mobile navigation: composes
- App orchestrator → Settings modal: opens
- App orchestrator → Semester state: uses
- Semester picker → Semester state: selects
- Semester state → Planner API: loads and persists
- Semester state → Subject roster: provides active term
- Subject roster → Weekly timetable: subjects schedule classes
- Semester state → Weekly timetable: scopes
- Weekly timetable → Class editors: edits through
- Weekly timetable → Calendar: bridges recurring schedule
- Calendar → Day detail: drills into
- Semester state → Attendance state: scopes
- Subject roster → Attendance state: supplies subjects
- Weekly timetable → Attendance state: supplies class context
- Calendar → Attendance state: supplies dated context
- Attendance state → Attendance view: drives
- Attendance view → Subject attendance detail: opens
- Attendance state → Planner API: persists through
- Planner API → Supabase client: uses
- App orchestrator → Theme context: applies
- App orchestrator → Vercel Analytics: reports usage