How markadvalorem/habit-tracker works
Habit Tracker is an offline-first mobile habit manager: users create and organize habits, record completions, then review progress through statistics and badges. The app keeps habits and settings on-device, schedules local reminders, and offers exports and personalization. The graph follows the documented product scope and source-index relationships; some screens and integrations were not excerpted, so their internal wiring is omitted where it cannot be verified.
Main entry points: habit-context.tsx Habit state · statistics.tsx Statistics screen · settings.tsx Settings screen · add-habit.tsx Habit editor
Components 27
Habit experience
- Today’s habits
app/(tabs)/index.tsx - Habit editor
app/add-habit.tsx - Habit detail
app/habit-detail/[id].tsx - Archived habits
app/archived-habits.tsx
Progress insights
- Statistics screen
app/(tabs)/statistics.tsx - Annual heatmap
components/annual-heatmap.tsx - Monthly chart
components/monthly-chart.tsx - Trend chart
components/trend-chart.tsx - Weekly comparison
components/weekly-comparison.tsx - Badges screen
app/(tabs)/badges.tsx - Badge rules
lib/badges.ts
App state and setup
- Habit state
lib/habit-context.tsx - AsyncStorage
- Language state
lib/language-init-context.tsx - Onboarding
app/onboarding.tsx - Onboarding state
lib/onboarding-context.tsx - Interactive tutorial
lib/tutorial-context.tsx
Personalization and reminders
- Settings screen
app/(tabs)/settings.tsx - CSV / HTML export
lib/export-service.ts - Local reminders
lib/notification-scheduler.ts - Language selection
app/language-select.tsx
Shared UI and logic
- Time range picker
components/time-range-modal.tsx - Time picker
components/time-picker.tsx - Completion calendar
components/calendar-grid-advanced.tsx - Streak calculations
lib/streak-utils.ts - Time utilities
lib/time-utils.ts
Other components
- User
Connections 29
- User → Today’s habits: uses
README.md - User → Habit editor: creates habits
README.md - User → Statistics screen: reviews progress
README.md - User → Settings screen: configures
README.md - Today’s habits → Habit state: reads and updates
app/(tabs)/index.tsx - Habit editor → Habit state: creates or edits
app/add-habit.tsx - Habit detail → Habit state: reads habit data
app/habit-detail/[id].tsx - Habit detail → Completion calendar: renders completions
app/habit-detail/[id].tsx - Archived habits → Habit state: manages archive
app/archived-habits.tsx - Habit state → AsyncStorage: persists data
README.md - Habit state → Local reminders: schedules reminders
lib/habit-context.tsx - Habit state → Time utilities: validates times
lib/habit-context.tsx - Statistics screen → Habit state: reads completion data
app/(tabs)/statistics.tsx - Statistics screen → Annual heatmap: renders
app/(tabs)/statistics.tsx - Statistics screen → Monthly chart: renders
app/(tabs)/statistics.tsx - Statistics screen → Trend chart: renders
app/(tabs)/statistics.tsx - Statistics screen → Weekly comparison: renders
app/(tabs)/statistics.tsx - Badges screen → Habit state: reads progress
app/(tabs)/badges.tsx - Badges screen → Badge rules: gets badge rules
app/(tabs)/badges.tsx - Settings screen → Habit state: updates settings
app/(tabs)/settings.tsx - Settings screen → CSV / HTML export: exports records
app/(tabs)/settings.tsx - Settings screen → Local reminders: manages vacation reminder
app/(tabs)/settings.tsx - Settings screen → AsyncStorage: configures preferences
README.md - Language selection → Language state: sets language
README.md - Language state → AsyncStorage: persists selection
lib/language-init-context.tsx - Onboarding → Onboarding state: records progress
app/onboarding.tsx - Habit editor → Time range picker: opens time range
app/add-habit.tsx - Time range picker → Time picker: uses
components/time-range-modal.tsx - CSV / HTML export → Streak calculations: calculates streaks
lib/export-service.ts