How fga0138-mds-ajax/2026.2-t02-shannon works
Habbit is a habit-management product with a mobile app and API. The main workflow is account authentication, habit creation and goal setting, then recording check-ins and viewing progress or history. The API also supports habit visibility and lifecycle changes, check-in editing, and session refresh/logout. The excerpts show API routes, domain services, and persistence; mobile-to-API wiring and some listed subsystems were not sampled, so those links are omitted or marked unverified.
Main entry points: main.py API application · habits/service.py Habit service · auth/service.py Auth service · goals/service.py Goal service
Components 21
Mobile app
- App screens
apps/mobile/src/app/(app) - Auth screens
apps/mobile/src/app/(auth) - Auth context
apps/mobile/src/contexts/auth-context.tsx - API clients
apps/mobile/src/services/api.ts
Identity and sessions
- Auth routes
apps/api/app/auth/router.py - Auth service
apps/api/app/auth/service.py - Session service
apps/api/app/auth/session/service.py - Token handling
apps/api/app/auth/tokens.py - Auth dependencies
apps/api/app/auth/dependencies.py
Habit management
- Habit routes
apps/api/app/habits/router.py - Habit service
apps/api/app/habits/service.py - Habit repository
apps/api/app/habits/repository.py
Goals and check-ins
- Goal routes
apps/api/app/goals/router.py - Goal service
apps/api/app/goals/service.py - Progress calculation
apps/api/app/goals/streak.py - Check-in routes
apps/api/app/checkins/router.py - Check-in service
apps/api/app/checkins/service.py - Check-in repository
apps/api/app/checkins/repository.py
Persistence
- Database session
apps/api/app/database.py
Other components
- User
- API application
apps/api/app/main.py
Connections 22
- User → Auth screens: signs in
- User → App screens: manages habits
- Auth screens → Auth context: uses
- App screens → API clients: requests data
- API clients → API application: calls API
- API application → Auth routes: registers
apps/api/app/main.py - API application → Habit routes: registers
apps/api/app/main.py - API application → Goal routes: registers
apps/api/app/main.py - API application → Check-in routes: registers
apps/api/app/main.py - Auth routes → Auth service: delegates to
apps/api/app/auth/router.py - Auth service → Session service: starts session
apps/api/app/auth/service.py - Auth service → Token handling: decodes tokens
apps/api/app/auth/service.py - Auth dependencies → Token handling: validates tokens
apps/api/app/auth/dependencies.py - Habit routes → Habit service: delegates to
apps/api/app/habits/router.py - Habit service → Habit repository: persists habits
apps/api/app/habits/service.py - Goal routes → Goal service: delegates to
apps/api/app/goals/router.py - Goal service → Habit service: checks ownership
apps/api/app/goals/service.py - Goal service → Progress calculation: calculates progress
apps/api/app/goals/service.py - Check-in routes → Check-in service: delegates to
apps/api/app/checkins/router.py - Check-in service → Check-in repository: persists check-ins
apps/api/app/checkins/service.py - Check-in service → Habit service: checks eligible habits
apps/api/app/checkins/service.py - Database session → Auth routes: provides sessions
apps/api/app/auth/router.py