Overview
GoHealth is an academic health-tracking application for meals, activity, weight, BMI, nutrition targets, and push notifications. I built the backend model/API, authentication, nutrition calculations, and Firebase Cloud Messaging integration.
A key decision was to calculate daily progress on the backend rather than repeating the same rules in every client.
Server-side calculations
Clients submit meal and activity records. The API calculates the values used for daily summaries and target evaluation.
Food data comes from a local dataset rather than a runtime nutrition API. That avoids a network/provider dependency, but the quality of the result still depends on the quality of the maintained food catalog.
The 90–110% calorie range is also evaluated on the server rather than as a frontend-only threshold.
Push notification flow
Notification records are stored separately from FCM delivery.
The backend can decide that a notification is due, save that record, and then attempt the push. A failed or stale device token can be handled without changing the underlying meal, activity, or target data.
Authentication
Password/JWT and Google OAuth resolve to the same backend user model for protected health records.
OAuth and Firebase credentials remain deployment configuration rather than repository data.
Current limits
Scheduled-reminder durability, multiple FCM devices per user, failed-token cleanup, and food-dataset provenance are the main gaps in the current implementation.
Gambaran umum
GoHealth adalah aplikasi akademik untuk mencatat makanan, aktivitas, berat badan, BMI, target nutrisi, dan push notifications. Saya membangun model dan API backend, autentikasi, perhitungan nutrisi, serta integrasi Firebase Cloud Messaging.
Keputusan utamanya adalah menghitung progres harian di backend, bukan menduplikasi aturan yang sama pada setiap client.
Perhitungan di sisi server
Client mengirimkan data makanan dan aktivitas. API menghitung nilai untuk ringkasan harian dan evaluasi target.
Data makanan berasal dari dataset lokal, bukan nutrition API saat runtime. Ini mengurangi ketergantungan jaringan/provider, tetapi kualitas hasil tetap bergantung pada kelengkapan katalog makanan.
Rentang kalori 90–110% juga dievaluasi oleh server, bukan sekadar threshold di frontend.
Alur push notification
Record notifikasi disimpan terpisah dari pengiriman FCM.
Backend dapat menentukan kapan notifikasi harus dikirim, menyimpan record, kemudian mencoba mengirim push. Token perangkat yang gagal atau kedaluwarsa dapat ditangani tanpa mengubah data makanan, aktivitas, maupun target.
Autentikasi
Password/JWT dan Google OAuth dipetakan ke model user backend yang sama untuk melindungi data kesehatan.
Credential OAuth dan Firebase disimpan sebagai konfigurasi deployment, bukan data repository.
Keterbatasan saat ini
Kesenjangan utama adalah durability penjadwalan reminder, dukungan beberapa perangkat FCM per pengguna, pembersihan token gagal, dan provenance dataset makanan.
Resumen
GoHealth es una aplicación académica de seguimiento de comidas, actividad, peso, BMI, objetivos nutricionales y push notifications. Construí el modelo y API backend, autenticación, cálculos nutricionales e integración Firebase Cloud Messaging.
La decisión clave fue calcular el progreso diario en el backend en lugar de duplicar reglas en todos los clientes.
Cálculos en el servidor
Los clientes envían comidas y actividad. La API calcula los valores para resúmenes diarios y evaluación de objetivos.
Los alimentos proceden de un dataset local y no de una nutrition API en runtime. Esto elimina una dependencia de red, pero la precisión sigue dependiendo del catálogo mantenido.
El rango del 90–110% de calorías se evalúa también en el servidor, no solo mediante un threshold de frontend.
Flujo de push notifications
Los records de notificación se almacenan aparte de su entrega por FCM.
El backend decide cuándo corresponde notificar, guarda el record e intenta el envío. Un token de dispositivo inválido puede gestionarse sin modificar comidas, actividad ni objetivos.
Autenticación
Password/JWT y Google OAuth resuelven a un mismo modelo de usuario en backend para proteger los datos de salud.
Las credenciales OAuth y Firebase se guardan en la configuración de deployment y no en el repositorio.
Límites actuales
Las principales mejoras pendientes son durabilidad de los recordatorios, múltiples dispositivos FCM por usuario, eliminación de tokens fallidos y provenance del dataset nutricional.
Présentation
GoHealth est une application universitaire de suivi des repas, de l’activité, du poids, du BMI, des objectifs nutritionnels et des push notifications. J’ai développé le modèle et l’API backend, l’authentification, les calculs nutritionnels et l’intégration Firebase Cloud Messaging.
Le choix central était de calculer les progrès quotidiens dans le backend plutôt que de reproduire les règles dans chaque client.
Calculs côté serveur
Les clients envoient les repas et les activités ; l’API calcule les résumés quotidiens et l’atteinte des objectifs.
Les données alimentaires proviennent d’un dataset local plutôt que d’une nutrition API au runtime. Cela évite une dépendance réseau, mais les résultats dépendent de la qualité du catalogue.
La plage calorique de 90–110 % est évaluée côté serveur et non uniquement par un threshold frontend.
Flux de push notifications
Les records de notification sont séparés de leur livraison par FCM.
Le backend décide qu’une notification est due, l’enregistre, puis tente le push. Un token obsolète ou invalide peut être traité sans toucher aux repas, activités et objectifs.
Authentification
Password/JWT et Google OAuth conduisent au même modèle utilisateur backend pour protéger les données de santé.
Les credentials OAuth et Firebase restent dans la configuration de deployment, pas dans le repository.
Limites actuelles
Les priorités sont la durabilité des rappels planifiés, plusieurs appareils FCM par utilisateur, le nettoyage des tokens invalides et la provenance des données alimentaires.
Überblick
GoHealth ist eine akademische Anwendung zum Tracking von Mahlzeiten, Aktivität, Gewicht, BMI, Ernährungszielen und Push Notifications. Ich entwickelte Backend-Modell/API, Authentifizierung, Nährwertberechnungen und Firebase-Cloud-Messaging-Integration.
Die wichtigste Entscheidung war, den täglichen Fortschritt im Backend zu berechnen, statt die gleichen Regeln in jedem Client zu duplizieren.
Serverseitige Berechnungen
Clients senden Mahlzeiten und Aktivitätsdaten. Die API berechnet Tagesübersichten und Zielbewertungen.
Lebensmitteldaten stammen aus einem lokalen Dataset statt einer Runtime-Nutrition-API. Das reduziert Netzabhängigkeiten, doch die Qualität hängt vom gepflegten Katalog ab.
Auch der Kalorienbereich von 90–110 % wird serverseitig ausgewertet und nicht nur über einen Frontend-Threshold.
Push-Notification-Ablauf
Notification Records werden getrennt von der FCM-Zustellung gespeichert.
Das Backend bestimmt fällige Benachrichtigungen, speichert den Record und versucht den Push. Fehlerhafte oder veraltete Device Tokens lassen sich behandeln, ohne Mahlzeiten, Aktivitäten oder Ziele zu verändern.
Authentifizierung
Password/JWT und Google OAuth verweisen auf dasselbe Backend-User-Modell zum Schutz der Gesundheitsdaten.
OAuth- und Firebase-Credentials gehören zur Deployment-Konfiguration und nicht ins Repository.
Aktuelle Grenzen
Offen sind dauerhafte Reminder-Planung, mehrere FCM-Geräte pro User, Bereinigung ungültiger Tokens und die Provenance des Lebensmitteldatensatzes.
概要
GoHealthは食事、活動、体重、BMI、栄養目標、Push Notificationを記録する学術アプリです。私はBackend Model/API、認証、栄養計算、Firebase Cloud Messaging Integrationを実装しました。
重要な設計判断は、すべてのClientで同じルールを繰り返すのではなく、日々の進捗をBackendで計算することです。
Server側の計算
Clientは食事と活動Recordを送信し、APIが日次要約と目標評価の数値を計算します。
食品データはRuntimeのNutrition APIではなく、ローカルDatasetから取得します。NetworkやProviderへの依存を減らせる反面、結果は食品Catalogの品質に左右されます。
カロリー目標の90–110%という範囲もFrontendだけではなくServerで評価します。
Push Notificationの流れ
Notification RecordとFCM配送処理は分けて管理します。
Backendが通知時刻を判定してRecordを保存し、Pushを試みます。無効または古いDevice Tokenがあっても、食事・活動・目標データは変更せずに対処できます。
認証
Password/JWTとGoogle OAuthは同じBackend User Modelに紐付けられ、健康データへのアクセスを保護します。
OAuthとFirebaseのCredentialはRepositoryではなくDeployment設定として管理します。
現在の制約
優先課題はReminder SchedulingのDurability、ユーザーごとの複数FCM Device、無効Tokenの削除、食品DatasetのProvenanceです。