DEV Community

nabiel ilyasa
nabiel ilyasa

Posted on

Frist Challenge

DEV Weekend Challenge: Community

The Community
MindCare Community was built for the Indonesian community particularly young adults, students, and general public β€” who often lack easy access to mental health screening tools and psychological support. Mental health literacy is still growing in Indonesia, and many people don't know where to start. This platform is designed as a preventive, educational, and supportive first step before professional intervention.

What I Built
MindCare Community β€” a full-stack mental health platform built with Next.js 15, TailwindCSS, and Groq AI (LLaMA 3).

Key features:

🧠 Mental Health Screening β€” PHQ-9 and SRQ-20 standardized instruments with risk scoring and PDF reports
πŸ«€ Physical Health Screening β€” Cardiovascular and metabolic risk assessment
πŸ“Š Daily Mood Tracker β€” Trend analysis with self-care recommendations
πŸ’¬ AI Psychological Consultation β€” Emotion detection, 4 AI personas (Supportive Friend, Calm Therapist, Direct Coach, Spiritual Guide), Calm Mode UI, and Emotional Energy Battery indicator
πŸŽ™οΈ Real-Time Voice AI Mode β€” Speak directly to AI: mic β†’ speech-to-text β†’ AI β†’ text-to-speech
🧩 MBTI Personality Test β€” 16-type assessment with cognitive function-grounded AI profiles and shareable result images
πŸŒ™ Glassmorphism UI β€” Light/dark mode persisted in localStorage, floating gradient orbs, smooth transitions
Demo
πŸ”— Live: https://preventive-health-screening-tool-gt.vercel.app/

Code

Health Risk Self-Assessment Website

A comprehensive Next.js 14+ web application for health risk self-assessment with AI psychological consultation featuring real-time facial emotion detection.

🌟 Features

Health Assessment

  • Interactive health risk assessment form
  • Auto-calculating BMI
  • Rule-based risk scoring (0-100)
  • Personalized lifestyle recommendations
  • Visual charts and analytics

AI Psychological Consultation

  • Real-time facial emotion detection (client-side only)
  • AI-powered supportive chat with emotion context
  • Crisis detection and safety protocols
  • Privacy-first: no video/images stored

Admin Dashboard

  • Secure login system
  • Assessment statistics and analytics
  • Risk distribution visualization
  • Chat session analytics
  • Emotion distribution tracking

πŸš€ Getting Started

Prerequisites

  • Node.js 18+
  • npm or yarn

Installation

  1. Clone the repository:
git clone <your-repo-url>
cd "Kesehatan Tester"
Enter fullscreen mode Exit fullscreen mode
  1. Install dependencies:
npm install
Enter fullscreen mode Exit fullscreen mode
  1. Set up environment variables: Create a .env.local file in the root directory with:
OPENAI_API_KEY=your_openai_key
GROQ_API_KEY=your_groq_key
GROQ_API_KEY_FALLBACK_1=your_fallback_key_1
GROQ_API_KEY_FALLBACK_2=your_fallback_key_2
ADMIN_EMAIL=yesii@admin
ADMIN_PASSWORD=yesii123
SESSION_SECRET=your_session_secret
Enter fullscreen mode Exit fullscreen mode
  1. Download face-api.js…

How I Built It
Stack:

Framework: Next.js 15 (App Router)
Styling: TailwindCSS with custom glassmorphism design system
AI: Groq API (LLaMA 3.3-70B) with 9 API key rotation for load balancing and zero-downtime failover
Database: NeonDB (PostgreSQL) via Prisma
Auth: Iron Session (JWT-based admin sessions)
Speech: Web Speech API (SpeechRecognition + speechSynthesis)
Deployment: Vercel
Architecture highlights:

Dynamic multi-layer system prompt: persona Γ— MBTI Γ— calm mode Γ— detected emotion Γ— energy state β€” all composited per request
MBTI profiles grounded in cognitive function theory (Ni/Ne/Si/Se/Ti/Te/Fi/Fe), not stereotypes
Voice engine with silence detection, emotion heuristics, and crisis safety guard
Glassmorphism CSS design system using CSS custom properties with dark/light mode class strategy and FOUC prevention

Top comments (0)