School of Science and Technology 科技學院
Computing Programmes 電腦學系

MoodBuddy: AI-Driven Mental Health Companion 

Fung Yin Ho, Chan Sze Yuen, Kwok Wing Yan

ProgrammeBachelor of Computing with Honours in Internet Technology

Bachelor of Science with Honours in Computer Science
SupervisorDr. Dani Assi
AreasIntelligent Applications
Year of Completion2025

Objectives

Project Aim

The specific problem to be solved in this project is the difficulty of obtaining mental health support, which includes barriers such as delayed access to professional help, high costs of therapy, stigma, privacy concerns, and a lack of continuous monitoring and personalized support. These challenges can exacerbate mental health conditions and deter individuals from seeking care. The aim of this project is to develop MoodBuddy, an AI-driven mobile application designed to provide accessible, affordable, and stigma-free mental health care.

Project Objectives

The objectives of this project include: 

  • Safe & Private Space 
    Enable judgment-free sharing of feelings to break down stigma around mental health. 
  • Continuous Mood Tracking & Analysis 
    Monitor emotional patterns and triggers over time to deliver personalized support and timely interventions. 
  • Affordable Mental Health Support 
    Leverage AI-driven recommendations and self-help tools to lower costs and widen access. 
  • Convenient & Always-On 
    Offer real-time feedback and hands-free interaction so help is literally within arm's reach. 

Ultimately, MoodBuddy strives to boost users' mental well-being and foster a kinder, more supportive society. 

Videos

Demonstration Video

Presentation Video

Methodologies and Technologies used

Figure 1: System Block diagram 

Supporting Technologies

Front-End 

  • React Native 
    Single JavaScript/TypeScript codebase for iOS & Android 
    Dramatically cuts cross-platform dev time 

Back-End 

  • Python + PyMongo → MongoDB 
    Stores user journals, metadata, chat history 
  • Gemini-Flash-2.0 
    Powers real-time, “human-like” chat interactions 

Authentication & User Management 

  • Firebase Auth 
    Handles signup, login, password resets 
  • Securely stores user profiles & credentials 

Networking Workaround 

  • NordVPN (or similar) 
    Clears regional blocks on the Gemini API 

Architecture Microservices 

  • Independently deployable services 
  • Scales horizontally, supports continuous integration 
  • Permits diverse tech stacks per service

User Interface design

  • React Native chosen over native IDEs (Android Studio/Xcode) because: 
  • Single JavaScript codebase for iOS & Android → faster development & lower maintenance 
  • Leverages a rich ecosystem of cross-platform UI components 
  • No need to learn multiple languages (Java/Swift)

Database Design

  • MongoDB (NoSQL) for journal entries: 
  • Flexible schema handles dynamic, unstructured data 
  • Rich query capabilities for rapid iteration 
  • Simpler modeling than alternatives like Apache Cassandra 

Collections 

  • Journals 
  • Fields: text content, mood factors, image URI, mood label, timestamp 

Login Module

Figure 2: Authentication Sequence Diagram 

When user interacts with login interface using their email and password, this module handles the authentication process using Firebase Authentication. After successful authentication, Firebase returns user information from firebase database and user will be redirected to the home screen, allowing them to access the main features of MoodBuddy.

Chat Buddy Module

  • When the chatbot loads, it sends the input type (text/audio) and user ID to the backend.

  • The backend retrieves the user’s MBTI from Firebase and recent mood from MongoDB.

  • These details are sent to the Gemini API to initialize a personalized chat session.

  • The user can then interact with the chatbot via text or voice.

  • User input is streamed to Gemini through the backend, which returns supportive, tailored responses in real time—either as text or audio.

Figure 3: ChatBuddy data flow Diagram 

Mood Journal Module

The Journal interface allow user to write new journal entry or view their past record.
When the new entry is submitted, the data will be sent to Backend server vis POST
request and store into MongoDB with user ID and timestamp. Then, user will be
26
redirect to the journal tab. Once the journal tab is loaded, the existing journal record is
fetched via GET request and displayed to user.

Figure 4: Mood Journal Data Submission and Retrieval Flow 

Mood Insight module

User can select a time basis from mood insight dashboard (weekly, monthly or yearly), backend
server will then retrieves journal records from MongoDB with the given range and processes
the data and returns in a visualized format, such as line chart, pie chart. This helps users
understand their emotional trends

Figure 5: Mood Insight Data Retrieval and Visualization Flow 

Results (Prototype System Design)

Core Functionality 

  1. User Login & Sign-Up 
  • Email/password authentication (unique email per account) 
  • Post-login: fetches personal data (MBTI, mood history) to tailor AI interactions 
  1. MBTI Personality Checker 
  • 1-, 5-, or 10-minute test options 
  • Deeper tests yield finer personality insights for more personalized support 
  1. Chat Buddy 
  • Text & voice conversations powered by Gemini-Flash 2.0 (live-streaming API) 
  • Low latency ( 
  • Adapts tone based on user personality and recent mood trends 
  1. Mood Journal 
  • Daily space to log feelings, thoughts, activities, and images 
  • Guided prompts (e.g., “What triggered today's mood?”) 
  • Private, judgment-free zone for honest expression 
  1. Mood Insight 
  • Visualizes emotional patterns over weekly, monthly, and quarterly spans 
  • Transforms journal entries into charts/diagrams for self-reflection 
  1. Relaxation Techniques 
  • On-demand methods to ease stress: 
  • Sleep Therapy 
  • Guided Meditation 
  • Mini-games 

Figure 6: MoodBuddy Chat

There is our Chatbot, we can receive different real-time responses with different MBTI.

  • Extraverts: Emojis and upbeat tones (e.g., “Hey there!”) enhance emotional connection.
  • Introverts: Focus on deep listening and step-by-step guidance (e.g., “Let's take things one step at a time”).
Figure 7 Record Mode

Figure 7: Record Mode 

Record Page

The user can talk to the chatbot in a “phone call”. The real-time voice input has with <500ms low latency (about 2-3 seconds response time). 

Figure 8: MBTI Engine Page 

The MBTI question logic optimized using Myers-Briggs theory (e.g., energy source question: “Alone vs. Socializing”) and having their own dynamic result pages.

Figure 8.1 Insight Page

Figure 9: Insight Page 

Figure 8.2 Insight Page

In the Journal will have some manual tags (e.g., “Joyful,” “Neutral”), contextual tags (e.g., “Friends,”“Weather”) enriching the emotional context. Also, doing donut charts for annual mood distribution.

Evaluation

Test Variables 

Response Time 

  • Measure time from user request to server response 
  • Tool: Gatling load tests simulating concurrent users; compute average response time 

Processing Speed 

  • Time the server spends handling each request (e.g., login, chatbot creation, journal save) 
  • Tool: Firebase Performance Monitoring execution traces 

Error Handling 

  • Verify system behavior under failure conditions 
  • Method: Define assertions in Gatling scripts to confirm graceful degradation and proper error codes 

Throughput 

  • Count of successful requests per unit time under load 
  • Tool: Gatling with varying concurrent user counts, recording requests/sec 

Resource Usage 

  • CPU, memory, and network bandwidth consumption during operation 
  • Tools: New Relic APM and Firebase Performance Monitoring 

Toolchain 

  • Gatling for high-scale load and stress tests 
  • Firebase Performance Monitoring for mobile-side tracing and network metrics 
  • New Relic APM for end-to-end back-end resource profiling

Outcomes 

  • Identify bottlenecks in latency, throughput, and resource consumption 
  • Ensure stable operation under peak loads 
  • Validate robust error handling before production rollout 
  • Participants
    Individuals from diverse backgrounds experiencing various mental health challenges
  • Testing Environment
    Full-featured MoodBuddy app on users' own devices
  • Objective
    Simulate real-world use and gauge the app's impact on mental well-being
  • Duration
    2–3 months of continuous use

Procedure

  • Collect feedback via: 
    – Real-time monitoring of in-app behavior 
    – Scheduled questionnaires at 1 week, 1 month, 2 months, and 3 months 
  • Post-test analysis of usage data and self-reported emotional responses to measure the app's effectiveness 

Conclusion

Objectives Achieved 

  1. Intuitive UI across Home, Journal, Chat, Insight, Settings (React Native + Expo) 
  2. AI-driven text/audio responses personalized by MBTI & mood history 
  3. Multi-length MBTI assessment stored in Firebase for chatbot tuning 
  4. Mood Journal module with guided prompts saved in MongoDB 
  5. Mood Insight charts aggregating entries over time 
  6. Voice-enabled chatbot interaction 

Summary of Achievements

  • Full-stack cross-platform mobile app (React Native + Expo) 
  • Real-time text & audio chatbot (Gemini-Flash 2.0) 
  • Secure authentication (Firebase Auth) 
  • Personalized AI tone using MBTI & journal data 
  • Persistent journal storage & retrieval (MongoDB) 

Limitations 

Technical 

  • Peak Gemini latency (~1000 ms under 4 concurrent users) 
  • Voice chat limited to English; cultural/language biases remain 

Data & Ethical 

  • Targets digital natives (18–40); needs elder- and teen-friendly features 
  • Short test period; long-term efficacy unverified 

Clinical 

  • Chatbot offers comfort, not professional therapy 

Future Development

Technology Enhancements 

  • Emotion-breakdown prediction (Markov chains) 
  • Multi-modal mood detection (text, voice, facial, wearable data) 
  • Real-time tracking & clinical validation 
  • Crisis grading with automatic intervention 

User Experience 

  • Anonymous support community (“drift bottle”) 
  • VR-based guided meditation 

Business Models 

  • Free basic features; premium AI + therapist consultations 
Jonathan Chiu
Marketing Director
3DP Technology Limited

Jonathan handles all external affairs include business development, patents write up and public relations. He is frequently interviewed by media and is considered a pioneer in 3D printing products.

Krutz Cheuk
Biomedical Engineer
Hong Kong Sanatorium & Hospital

After graduating from OUHK, Krutz obtained an M.Sc. in Engineering Management from CityU. He is now completing his second master degree, M.Sc. in Biomedical Engineering, at CUHK. Krutz has a wide range of working experience. He has been with Siemens, VTech, and PCCW.

Hugo Leung
Software and Hardware Engineer
Innovation Team Company Limited

Hugo Leung Wai-yin, who graduated from his four-year programme in 2015, won the Best Paper Award for his ‘intelligent pill-dispenser’ design at the Institute of Electrical and Electronics Engineering’s International Conference on Consumer Electronics – China 2015.

The pill-dispenser alerts patients via sound and LED flashes to pre-set dosage and time intervals. Unlike units currently on the market, Hugo’s design connects to any mobile phone globally. In explaining how it works, he said: ‘There are three layers in the portable pillbox. The lowest level is a controller with various devices which can be connected to mobile phones in remote locations. Patients are alerted by a sound alarm and flashes. Should they fail to follow their prescribed regime, data can be sent via SMS to relatives and friends for follow up.’ The pill-dispenser has four medicine slots, plus a back-up with a LED alert, topped by a 500ml water bottle. It took Hugo three months of research and coding to complete his design, but he feels it was worth all his time and effort.

Hugo’s public examination results were disappointing and he was at a loss about his future before enrolling at the OUHK, which he now realizes was a major turning point in his life. He is grateful for the OUHK’s learning environment, its industry links and the positive guidance and encouragement from his teachers. The University is now exploring the commercial potential of his design with a pharmaceutical company. He hopes that this will benefit the elderly and chronically ill, as well as the society at large.

Soon after completing his studies, Hugo joined an automation technology company as an assistant engineer. He is responsible for the design and development of automation devices. The target is to minimize human labor and increase the quality of products. He is developing products which are used in various sections, including healthcare, manufacturing and consumer electronics.

Course Code Title Credits
  COMP S321F Advanced Database and Data Warehousing 5
  COMP S333F Advanced Programming and AI Algorithms 5
  COMP S351F Software Project Management 5
  COMP S362F Concurrent and Network Programming 5
  COMP S363F Distributed Systems and Parallel Computing 5
  COMP S382F Data Mining and Analytics 5
  COMP S390F Creative Programming for Games 5
  COMP S492F Machine Learning 5
  ELEC S305F Computer Networking 5
  ELEC S348F IOT Security 5
  ELEC S371F Digital Forensics 5
  ELEC S431F Blockchain Technologies 5
  ELEC S425F Computer and Network Security 5
 Course CodeTitleCredits
 ELEC S201FBasic Electronics5
 IT S290FHuman Computer Interaction & User Experience Design5
 STAT S251FStatistical Data Analysis5
 Course CodeTitleCredits
 COMPS333FAdvanced Programming and AI Algorithms5
 COMPS362FConcurrent and Network Programming5
 COMPS363FDistributed Systems and Parallel Computing5
 COMPS380FWeb Applications: Design and Development5
 COMPS381FServer-side Technologies and Cloud Computing5
 COMPS382FData Mining and Analytics5
 COMPS390FCreative Programming for Games5
 COMPS413FApplication Design and Development for Mobile Devices5
 COMPS492FMachine Learning5
 ELECS305FComputer Networking5
 ELECS363FAdvanced Computer Design5
 ELECS425FComputer and Network Security5