How tristandurden/habit-hero works
Habit Hero is a habit-tracking application: users manage habits, record completions, and visualize progress, with folders, lists, timers, and reminders as related features. The graph follows the documented product capabilities and sampled API behavior; some client-side wiring is inferred from the file tree, so uncertain links are omitted.
Main entry points: prisma.ts Prisma access · auth.ts Authentication · page.tsx Dashboard · HabitCard.tsx Habit views
Components 23
User experience
- Dashboard
app/dashboard/page.tsx - Habit views
app/components/habits/HabitCard.tsx - Calendar views
app/components/calendars/Calendar.tsx - List views
app/components/lists/ItemsTable.tsx - Timer UI
app/components/timer/Timer.tsx - Timer state
app/timerStore.ts
Habit tracking
- Habit API
app/api/habits/route.ts - Completion logs
app/api/habitlog/route.ts - Habit state
app/habitStore.tsx - Habit sync
app/hooks/habits/useHabitSync.ts
Organization and sync
- Folder API
app/api/folders/route.ts - List API
app/api/lists/route.ts - List items API
app/api/lists/[id]/items/route.ts - Sync download
app/api/sync-data/route.ts - Sync operations
app/api/sync/route.ts
Services and storage
- Push settings
app/pwa/PushNotificationManager.tsx - Reminder scheduler
app/api/cron/notifications/route.ts - Notification actions
app/actions.ts - Authentication
lib/auth.ts - MySQL database
- Prisma access
lib/prisma.ts
Other components
- User
- Push service
Connections 30
- User → Dashboard: opens
- Dashboard → Habit views: shows
- Dashboard → Calendar views: shows
- Dashboard → List views: shows
- Dashboard → Timer UI: shows
- Habit views → Habit state: updates
- Habit state → Habit sync: syncs state
- Habit sync → Sync operations: submits changes
- Habit sync → Sync download: fetches data
- Habit views → Habit API: manages habits
- Habit API → Prisma access: reads and writes
- Completion logs → Prisma access: reads logs
- Folder API → Prisma access: reads and writes
- List API → Prisma access: reads and writes
- List items API → Prisma access: reads and writes
- Sync download → Prisma access: loads user data
- Sync operations → Prisma access: applies queued changes
- Prisma access → MySQL database: queries
- Timer UI → Timer state: controls
- User → Push settings: configures alerts
- Push settings → Notification actions: subscribes or tests
- Reminder scheduler → Prisma access: loads habits
- Reminder scheduler → Notification actions: sends reminders
- Notification actions → Push service: dispatches
- User → Authentication: signs in
- Habit API → Authentication: checks session
- Folder API → Authentication: checks session
- List API → Authentication: checks session
- Sync download → Authentication: checks session
- Sync operations → Authentication: checks session