How wl3512-lab/habitabull-lifting works
HabitaBull is a phone-first lifting and habit-tracking app. The main workflow is to set up a profile and weekly routine, generate a session, log sets, then review the workout and progress. Its additional branches include calendar/history, goals and streaks, routine assistance, and an opt-in crew for shared plans, check-ins, and workout photos. The main page’s orchestration, local persistence, rules engine, generation endpoint, and crew server/database calls are evidenced in sampled source; some UI and integration wiring is inferred only from the tree and imports.
Main entry points: page.tsx App coordinator · RoutineEditor.tsx Routine editor · LogSession.tsx Session logger · engine.ts Training rules
Components 25
Workout planning
- Onboarding
components/Onboarding.tsx - Week setup
components/WeekSetup.tsx - Routine editor
components/RoutineEditor.tsx - Training rules
lib/engine.ts - Exercise catalog
lib/exercises.ts - Routine templates
lib/templates.ts
Training and history
- Today view
components/Today.tsx - Session logger
components/LogSession.tsx - Rest timer
components/RestTimer.tsx - Workout summary
components/AfterWorkout.tsx - Progress and streaks
components/Progress.tsx - Calendar history
components/Calendar.tsx - Goal tracking
components/GoalScreen.tsx
Crew sharing
- Crew experience
components/Crew.tsx - Crew client
lib/cloud.ts - Crew API
app/api/crew/[action]/route.ts
App services
- App coordinator
app/page.tsx - Workout assistance
app/api/generate/route.ts - Local app data
lib/storage.ts - Crew data access
lib/server/db.ts - Backup and restore
lib/backup.ts - Voice cues
lib/voice.ts
Other components
- Lifter
- AI proxy
- Supabase services
Connections 26
- Lifter → App coordinator: uses
- App coordinator → Local app data: loads and saves
- App coordinator → Onboarding: presents
- App coordinator → Week setup: presents
- App coordinator → Routine editor: presents
- Routine editor → Training rules: builds routines
- Routine editor → Routine templates: uses templates
- Routine editor → Exercise catalog: selects exercises
- Workout assistance → Training rules: gets alternatives
- Workout assistance → AI proxy: requests interpretation
- App coordinator → Training rules: builds sessions
- App coordinator → Today view: presents
- App coordinator → Session logger: opens session
- Session logger → Training rules: gets records and rest
- Session logger → Rest timer: shows rest
- Session logger → Voice cues: gets cues
- App coordinator → Workout summary: presents completion
- App coordinator → Progress and streaks: presents history
- App coordinator → Calendar history: presents history
- App coordinator → Goal tracking: presents goals
- App coordinator → Crew experience: presents crew
- Crew experience → Crew client: uses crew services
- Crew client → Crew API: sends requests
- Crew API → Crew data access: reads and writes
- Crew data access → Supabase services: calls REST and storage
- App coordinator → Backup and restore: offers data backup