Moodles: AI-Powered Emotional Wellness Companion

Inspiration

Moodles was built to address a challenge close to my heart: making mental‑health support accessible, interactive, and data‑driven. I’ve seen friends and colleagues struggle to track their emotions or find a listening ear outside of formal therapy, so I wanted to build a digital companion that offers a safe space, learns from how you think, and gently guides you toward healthier patterns.

Taking this direction for the project was inspired by the growing need for accessible and personalized mental health support in a digital world. Recognizing the potential of artificial intelligence to offer empathetic and real-time assistance, the aim was to create a comprehensive companion that empowers individuals to understand and improve their emotional well-being. The vision was to combine intelligent tracking with supportive AI, making mental health tools more engaging and readily available.

What it does

Moodles serves as an AI-powered emotional wellness companion, offering a suite of features designed to support mental health:

  • Intelligent Mood Tracking: Users can log their emotions, specifying types, intensity, and even the "moment" of the day, along with personal notes. This allows for a detailed record of emotional states over time.
  • AI Emotional Support: It provides a conversational interface with an AI designed to offer empathetic and adaptive responses. This AI is equipped with safety protocols to detect and address sensitive situations, offering guidance and support.
  • Interactive Wellness Tools: The application includes guided exercises such as breathing techniques and anger management countdowns, along with daily affirmations, to help users regulate their emotions and practice mindfulness.
  • Advanced Analytics & Insights: Users can visualize their mood patterns and trends over various periods, identify dominant emotions, and track their progress through interactive charts. Data export options are available for personal analysis.
  • Mindful Gaming: To promote emotional recognition and mindfulness in an engaging way, the project includes a memory-based game with an achievement system.
  • Trust & Safety: A strong emphasis is placed on user safety and data privacy, with clear policies and mechanisms for responsible interaction and data handling.

How I built it

The project was built as a full-stack web application leveraging modern technologies:

  • Frontend: Developed using React 18 with TypeScript for a robust and type-safe component-based architecture. Tailwind CSS was utilized for styling, enabling a custom and responsive design system. Vite provides a fast development experience and optimized builds, while React Router handles client-side navigation. Lucide React is used for consistent iconography.
  • Backend & Database: Supabase forms the core of the backend infrastructure, providing a PostgreSQL database with Row Level Security (RLS) for data protection. It also handles user authentication and leverages Edge Functions for serverless API endpoints, particularly for AI integration.
  • AI Integration: The AI capabilities are powered by a large language model, accessed securely via Supabase Edge Functions, which process natural language and generate empathetic responses.
  • Offline Capabilities: The application is designed as a Progressive Web App (PWA), incorporating a service worker for offline functionality and IndexedDB for local data storage. A sync queue system ensures data consistency when connectivity is restored.
  • Security: Robust security measures include RLS to ensure users can only access their own data, along with crisis safety protocols and data encryption.

Challenges I ran into

Developing a project of this nature presented several challenges:

  • Ensuring AI Safety and Empathy: A significant challenge was fine-tuning the AI to provide genuinely empathetic and supportive responses, especially when dealing with sensitive mental health topics, while strictly adhering to safety guardrails and avoiding harmful outputs.
  • Robust Offline-First Synchronization: Implementing a seamless offline experience with reliable data synchronization between the local IndexedDB and the remote database was complex, requiring careful handling of data conflicts and ensuring data integrity.
  • Managing AI Context and Token Limits: Maintaining conversational context for the AI while staying within API token limits and optimizing response times required strategic message formatting and history management.
  • Designing for Sensitive User Data: Handling highly personal emotional data necessitated meticulous attention to privacy and security, ensuring that all data is protected and accessible only to the user.
  • Cross-Platform PWA Compatibility: Achieving consistent PWA functionality, including installation prompts and background sync, across various browsers and devices required careful testing and adaptation.

Accomplishments that I'm proud of

I am particularly proud of several key accomplishments in this project:

  • Comprehensive AI Integration: Successfully integrating a powerful AI model to provide nuanced and empathetic emotional support, complete with built-in safety protocols and crisis detection.
  • Seamless Offline Experience: Implementing a robust offline-first architecture that allows users to continue tracking their moods and interacting with the app even without an internet connection, with automatic synchronization.
  • Intuitive and Engaging User Interface: Creating a user-friendly and visually appealing interface that makes mood tracking and wellness practices accessible and engaging, even for sensitive topics.
  • Strong Security and Privacy Foundation: Establishing a solid security framework with Row Level Security and clear privacy policies to protect sensitive user data.
  • Diverse Feature Set: Successfully combining mood tracking, AI chat, wellness tools, and even mindful gaming into a cohesive and valuable application.

What I learned

Throughout the development of Moodles, I gained valuable insights and deepened my expertise in several areas:

  • Prompt Engineering: Hands-on experience crafting nuanced prompts that guide AI responses toward empathy, clarity, and emotional relevance, enabling more human-like, supportive interactions within an emotionally intelligent chatbot.
  • Ethical AI Development: A profound understanding of the ethical considerations and best practices involved in deploying AI in sensitive domains like mental health, particularly regarding safety, bias, and responsible interaction.
  • Offline-First Application Design: Extensive practical experience in building resilient web applications that prioritize offline functionality and robust data synchronization mechanisms.
  • Serverless Backend Architectures: Hands-on knowledge of leveraging platforms like Supabase for rapid backend development, including database management, authentication, and serverless functions.
  • User Experience for Sensitive Topics: The importance of designing interfaces that are not only intuitive but also empathetic, reassuring, and supportive when dealing with personal and emotional data.
  • Performance Optimization: Techniques for optimizing web application performance, from efficient data fetching to responsive UI rendering, especially crucial for data-intensive features like trend visualization.

What's next for Moodles

The future roadmap for Moodles includes exciting enhancements and expansions:

  • Voice Notes: Integrating audio recording for mood entries, with potential for transcription and sentiment analysis.
  • Social Features: Exploring anonymous mood sharing and community support groups to foster connection.
  • Advanced Analytics: Implementing machine learning to provide deeper insights, predictions, and personalized recommendations based on user data.
  • Integration APIs: Connecting with external platforms like fitness trackers, calendar apps, and other health platforms for a more holistic view of well-being.
  • Therapist Portal: Developing a dedicated dashboard for mental health professionals to potentially interact with and support their clients.
  • Mobile Apps: Creating native iOS and Android applications to provide a more integrated and platform-specific experience.
  • Enhanced Offline Support: Further refining offline capabilities, including advanced conflict resolution for complex data types.
  • Real-time Collaboration: Exploring features for shared mood tracking for families or support groups.
  • Advanced AI Features: Continuously improving the AI's conversational capabilities and emotional intelligence.
  • Wellness Expansions: Adding new guided exercises and integrations related to meditation, sleep, nutrition, and physical activity.

Built With

Share this project:

Updates

posted an update

Moodles guarantees you anonymity right from sign up. When discussing with Moodles AI, it can detect if you're in physical danger or having an emotional/mental crisis and connect you with local help right where you are, as soon as you need it!

Log in or sign up for Devpost to join the conversation.