How teguhadip34/project_hg works
This is a Laravel waste-scanning and eco-gamification application, with a Python YOLO service for image detection. The main workflow is user sign-in, image submission, remote detection, scan recording and XP award, followed by a result view. Separate features include history, dashboard metrics, achievements and challenges, leaderboard, profile, and reward redemption. The README describes a browser-side material-classification stage, but the supplied tree does not contain that browser app or its model; the available scan-controller excerpt instead maps detection labels to waste types. Links reflect shown routes and calls; unsampled implementations are represented without speculative internal wiring.
Main entry points: web.php Web routes · GamificationService.php XP and metrics · ScanController.php Scan workflow · EcoProfile.php Eco profile
Components 23
Access and routing
- Web routes
routes/web.php - Authentication
app/Http/Controllers/AuthController.php
Waste scanning
- Scan workflow
app/Http/Controllers/ScanController.php - YOLO API
ai-server/server.py - Scan and result pages
resources/views/scan.blade.php
Progress and competition
- XP and metrics
app/Services/GamificationService.php - Dashboard
app/Http/Controllers/DashboardController.php - Scan history
app/Http/Controllers/HistoryController.php - Achievements
app/Http/Controllers/AchievementController.php - Challenges
app/Http/Controllers/ChallengeController.php - Leaderboard
app/Http/Controllers/LeaderboardController.php - Profile
app/Http/Controllers/ProfileController.php - Dashboard page
resources/views/dashboard.blade.php
Rewards
- Reward redemption
app/Http/Controllers/RewardController.php
Domain records
- Scan records
app/Models/Scan.php - Waste types
app/Models/WasteType.php - Waste categories
app/Models/WasteCategory.php - Eco profile
app/Models/EcoProfile.php - User record
app/Models/User.php - Achievement records
app/Models/Achievement.php - Reward records
app/Models/Reward.php - Redemption records
app/Models/RewardRedemption.php
Other components
- User
Connections 40
- User → Web routes: requests pages
routes/web.php - Web routes → Authentication: routes auth
routes/web.php - Web routes → Scan workflow: routes scans
routes/web.php - Web routes → Dashboard: routes dashboard
routes/web.php - Web routes → Scan history: routes history
routes/web.php - Web routes → Achievements: routes achievements
routes/web.php - Web routes → Challenges: routes challenges
routes/web.php - Web routes → Leaderboard: routes rankings
routes/web.php - Web routes → Profile: routes profile
routes/web.php - Web routes → Reward redemption: routes rewards
routes/web.php - Authentication → User record: creates users
app/Http/Controllers/AuthController.php - Authentication → Eco profile: creates profiles
app/Http/Controllers/AuthController.php - Scan workflow → YOLO API: posts image
app/Http/Controllers/ScanController.php - Scan workflow → Waste types: matches label
app/Http/Controllers/ScanController.php - Scan workflow → Scan records: stores scan
app/Http/Controllers/ScanController.php - Scan workflow → XP and metrics: awards XP
app/Http/Controllers/ScanController.php - Scan workflow → Scan and result pages: shows scan form
- Scan workflow → Scan and result pages: renders result
app/Http/Controllers/ScanController.php - XP and metrics → Scan records: reads scans
app/Services/GamificationService.php - XP and metrics → Eco profile: updates XP
app/Services/GamificationService.php - XP and metrics → Achievement records: checks unlocks
app/Services/GamificationService.php - Dashboard → XP and metrics: gets metrics
app/Http/Controllers/DashboardController.php - Dashboard → Dashboard page: renders dashboard
- Scan history → Waste categories: queries categories
app/Http/Controllers/HistoryController.php - Achievements → Achievement records: loads achievements
app/Http/Controllers/AchievementController.php - Achievements → XP and metrics: gets progress
app/Http/Controllers/AchievementController.php - Challenges → XP and metrics: gets challenges
app/Http/Controllers/ChallengeController.php - Leaderboard → User record: ranks users
app/Http/Controllers/LeaderboardController.php - Profile → Eco profile: loads profile
app/Http/Controllers/ProfileController.php - Profile → XP and metrics: gets metrics
app/Http/Controllers/ProfileController.php - Reward redemption → Eco profile: checks balance
app/Http/Controllers/RewardController.php - Reward redemption → Reward records: checks stock
app/Http/Controllers/RewardController.php - Reward redemption → Redemption records: creates redemption
app/Http/Controllers/RewardController.php - Eco profile → Redemption records: sums spent XP
app/Models/EcoProfile.php - Scan records → Waste types: references type
app/Models/Scan.php - Waste types → Waste categories: belongs to
app/Models/WasteType.php - User record → Eco profile: has profile
app/Models/User.php - User record → Scan records: has scans
app/Models/User.php - User record → Achievement records: has achievements
app/Models/User.php - Redemption records → Reward records: references reward
app/Models/RewardRedemption.php