How viky-m/habit-tracker-backend works
This is a Laravel habit-tracking API: users authenticate, manage habits and reminders, log completions, and receive streak, XP, hero, achievement, and analytics progression. The graph shows the documented product branches plus the sampled authentication and gamification calls. Most other controller/service relationships are supported by the SOURCE INDEX only where it explicitly names the dependency; unsampled feature internals and notification delivery are not inferred.
Main entry points: AppServiceProvider.php Service and repository bindings · GamificationService.php Progression coordinator · HabitLogService.php Completion processing · AuthService.php Authentication service
Components 28
API entry
- Authentication API
app/Http/Controllers/Api/AuthController.php - Authentication service
app/Services/AuthService.php - Service and repository bindings
app/Providers/AppServiceProvider.php
Habit tracking
- Habit API
app/Http/Controllers/Api/HabitController.php - Habit management
app/Services/HabitService.php - Completion API
app/Http/Controllers/Api/HabitLogController.php - Completion processing
app/Services/HabitLogService.php - Reminder API
app/Http/Controllers/Api/HabitReminderController.php - Reminder management
app/Services/HabitReminderService.php
Gamification
- Progression coordinator
app/Services/GamificationService.php - XP calculation
app/Services/XpCalculator.php - Level-up rules
app/Services/LevelUpService.php - Hero catalog API
app/Http/Controllers/Api/HeroController.php - User hero API
app/Http/Controllers/Api/UserHeroController.php - Hero management
app/Services/HeroService.php - User hero management
app/Services/UserHeroService.php - Achievement engine
app/Services/AchievementService.php - Achievement API
app/Http/Controllers/Api/AchievementController.php - Analytics API
app/Http/Controllers/Api/UserStatsController.php - User analytics
app/Services/UserStatsService.php
Persistence layer
- User accounts
app/Models/User.php - Habits
app/Models/Habit.php - Completion logs
app/Models/HabitLog.php - Reminders
app/Models/HabitReminder.php - Hero templates
app/Models/Hero.php - User hero progress
app/Models/UserHero.php - Achievements
app/Models/Achievement.php
Other components
- API client
Connections 32
- API client → Authentication API: sends auth requests
app/Http/Controllers/Api/AuthController.php - Authentication API → Authentication service: delegates auth
app/Http/Controllers/Api/AuthController.php - Authentication service → User accounts: creates accounts
app/Services/AuthService.php - Authentication service → Progression coordinator: creates starter hero
app/Services/AuthService.php - API client → Habit API: manages habits
- Habit API → Habit management: delegates operations
app/Http/Controllers/Api/HabitController.php - Habit management → Habits: manages records
- API client → Completion API: logs completion
- Completion API → Completion processing: delegates logging
app/Http/Controllers/Api/HabitLogController.php - Completion processing → Progression coordinator: awards progression
- Completion processing → Completion logs: records completion
- Completion processing → Habits: updates habit
- API client → Reminder API: configures reminders
- Reminder API → Reminder management: delegates operations
app/Http/Controllers/Api/HabitReminderController.php - Reminder management → Reminders: manages reminders
- Progression coordinator → XP calculation: calculates XP
app/Services/GamificationService.php - Progression coordinator → Level-up rules: processes levels
app/Services/GamificationService.php - Progression coordinator → User hero progress: updates progress
app/Services/GamificationService.php - Progression coordinator → Hero templates: finds starter
app/Services/GamificationService.php - API client → Hero catalog API: browses heroes
- API client → User hero API: manages heroes
- API client → Achievement API: checks achievements
- API client → Analytics API: requests analytics
- Service and repository bindings → Authentication service: binds service
app/Providers/AppServiceProvider.php - Service and repository bindings → Progression coordinator: binds service
app/Providers/AppServiceProvider.php - Service and repository bindings → Habit management: binds service
app/Providers/AppServiceProvider.php - Service and repository bindings → Completion processing: binds service
app/Providers/AppServiceProvider.php - Service and repository bindings → Reminder management: binds service
app/Providers/AppServiceProvider.php - Service and repository bindings → Hero management: binds service
app/Providers/AppServiceProvider.php - Service and repository bindings → User hero management: binds service
app/Providers/AppServiceProvider.php - Service and repository bindings → Achievement engine: binds service
app/Providers/AppServiceProvider.php - Service and repository bindings → User analytics: binds service
app/Providers/AppServiceProvider.php