Dashboard / Home
Endpoint untuk halaman home mobile. Tersedia satu aggregator endpoint yang mengembalikan semua data home dalam satu round-trip, plus 3 endpoint widget terpisah untuk refresh per-widget.
Semua endpoint memerlukan JWT authentication. Base path: /api/mobile/v1/dashboard.
GET /dashboard/home
Aggregator endpoint — satu round-trip untuk semua data home: user header, workout hari ini, stats, water progress, matches preview, upcoming activities, dan profile completion.
Contoh Request
curl -X GET https://fumai.app/api/mobile/v1/dashboard/home \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"const res = await fetch('https://fumai.app/api/mobile/v1/dashboard/home', {
headers: { Authorization: `Bearer ${accessToken}` },
})
const data = await res.json()Response 200
{
"success": true,
"data": {
"user": {
"id": "clx...",
"name": "John",
"image": "https://cdn.fumai.app/avatars/...",
"email": "john@example.com",
"level": 7,
"totalXp": 8420,
"xpToNextLevel": 1200,
"streak": 12,
"longestStreak": 28
},
"today": {
"dayOfWeek": "MONDAY",
"workout": {
"programDayId": "clx...",
"name": "Push Day",
"isRestDay": false,
"exercises": [
{ "id": "...", "name": "Bench Press", "sets": 4, "repsMin": 8, "repsMax": 12 }
]
},
"water": { "currentMl": 1400, "targetMl": 2000 }
},
"stats": {
"streak": 12,
"longestStreak": 28,
"totalXp": 8420,
"level": 7,
"totalPRs": 14,
"totalWorkouts": 96,
"avgWorkoutDuration": 47,
"workoutsThisWeek": 3,
"workoutsThisMonth": 11,
"todayCalories": 1820,
"todayProtein": 132,
"currentWeight": 70.4
},
"fitmatch": {
"hasProfile": true,
"status": "ACTIVE",
"discoverTutorialSeen": true
},
"matches": [
{
"matchId": "clx...",
"profileId": "clx...",
"displayName": "Jane",
"photo": "https://cdn.fumai.app/...",
"matchedAt": "2026-05-08T..."
}
],
"upcomingActivities": [
{
"id": "clx...",
"title": "Morning Run",
"sport": "RUNNING",
"date": "2026-05-12",
"startTime": "2026-05-12T06:00:00.000Z",
"endTime": "2026-05-12T07:00:00.000Z",
"locationName": "Senayan Park"
}
],
"profileCompletion": 78
}
}Info:
today.workoutadalahnullpada hari rest day atau saat user tidak punya program aktif.fitmatch.hasProfileadalahfalsejika user belum menyelesaikan setup wizard FitMatch.matcheskosong jika belum ada profil FitMatch.
GET /dashboard/stats
Stats agregat (sama seperti home.data.stats). Pakai endpoint ini jika hanya butuh hero stats — backed by query yang sama dengan cache 1 menit.
Contoh Request
curl -X GET https://fumai.app/api/mobile/v1/dashboard/stats \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"const res = await fetch('https://fumai.app/api/mobile/v1/dashboard/stats', {
headers: { Authorization: `Bearer ${accessToken}` },
})
const data = await res.json()Response 200
{
"success": true,
"data": {
"stats": {
"streak": 12,
"longestStreak": 28,
"totalXp": 8420,
"level": 7,
"totalPRs": 14,
"totalWorkouts": 96,
"avgWorkoutDuration": 47,
"workoutsThisWeek": 3,
"workoutsThisMonth": 11,
"todayCalories": 1820,
"todayProtein": 132,
"currentWeight": 70.4
},
"updatedAt": "2026-05-11T03:42:18.213Z"
}
}GET /dashboard/health-score
Weighted overall health score 0-100 untuk ISO week saat ini, dengan perbandingan terhadap minggu lalu dan auto-generated coaching tips.
Bobot: Workout 30% · Nutrition 25% · Water 20% · Sleep 25%
Contoh Request
curl -X GET https://fumai.app/api/mobile/v1/dashboard/health-score \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"const res = await fetch('https://fumai.app/api/mobile/v1/dashboard/health-score', {
headers: { Authorization: `Bearer ${accessToken}` },
})
const data = await res.json()Response 200
{
"success": true,
"data": {
"overallScore": 78,
"previousScore": 71,
"trend": "up",
"metrics": {
"workout": { "score": 80, "completed": 3, "target": 4, "streak": 12 },
"nutrition": { "score": 70, "calorieProgress": 92, "daysTracked": 5 },
"water": { "score": 85, "todayProgress": 110, "streak": 6 },
"sleep": { "score": 75, "avgDuration": 425, "avgQuality": 3.8, "daysTracked": 6 }
},
"tips": [
"Streak workout kamu luar biasa! Pertahankan konsistensimu! 💪"
]
}
}| Field | Tipe | Keterangan |
|---|---|---|
overallScore | number | Skor minggu ini (0-100) |
previousScore | number | Skor minggu lalu |
trend | string | "up", "down", atau "neutral" (threshold ±5) |
tips | string[] | Tips dalam bahasa Indonesia |
GET /dashboard/weekly-overview
Strip 7 hari (hari ini + 6 hari sebelumnya) dengan flag pillar per hari + week stats. Backing untuk activity-strip widget di home screen.
Contoh Request
curl -X GET https://fumai.app/api/mobile/v1/dashboard/weekly-overview \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"const res = await fetch('https://fumai.app/api/mobile/v1/dashboard/weekly-overview', {
headers: { Authorization: `Bearer ${accessToken}` },
})
const data = await res.json()Response 200
{
"success": true,
"data": {
"days": [
{
"date": "2026-05-05",
"dayName": "Sen",
"workout": true,
"nutrition": true,
"water": true,
"sleep": false,
"isToday": false
}
],
"stats": {
"workoutCount": 3,
"nutritionCount": 6,
"waterCount": 4,
"sleepCount": 5,
"consistency": 64
}
}
}Info:
stats.consistency = (totalActivitiesCompleted / 28) × 100di mana 28 = 4 pillars × 7 days.dayNamedilokalisasi ke bahasa Indonesia (Sen,Sel, …).