The Flutter companion app of Happify β mood tracking, journaling, mindfulness, an AI voice companion, anonymous community support, professional care, and companion-device management, all in one pocket-sized, accessible client.
π Frontend Β· βοΈ Backend Β· π§ AI Β· π± Mobile Β· π IoT
Happify-Mobile is the on-the-go client of the Happify ecosystem. Everything the web dashboard offers is available here too β plus voice conversations with the AI companion, mindfulness exercises, and direct management of a paired Happify Companion (IoT) device β packaged as a single Flutter codebase targeting Android and iOS.
Happify-Mobile's role in the ecosystem: "A friend who is here to listen β wherever the user is, not just at a desk."
Like the web frontend, the mobile app never calls Happify-AI directly. Every request β mood entries, journals, voice turns, community posts, referrals β goes through Happify Backend, which brokers AI access, enforces auth, and persists everything.
| Framework | Flutter 3.38 (stable) |
| Language | Dart ~3.10 |
| State Management | flutter_bloc (Cubit-based) |
| Navigation | go_router with auth-aware redirects |
| Auth | Firebase Auth (Email/Password + Google) |
| Networking | Dio (ApiClient, shared across repositories) |
| Notifications | Firebase Cloud Messaging |
| Audio | record, audioplayers, flutter_tts |
| Distribution | Signed Android APK/AAB via GitHub Actions |
Happify-Mobile talks to the same backend as the web app β mood, journal, community, care, and device-pairing data are shared across both clients in real time.
| Repository | Role | Link |
|---|---|---|
| π Happify-FE | Web dashboard β mood, journal, community, care | Happiffy/Happify-FE |
| βοΈ Happify-BE | Node.js API, PostgreSQL, Firebase, WebSocket hub | Happiffy/Happify-BE |
| π§ Happify-AI | FastAPI service β journal reflection, risk detection, voice processing | Happiffy/Happify-AI |
| π± Happify-Mobile | Flutter app for mood tracking, journaling, and care access on the go (this repo) | Happiffy/Happify-Mobile |
| π Happify-IOT | Voice-companion device paired and managed from this app | Happiffy/Happify-IOT |
System architecture:
graph TD
MB["π± Happify-Mobile (this repo)"] -->|REST + Firebase ID token| BE["βοΈ Happify-Backend"]
FE["π Happify-Frontend"] -->|REST + WebSocket| BE
MB -->|pairing + telemetry| DEV["π Happify-IOT device"]
DEV -->|runtime credential| BE
BE --> PG[("ποΈ PostgreSQL")]
BE --> FB["π₯ Firebase (Auth + FCM)"]
BE -->|voice / journal| AI["π§ Happify-AI"]
FB -->|push notifications| MB
style MB fill:#58CC02,color:#fff,stroke:#46A302
style BE fill:#1CB0F6,color:#fff,stroke:#168CC7
style AI fill:#CE82FF,color:#fff,stroke:#A760D2
style DEV fill:#FF9600,color:#fff,stroke:#D97A00
Principles this app is built around:
- Privacy by design β Community participation is alias-based, and location/heatmap data stays coarse and anonymous.
- Safety first β Voice and journal risk signals are computed by Happify-AI via the backend; the app surfaces them, it never decides on its own.
- Human support matters β Care chat, referrals, and emergency contacts are one tap away from the home shell.
- Accessible by default β Built-in text scaling, high contrast, reduced motion, and screen-reader-oriented settings, applied globally via
MediaQueryoverrides inmain.dart. - Secure operations β Firebase config files (
google-services.json,GoogleService-Info.plist) and the Android upload keystore are Git-ignored and injected only at CI release time.
- π Authentication β Firebase email/password and Google sign-in, session restoration on launch, and guest mode when Firebase isn't configured.
- π§ Onboarding & Consent β Illustrated intro slides, a guided account setup flow, and an explicit consent review screen before protected features unlock.
- π Mood Tracker & Analytics β Daily mood check-ins with trend charts and voice-conversation mood patterns.
- π Daily Journaling β Private reflections synced to the backend, enriched with AI-generated mood, risk level, and reflection text.
- ποΈ AI Voice Companion β Record a voice turn, see the live transcript, detected mood/risk, and play back the generated spoken reply.
- π§ Mindfulness β Breathing, grounding, and meditation exercises with per-activity progress tracking.
- π« Anonymous Community β Alias-based posts, comments, and support reactions in a moderated peer space.
- π€ Professional Care β Request referrals, browse providers, and chat live with an accepted psychologist (
/care,/care/chat/:sessionId). - π Companion Device Management β Pair a Happify Companion device, inspect telemetry, manage firmware/OTA status, and send haptic/display commands.
- π Consent Center β Granular consent toggles for AI processing, voice processing, device emotion observation, and heatmap contribution.
- βΏ Accessibility Controls β Text scale, high contrast, reduced motion, and screen-reader optimization, applied app-wide.
- π Push Notifications β FCM token registration and per-category notification preferences (care chat, referrals, mood reminders, wellbeing updates).
- π Emergency Contacts β Add, edit, and mark a primary emergency contact directly from the profile.
| Layer | Technology | Purpose |
|---|---|---|
| Framework | Flutter 3.38 (stable) | Cross-platform UI for Android and iOS |
| Language | Dart ~3.10 | Null-safe, strongly typed application code |
| State Management | flutter_bloc + equatable |
Cubit-per-feature pattern (mood, journal, care, community, companion, consent, home, profile) |
| Navigation | go_router |
Declarative routing with an auth-aware redirect guard |
| Networking | dio |
Shared ApiClient wrapping every backend call |
| Authentication | firebase_auth, google_sign_in, sign_in_button |
Email/password and Google sign-in |
| Push Notifications | firebase_messaging |
Foreground/background FCM handling |
| Voice | record, audioplayers, flutter_tts |
Recording, playback, and text-to-speech for the AI companion |
| Maps | flutter_map + latlong2 |
Anonymous heatmap / location-aware views |
| Rich Content | flutter_html |
Rendering journal/community HTML content |
| Media | image_picker |
Attaching images to journals, posts, and chat |
| UI | google_fonts, phosphor_flutter, iconify_flutter, colorful_iconify_flutter |
Typography and iconography matching the Happify design system |
| Local Storage | shared_preferences, path_provider |
Settings persistence and file paths |
| Location | geolocator |
Location access for heatmap contribution |
| Testing | flutter_test |
Widget/design-system regression tests |
| Distribution | flutter_launcher_icons, GitHub Actions |
App icon generation and signed Android release builds |
Happify-Mobile/
βββ lib/
β βββ main.dart # Entry point, GoRouter routes + auth redirect guard
β β
β βββ core/
β β βββ app_services.dart # ApiClient (Dio), AuthController, AppSettings,
β β β # SpeechService, PushService β the app's service layer
β β βββ happify_repository.dart # Shared REST calls (profile, preferences, media, etc.)
β β βββ di/app_scope.dart # InheritedWidget wiring for services
β β βββ theme/ # happify_colors.dart, happify_theme.dart
β β βββ widgets/ # Shared buttons, emoji icons, quokka badge, etc.
β β
β βββ features/ # One folder per domain, each with bloc/ + data/
β βββ home/ # Dashboard shell and entry
β βββ mood/ # Mood tracking and analytics
β βββ journal/ # Daily journaling
β βββ companion/ # Device pairing, telemetry, firmware/OTA
β βββ community/ # Anonymous peer community
β βββ care/ # Referrals and live care chat
β βββ consent/ # Consent management
β βββ profile/ # Profile, password, notifications, psychologist application
β βββ onboarding/ # Account setup flow
β βββ media/ # Image upload repository
β βββ *_pages.dart # Route-level page composition per module
β
βββ assets/
β βββ mascot/ # App icon + quokka artwork
β βββ illustrations/ # Onboarding and auth illustrations
β
βββ android/ # Android project (signing config injected at CI time)
βββ ios/ # iOS project (Runner target)
βββ .github/workflows/android.yml # CI: analyze on every PR, signed release on tag/dispatch
βββ test/ # Widget and design-system regression tests
βββ .env.example
βββ pubspec.yaml
Each feature module follows the same shape: a Cubit (bloc/*_cubit.dart) holding an immutable State (bloc/*_state.dart), backed by a Repository (data/*_repository.dart) that calls HappifyRepository/ApiClient, with a top-level bloc_<feature>_page.dart composing the UI.
Startup and auth-aware routing (main.dart):
flowchart TD
A[App launch] --> B[Initialize Firebase]
B --> C[Load AppSettings from SharedPreferences]
C --> D[AuthController.initialize β restore Firebase session]
D --> E[SplashPage]
E --> F{Session restoring?}
F -->|yes| E
F -->|no| G{canUseProtectedFeatures?}
G -->|yes| H["/app β Happify Shell"]
G -->|no, onboarding done| I["/welcome"]
G -->|no, first launch| J["/onboarding"]
H --> K{consentReviewed?}
K -->|no| L["/consent β must review before continuing"]
K -->|yes| H
A voice companion turn:
sequenceDiagram
participant U as User
participant M as Happify-Mobile
participant BE as Happify-BE
participant AI as Happify-AI
U->>M: Tap record, speak
M->>M: Capture audio (record package)
M->>BE: POST /voice/turns (audio + Firebase ID token)
BE->>AI: POST /api/process-audio
AI-->>BE: transcript, response, mood, risk_policy, audio_url
BE-->>M: Structured voice turn result
M->>M: Display transcript + mood/risk badges
M->>M: Play response audio (audioplayers / flutter_tts)
Companion-device pairing:
sequenceDiagram
participant U as User (Mobile)
participant M as Happify-Mobile
participant BE as Happify-BE
participant D as Happify-IOT device
U->>M: Start pairing from /companion
M->>BE: POST /devices/pairing-sessions
BE-->>M: pairingSessionId + short code
U->>D: Enter code on device / device polls session
D->>BE: Claim pairing session (device claim secret)
BE-->>M: WebSocket / poll: pairing completed
M->>BE: GET /devices/:id (telemetry, firmware, status)
BE-->>M: Device state
| Path | Description |
|---|---|
/ |
Splash screen β Firebase session restoration |
/onboarding |
First-launch illustrated intro |
/welcome |
Sign-in entry point |
/login Β· /register Β· /forgot |
Email/password and Google authentication |
/setup |
Post-registration account onboarding |
/consent |
Mandatory consent review before protected features |
/app |
Main Happify shell (home, mood, journal, mindfulness, profile tabs) |
/companion |
Companion-device pairing and management |
/voice |
AI Voice Companion |
/care Β· /care/chats Β· /care/request Β· /care/chat/:sessionId |
Referrals, care-chat list, new request, live chat |
/contacts Β· /contacts/new Β· /contacts/edit |
Emergency contact management |
/profile/edit Β· /profile/password Β· /profile/psychologist |
Profile editing, password change, psychologist verification |
/notifications |
Notification preference settings |
GoRouter's redirect callback (in main.dart) centrally enforces: unauthenticated users are bounced to /welcome, authenticated-but-not-yet-consented users are forced through /consent, and already-authenticated users are redirected away from /login//register//welcome straight into /app.
Flutter reads configuration through --dart-define / --dart-define-from-file, not a bundled .env file. Create a local .env from .env.example for reference:
BE_API_URL=https://happify-be-production.up.railway.app| Variable | Description |
|---|---|
BE_API_URL |
Base URL of Happify Backend β the only backend the app talks to |
The mobile app deliberately does not define an
AI_SERVICE_BASE_URLβ AI access is always brokered by Happify Backend.
Firebase configuration is provided through the official native files, not environment variables:
- Android β
android/app/google-services.json - iOS β
GoogleService-Info.plist, added to the Runner target in Xcode
Both are Git-ignored. Without them, the app still opens in guest mode, but authentication and push notifications are unavailable.
- Flutter
3.38.9(stable channel) - Dart
3.10.8 - Android Studio or Xcode for your target platform
- A reachable Happify Backend instance
- Firebase project configuration for the target platform(s)
git clone https://github.com/Happiffy/Happify-Mobile.git
cd Happify-Mobile
flutter pub getCreate .env.emulator:
BE_API_URL=http://10.0.2.2:4000flutter run --dart-define-from-file=.env.emulator10.0.2.2 is the Android emulator's alias for the host machine's localhost.
flutter run --dart-define=BE_API_URL=https://your-backend.exampleflutter build apk --release --dart-define-from-file=.env
flutter build appbundle --release --dart-define-from-file=.envflutter analyze
flutter test
flutter build apk --debug --dart-define-from-file=.env.github/workflows/android.yml runs on every pull request and push to main, plus a dedicated signed-release job:
flowchart LR
A[PR / push to main] --> Q["quality job:<br/>flutter pub get + flutter analyze"]
T["Tag mobile-v* or<br/>manual dispatch"] --> Q
Q --> R{Release job triggered?}
R -->|yes| V[Validate secrets +<br/>BE_API_URL is HTTPS]
V --> M[Materialize keystore +<br/>google-services.json from secrets]
M --> B[flutter build apk/appbundle --release]
B --> S[Verify APK/AAB signatures<br/>match the expected keystore]
S --> U[Upload artifacts]
U --> G{Tag push?}
G -->|yes| REL[Publish GitHub Release<br/>with APK + AAB + SHA256SUMS]
G -->|no| END[Artifacts only]
style Q fill:#58CC02,color:#fff
style S fill:#1CB0F6,color:#fff
style REL fill:#FFC800,color:#000
The release job requires five repository secrets β ANDROID_KEYSTORE_BASE64, ANDROID_KEYSTORE_PASSWORD, ANDROID_KEY_ALIAS, ANDROID_KEY_PASSWORD, GOOGLE_SERVICES_JSON_BASE64 β and an optional BE_API_URL repository variable/secret (defaults to the production API). It also asserts the decoded google-services.json belongs to the correct Firebase project (happify-990c2) and Android package (com.happify.app.mobile_happify) before building.
Built for
AI-Powered Mental Wellness Platform
Happify-Mobile is the on-the-go client of Happify, a privacy-aware digital wellbeing ecosystem built around early detection, meaningful support, and lifelong emotional growth:
| Layer | Component | Role |
|---|---|---|
| π Web | Happify-FE | Mood tracking, journaling, anonymous community, care workflows |
| βοΈ Backend | Happify-BE | API, PostgreSQL, Firebase, WebSocket hub, safety & moderation |
| π§ AI | Happify-AI | Journal reflection, risk detection, voice processing |
| π± Mobile | Happify-Mobile (this repo) | Flutter app for on-the-go mood tracking and care access |
| π IoT | Happify-IOT | Voice-companion device paired from this app |
Outstanding BINUSIAN Team β Garuda Hacks 7.0
| Name | Role |
|---|---|
| Andrian Pratama | Full-stack Developer |
| Khalisa Amanda Sifa Ghaizani | IoT Engineer |
| Michella Arlene Wijaya Radika | Product Developer |
| Stanley Nathanael Wijaya | Product Developer |
This project is licensed under the MIT License β free to use, modify, and distribute.
MIT License
Copyright (c) 2026 Happify β Garuda Hacks 7.0
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software.
"Detect early. Support meaningfully. Grow for life."
Made with π± for Garuda Hacks 7.0