The web client of Happify β an AI-powered mental wellness platform that helps people track their mood, journal safely with AI-assisted reflection, connect anonymously with a caring community, and reach real professional support when it matters most.
π Frontend Β· βοΈ Backend Β· π§ AI Β· π± Mobile Β· π IoT
Happify-Frontend is the primary web surface of the Happify ecosystem. It's where a person signs up, tells the app what kind of support they're looking for, checks in with their mood, writes a private journal entry that gets an AI-generated reflection, browses an anonymous community feed, and β when it matters β reaches a real, verified psychologist through a live chat.
Happify-Frontend's role in the ecosystem: "The front door β the calm, encouraging surface where every wellbeing signal a user shares gets captured, visualized, and, when it matters, routed to a human."
The frontend never talks to the AI layer directly. Every request β mood entries, journals, community posts, referrals, chat messages β flows through Happify Backend, which handles auth verification, persistence, AI orchestration, and real-time fan-out over WebSockets.
| Framework | React 19 + Vite 8 |
| Language | TypeScript ~6.0 |
| Styling | Tailwind CSS v4 + a Duolingo-inspired "playful but safe" design system |
| Auth | Firebase Authentication (Email/Password + Google) |
| Realtime | Native WebSocket for community, care, and chat channels |
| Charts / Maps | Recharts (mood trend, risk summary) Β· MapLibre GL (anonymous heatmap) |
Happify-Frontend is the user-facing dashboard of the platform β every wellbeing signal a person shares here flows through the backend, gets enriched by the AI layer, and can surface again on mobile or through the companion IoT device.
| Repository | Role | Link |
|---|---|---|
| π Happify-FE | Web dashboard β mood, journal, community, care (this repo) | Happiffy/Happify-FE |
| βοΈ Happify-BE | Node.js API, PostgreSQL, Firebase, WebSocket hub, safety workflows | 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 | Happiffy/Happify-Mobile |
| π Happify-IOT | Optional companion-device integration for opt-in wellbeing support | Happiffy/Happify-IOT |
System architecture:
graph TD
A["π Happify-Frontend (this repo)"] -->|REST + WebSocket| B["βοΈ Happify-BE"]
M["π± Happify-Mobile"] -->|REST + WebSocket| B
B --> C[("ποΈ PostgreSQL")]
B --> D["π₯ Firebase Auth"]
B --> E["π§ Happify-AI"]
E -->|risk score + reflection| B
B --> F["π Happify-IOT (optional)"]
style A fill:#58CC02,color:#fff,stroke:#46A302
style B fill:#1CB0F6,color:#fff,stroke:#168CC7
style E fill:#CE82FF,color:#fff,stroke:#A760D2
Principles this frontend is built around:
- Privacy by design β Community posts show an alias, not an identity; the heatmap only ever renders coarse regions built from at least three anonymous contributions.
- Safety first β The AI companion supports, it does not diagnose. Referrals and care chat are an explicit, human-reviewed escalation path.
- Human support matters β A user can request a professional referral anytime; a verified psychologist can accept it and open a live chat.
- Accessible by default β Responsive layouts, with accessibility and tone preferences captured during onboarding.
- Secure operations β Firebase ID tokens are attached per request and auto-refreshed; no credentials are ever hard-coded or committed.
- π Authentication β Firebase email/password and Google sign-in, synced into a Happify backend session via
POST /auth/verify. - π§ Guided Onboarding β A 4-step questionnaire capturing the user's goal, mood triggers, preferred companion tone, and crisis coping preference.
- π Wellbeing Dashboard β Totals at a glance, a mood-intensity trend chart, and a journal risk-level breakdown.
- π Rich-Text Journaling β A Tiptap editor for daily reflections with optional images and AI-generated reflections/risk levels.
- π« Anonymous Community β Alias-based posts, image attachments, support reactions, and threaded replies β all live via WebSocket.
- πΊοΈ Anonymous Mood Heatmap β A MapLibre GL map of k-anonymous regional mood blocks with a custom date-range filter.
- π€ Referrals & Care Chat β Users request professional support; psychologists review, accept, and land in a live 1:1 chat.
- π¬ Real-Time Chat β Typing indicators, read receipts, presence, optimistic sends, and image attachments over WebSocket.
- π§ββοΈ Psychologist Role β A dedicated role with scoped navigation and a certificate/license verification flow.
- π€ Profile Management β Display name and password updates, including linking a password onto a Google-only account.
- π± Responsive, Playful UI β A warm green/blue gradient, rounded "duo" cards, and Phosphor/Fluent-emoji iconography throughout.
| Layer | Technology | Purpose |
|---|---|---|
| Framework | React 19.2 | Component-driven UI |
| Build Tool | Vite 8 + @vitejs/plugin-react |
Dev server, HMR, chunked production bundling |
| Language | TypeScript ~6.0 | Type-safe components, API contracts, hooks |
| Routing | React Router 7 | Client-side routing, nested dashboard sections, protected routes |
| Styling | Tailwind CSS v4 (@tailwindcss/vite) |
Utility-first styling, driven from src/index.css |
| Component System | shadcn/ui (base-nova style) |
Reusable UI primitives under @/components/ui |
| HTTP Client | Axios | Typed API calls with auth interceptors |
| Authentication | Firebase Authentication | Email/password + Google OAuth, ID-token issuance |
| Realtime | Native WebSocket API |
Community, care, and per-session chat channels |
| Charts | Recharts | Mood intensity trend, risk-level donut chart |
| Maps | MapLibre GL + @mapcn registry |
Anonymous heatmap rendering |
| Rich Text | Tiptap | Journal and community post editor |
| Animation | GSAP 3 (ScrollTrigger) |
Landing page scroll-triggered reveals |
| Icons | Phosphor Icons + Iconify (fluent-emoji-flat) |
UI icons and colorful emoji-style icons |
| Testing | Vitest | Unit tests (e.g. auth.service.test.ts) |
| Linting | Oxlint + vite-plugin-checker |
Fast linting and build-time type safety |
Happify-FE/
βββ public/
β βββ mascot-quokka.png # Happify's quokka mascot
β
βββ src/
β βββ App.tsx # Route table + ProtectedRoute (Firebase auth gate)
β βββ main.tsx # React entry point
β β
β βββ api/dashboard/ # Typed Axios calls: profile, mood, journal, community,
β β # referral, care chat, heatmap, uploads
β βββ config/ # api-client.ts (auth interceptor), firebase.ts
β βββ constants/ # api.ts (endpoint map), emoji.ts, api-service.ts
β βββ hooks/dashboard/ # useDashboardData β central data + pagination hook
β β
β βββ components/
β β βββ ui/ # Shared primitives (map.tsx, theme.ts, index.tsx)
β β βββ dashboard/ # Confirm modals, dashboard panels
β β βββ journal-journey/ # Journal entry timeline
β β βββ rich-text-editor/ # Tiptap wrapper (getText / getHTML / clear)
β β βββ colored-icon/ # Rounded, tinted icon chip
β β βββ community-heatmap.tsx # MapLibre GL region renderer
β β
β βββ pages/
β β βββ landing/ # Public marketing page
β β βββ auth/ # Login/Register + auth.service.ts
β β βββ onboarding/ # 4-step preference questionnaire
β β βββ dashboard/ # Main app: overview, records, community, care, chat, profile
β β
β βββ types/ # Shared TypeScript types
β βββ assets/ # Hero illustration, mascot artwork
β
βββ vite.config.ts # @ alias, Tailwind + checker plugins, dev proxy
βββ components.json # shadcn/ui config
βββ .env.example # Required environment variables
βββ package.json
End-to-end user journey:
sequenceDiagram
participant U as User
participant FE as Happify-Frontend
participant BE as Happify-BE
participant AI as Happify-AI
U->>FE: Sign up (email or Google)
FE->>BE: POST /auth/verify (Firebase ID token)
BE-->>FE: userId + role
FE->>U: Redirect to /onboarding
U->>FE: Answer 4 preference questions
FE->>BE: POST /preferences
FE->>U: Redirect to /dashboard
FE->>BE: Fetch profile, analytics, community, referrals, chats
FE->>BE: Open WebSocket channels (community, care, user:id:care)
U->>FE: Write journal entry
FE->>BE: POST /journal
BE->>AI: Analyze content
AI-->>BE: riskLevel + aiReflection
BE-->>FE: Saved journal with reflection
U->>FE: Request professional support
FE->>BE: POST /referral
BE-->>FE: Referral (PENDING)
Note over BE,FE: Psychologist reviews & accepts
BE-->>FE: WebSocket push β open live care chat
Authentication & request flow:
flowchart LR
A[Firebase Auth SDK] -->|sign in| B[apiClient / Axios]
B -->|attaches Bearer idToken| C[Happify Backend API]
C -->|200 OK| D[Response returned]
C -->|401| E{Retry once with refreshed token?}
E -->|success| C
E -->|fails again| F[Sign out + clear session + redirect to /login]
style A fill:#FFCA28,color:#000
style C fill:#1CB0F6,color:#fff
style F fill:#FF4B4B,color:#fff
A warm, "playful but safe" visual language (Duolingo-inspired), defined centrally in src/components/ui/theme.ts:
| Token | Role | Appearance |
|---|---|---|
page |
App background | Soft green/blue radial gradient over near-white |
primaryBtn |
Main CTAs | Happify green (#58CC02), solid drop shadow, lifts on hover |
secondaryBtn |
Secondary actions | Sky blue (#1CB0F6) pill buttons |
card |
Content containers | Rounded 28px corners, 2px border, flat drop shadow |
tones.* |
Status & mood accents | green / blue / gold / red / purple / peach |
Mood palette (shared across dashboard, journal risk chart, and the heatmap):
| Mood | Color | Meaning |
|---|---|---|
HAPPY |
π’ #58CC02 |
Positive check-ins |
CALM |
π΅ #1CB0F6 |
Calm check-ins |
NEUTRAL |
π‘ #FFC800 |
Neutral check-ins |
ANXIOUS |
π #FF9600 |
Elevated-concern check-ins |
SAD |
π£ #CE82FF |
Low-mood check-ins |
DISTRESSED |
π΄ #FF4B4B |
Highest-concern check-ins, CRISIS risk level |
Iconography: Phosphor Icons for interface chrome; Fluent flat emoji (via Iconify) for warm, human touches on cards and mood states.
All requests go through the shared apiClient against endpoints in src/constants/api.ts (built from VITE_API_URL):
| Endpoint | Purpose |
|---|---|
POST /auth/verify |
Exchange a Firebase ID token for a Happify session |
GET/PATCH /profile |
Read/update the signed-in user's profile |
POST /profile/psychologist-applications |
Submit psychologist verification |
GET/POST /preferences |
Onboarding preferences |
GET /analytics/dashboard |
Totals, mood trend, risk summary, recent journals |
POST /mood |
Save a mood check-in |
GET/POST /journal |
List/create journal entries (AI reflection + risk level) |
GET/POST /community, /community/:id/comments, /community/:id/support |
Community feed, replies, support reactions |
GET /heatmap |
Coarse, k-anonymous mood regions for a date range |
POST/GET/PATCH /referral |
Request, list, and review professional referrals |
GET /care-chat, POST /care-chat/:id/messages, PATCH /care-chat/:id |
Live care chat sessions and messages |
POST /media/images |
Upload a base64 image, receive a hosted URL |
WS /ws?channel=... |
Realtime updates for community, care, user:<id>:care, care-chat:<sessionId> |
The frontend never calls the AI service directly β reflections and risk scoring are computed by Happify-AI, orchestrated through Happify-BE.
| Path | Access | Description |
|---|---|---|
/ |
Public | Landing page |
/login Β· /register |
Public | Sign in / create an account |
/onboarding |
Public (post-register) | 4-step preference questionnaire |
/dashboard |
π Protected | Overview β stats, trends, heatmap, recent activity |
/dashboard/records |
π Protected | Mood check-ins and journal entries |
/dashboard/community |
π Protected | Anonymous community feed and heatmap |
/dashboard/care |
π Protected | Referral requests / review queue (role-aware) |
/dashboard/chat |
π Protected | Real-time care chat |
/dashboard/history |
π Protected | Closed care chat history |
/dashboard/profile |
π Protected | Profile, password, psychologist application |
ProtectedRoute waits for auth.authStateReady() before redirecting, avoiding a flash of the wrong screen on refresh.
Create .env from .env.example:
VITE_API_URL=http://localhost:4000
VITE_FIREBASE_API_KEY=
VITE_FIREBASE_AUTH_DOMAIN=
VITE_FIREBASE_PROJECT_ID=
VITE_FIREBASE_APP_ID=
VITE_FIREBASE_MEASUREMENT_ID=| Variable | Description |
|---|---|
VITE_API_URL |
Base URL of the Happify Backend (also used to derive the WebSocket URL) |
VITE_FIREBASE_API_KEY |
Firebase Web API key |
VITE_FIREBASE_AUTH_DOMAIN |
Firebase authentication domain |
VITE_FIREBASE_PROJECT_ID |
Firebase project identifier |
VITE_FIREBASE_APP_ID |
Firebase Web application identifier |
VITE_FIREBASE_MEASUREMENT_ID |
Firebase Analytics measurement ID (optional) |
β οΈ The app throws immediately ifapiKey,authDomain,projectId, orappIdare missing β it will not boot without a valid Firebase configuration.
- Node.js 22.x
- npm
10.9.4or later - A running Happify Backend instance reachable at
VITE_API_URL - A Firebase Web app with Email/Password and Google sign-in enabled
git clone https://github.com/Happiffy/Happify-FE.git
cd Happify-FE
npm ci
cp .env.example .env # then fill in your Firebase project credentialsnpm run devThe app starts at http://localhost:5173. Requests to /api are proxied to http://localhost:4000 in development.
npm run build # tsc -b && vite build
npm run preview # serve the production build locallynpm run lint # Oxlint
npm test # Vitest
npm run build # Type-check + production build| Landing Page | Feature Section |
|---|---|
![]() |
![]() |
| Overview Dashboard | Anonymous Heatmap |
|---|---|
![]() |
![]() |
| Records Page | Community Page |
|---|---|
![]() |
![]() |
| Chat Page | Profile Page |
|---|---|
![]() |
![]() |
Built for
AI-Powered Mental Wellness Platform
Happify-Frontend is the web dashboard of Happify, a privacy-aware digital wellbeing ecosystem built around early detection, meaningful support, and lifelong emotional growth:
| Layer | Component | Role |
|---|---|---|
| π Web | Happify-FE (this repo) | 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 | Flutter app for on-the-go mood tracking and care access |
| π IoT | Happify-IOT | Optional companion-device integration |
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







