Skip to content

A mobile application that lets you write journal entries, tracks your mood and plays music for you, all powered by AI and automation.

License

Notifications You must be signed in to change notification settings

Daniel-Hayek/heart-beat

Repository files navigation



License

License: MIT

This project is licensed under the MIT License - see the LICENSE file for details.



Heart-Beat is an application that is your companion for all things mood and music. The main goal of Heart-Beat is to aid in you figuring out how you feel through various means, and then provide you with an appropriate playlist to listen to.



System Design

Entity Relationship Diagram

Eraser

n8n



Interesting Features

  • Journalling based mood detection: Analyzes your journals through chunking, embedding and comparing to existing vectors to assign the closest similar set of moods.
  • Stress Prediction: Includes a machine learning model that is trained on smartwatch data like heartrate, sleep duration and physical activity, then based on these factors the app predicts your stress level on a scale of 1-10.
  • Moody Blues (AI Agent): An AI agent who you can speak and interact with, and who can help log your mood or summarize your thoughts into a journal.



User Screens

Landing Login Register
Landing Login Register
Home Page (Empty) Home Page (Full) Device Data
Home Page Empty Home Page Full Device Data
Journal Prompts Write Journal Journal Entries
Journal Prompts Write Journal Journal Entries
Playlist Music Moody Blues
Playlist Music Moody Blues



Tests

CI/CD Testing
CICD Testing
  • Frontend tests: flutter test
  • Backend tests: npm run test



Machine Learning Development

  • Used a copula based augmentation method with perturbation and noise to expand original dataset from 900 to 20000.

  • Dataset split according to a 80/20 training/test split.

  • Data was run through a scaling pipeline to avoid certain features having a large influence on the model where they should not.

  • The model used is Support Vector Machine running a One vs One style to determine stress levels in a classification style.

  • Model was trained using 10-fold cross validation to predict user stress level (1-10) as a result of their general vitals from their smartwatch (BPM, sleep, physical activity, steps).

Dataset Cross Validation
Dataset Results

MLOps (MLFlow)

  • Artifacts and models were tracked documented using MLFlow.

  • The final model used was then served to the backend of the application through a connected FastAPI endpoint that utilized the model registered by MLFlow.

Model Details Model Results Model Graphs
Details Results Graphs



AI Agent (Moody Blues)

  • The Moody Blues AI agent begins each conversation by gathering the user's recent emotional data (mood, journal entries, stress levels) to provide personalized support. After engaging in natural conversation for several exchanges, the AI analyzes the discussion and intelligently suggests one of two helpful actions: either summarizing the conversation into a saved journal entry or logging any emotions it detected during the chat. The user can accept or decline these suggestions, and if accepted, the information is automatically saved to help track their emotional wellbeing over time.



Music Attribution

This project uses the following Creative Commons licensed music tracks:

Track Title Artist Source License
Vibing Over Venus Kevin MacLeod incompetech.com CC BY 4.0
SCP-x5x (Outer Thoughts) Kevin MacLeod incompetech.com CC BY 4.0
Man Down Kevin MacLeod incompetech.com CC BY 4.0
Heart of Nowhere Kevin MacLeod incompetech.com CC BY 4.0
Rains Will Fall Kevin MacLeod incompetech.com CC BY 4.0
Heartbreaking Kevin MacLeod incompetech.com CC BY 4.0
Rumination Kevin MacLeod incompetech.com CC BY 4.0
Late Night Radio Kevin MacLeod incompetech.com CC BY 4.0
Bittersweet Kevin MacLeod incompetech.com CC BY 4.0
Floating Cities Kevin MacLeod incompetech.com CC BY 4.0
Despair and Triumph Kevin MacLeod incompetech.com CC BY 4.0
Private Reflection Kevin MacLeod incompetech.com CC BY 4.0
Dark Ambient YuraSoop freemusicarchive.org CC BY-NC 4.0
Uplifting Ukulele Waveloom freemusicarchive.org CC BY-ND 4.0
Blooming Poison Joint C Beat Laboratory freemusicarchive.org CC BY-NC 4.0
Water World E-Prosounds freemusicarchive.org CC BY-NC-ND 3.0 US
Chi Go Getters Dollar Boyz freemusicarchive.org CC BY-NC-SA
Missed The Free Throw E-Prosounds freemusicarchive.org CC BY-NC-ND 3.0 US
Boulevard St Germain Jahzzar freemusicarchive.org CC BY-SA 3.0
Shasha Albert Beger freemusicarchive.org CC BY-NC-ND 3.0
Old Times pell AirFlow ccmixter.org CC BY 4.0

License Information

  • CC BY: Attribution required
  • CC BY-NC: Attribution required, Non-commercial use only
  • CC BY-SA: Attribution required, Share-alike (derivative works must use same license)
  • CC BY-ND: Attribution required, No derivatives allowed
  • CC BY-NC-SA: Attribution required, Non-commercial use only, Share-alike
  • CC BY-NC-ND: Attribution required, Non-commercial use only, No derivatives allowed

All tracks are used in accordance with their respective Creative Commons licenses.



Extras

  • Linear for task and branch management.
  • Swagger for API documentation.
  • Supabase for bucket song storage
Linear Swagger Supabase
Linear Swagger Supabase



Swagger APIs

  • Found at [URL]:4000/docs
Register User Journals Music Metadata
Register API User Journals API Music API



About

A mobile application that lets you write journal entries, tracks your mood and plays music for you, all powered by AI and automation.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published