About the Project

What Inspired Us

We built MindPath because we saw two big problems in the world today. First, there's a mental health crisis - lots of people are struggling with anxiety, depression, and stress, but they don't have good tools to understand their feelings. Second, most AI tools today are used for things like making fake pictures or writing essays for students, which doesn't help people in real ways.

We wanted to create something different. We wanted to use AI to actually help people understand themselves better and feel better about their mental health. That's how MindPath was born - a safe place where people can write about their feelings and get helpful insights from AI.

What We Learned

Building this project taught us a lot of new things:

Database Design: We learned how to create a database schema that keeps each user's data separate and secure. We used SQLite because it's simple but powerful. Our database has two main tables - one for storing notes and another for storing AI analysis results.

CRUD Operations: We figured out how to build a complete system for creating, reading, updating, and deleting notes. This sounds simple, but making sure users can only see and edit their own notes was tricky.

Authentication: We learned how to use Auth0 and Google OAuth to let people sign in safely. This was important because people's mental health notes are very private.

AI Integration: We connected our app to Google's Gemini AI to analyze people's notes and give helpful suggestions. We had to learn how to format data for AI and handle the responses properly.

CORS Issues: This was one of our biggest headaches! When our frontend (React app) tried to talk to our backend (Node.js server), the browser blocked the requests. We spent hours figuring out how to configure CORS properly so everything could work together.

How We Built It

We built MindPath using a three-part system:

Frontend (React + TypeScript): This is what users see and interact with. We used React to build the user interface, TypeScript to catch errors before they happen, and TailwindCSS to make it look nice. The frontend handles things like showing notes, creating new entries, and displaying AI analysis results.

Backend (Node.js + Express): This is the "brain" of our app. It handles all the important work like saving notes to the database, checking if users are logged in, and talking to the AI service. We used Express.js to create API endpoints that the frontend can call.

Database (SQLite): This stores all the user data safely. We chose SQLite because it's simple to set up and doesn't need a separate database server. Each user's data is completely separate from other users.

AI Service (Gemini): This analyzes people's notes and gives helpful mental health suggestions. When someone writes 10 notes, the AI automatically looks at their writing patterns and suggests resources that might help them.

Challenges We Faced

CORS Configuration: This was our biggest technical challenge. When we first tried to connect our frontend to our backend, nothing worked because of CORS (Cross-Origin Resource Sharing) rules. The browser wouldn't let our React app talk to our Node.js server. We had to learn about CORS headers and configure them properly.

Database Schema Design: We had to think carefully about how to store data. We needed to make sure each user could only see their own notes, and we had to design tables that could handle both simple notes and complex AI analysis results.

AI Response Parsing: The Gemini AI sometimes gave us responses in different formats than we expected. We had to write code that could handle different response types and clean up the data before showing it to users.

Authentication Flow: Setting up Auth0 and Google OAuth was more complicated than we thought. We had to understand how JWT tokens work and make sure our backend could verify that users were really logged in.

Error Handling: We learned that things go wrong a lot in programming! We had to write code that could handle errors gracefully - like when the AI service is down, or when someone tries to access a note that doesn't exist.

User Experience: We wanted the app to feel calm and supportive, not stressful. We spent time choosing colors and fonts that would make people feel comfortable writing about their feelings.

The Math Behind It

We used some simple math concepts in our project:

  • Character Limits: We limited AI analysis to 16,000 characters total to stay within API limits. This meant we had to count characters and sometimes trim older notes.

  • Automatic Triggers: We set up the AI to automatically analyze notes when users reach their 10th entry.

  • Data Validation: We check that required fields aren't empty to ensure a valid note.

Why This Matters

Mental health is really important, but a lot of people don't have good tools to understand their feelings. MindPath gives people a safe, private place to write about their thoughts and get helpful insights from AI. We hope this can help people feel less alone and more in control of their mental wellness journey.

The best part is that we're using AI for something good - helping people understand themselves better instead of just making fake content or doing homework for students. We believe technology should make people's lives better, and that's exactly what MindPath does.

Built With

+ 1 more
Share this project:

Updates