A wellness journaling and mental health companion app built with Next.js 15. MindMirror helps users track their mental well-being through journaling, mood tracking, and AI-powered conversational support.
🔗 Live Demo: https://mind-mirror-eight.vercel.app/
- Journal Entries: Write and manage personal journal entries with a rich text editor
- Mood Tracking: Track emotions over time with visual word cloud representations
- AI Chatbot: Conversational wellness assistant powered by Google Gemini AI
- Voice Input: Speech-to-text functionality for hands-free journaling
- User Authentication: Secure sign-up, login, password reset with Supabase Auth
- Password Management: Forgot password and password reset functionality
- Next.js 15 - React framework with App Router
- React 19 - UI library
- TypeScript - Type safety
- Tailwind CSS 4 - Utility-first CSS framework
- Lucide React - Icon library
- Supabase - Backend as a Service (BaaS)
- PostgreSQL database
- Authentication
- Real-time subscriptions
- Supabase SSR - Server-side authentication
- Google Generative AI - Gemini AI integration for chatbot
MindMirror/
├── public/
├── src/
│ ├── app/
│ │ ├── chatbot/
│ │ │ ├── api/
│ │ │ │ └── sessions/
│ │ │ │ ├── route.ts
│ │ │ │ └── [sessionId]/
│ │ │ │ ├── route.ts
│ │ │ │ └── messages/
│ │ │ │ └── route.ts
│ │ │ ├── components/
│ │ │ │ ├── ChatSidebar.tsx
│ │ │ │ └── ChatWindow.tsx
│ │ │ └── page.tsx
│ │ ├── journal/
│ │ │ ├── api/
│ │ │ │ ├── route.ts
│ │ │ │ └── [id]/
│ │ │ │ └── route.ts
│ │ │ ├── components/
│ │ │ │ ├── AudioToText.tsx
│ │ │ │ ├── JournalEditor.tsx
│ │ │ │ └── JournalSidebar.tsx
│ │ │ └── page.tsx
│ │ ├── mood/
│ │ │ ├── api/
│ │ │ │ └── filterByTime.ts
│ │ │ ├── components/
│ │ │ │ ├── EmotionInput.tsx
│ │ │ │ └── WordCloud.tsx
│ │ │ └── page.tsx
│ │ ├── login/
│ │ │ └── page.tsx
│ │ ├── signup/
│ │ │ └── page.tsx
│ │ ├── forgot-password/
│ │ │ └── page.tsx
│ │ ├── reset-password/
│ │ │ └── page.tsx
│ │ ├── profile/
│ │ │ └── page.tsx
│ │ ├── globals.css
│ │ ├── layout.tsx
│ │ └── page.tsx
│ ├── components/
│ │ ├── CornerImage.tsx
│ │ └── HeaderAuth.tsx
│ ├── lib/
│ │ ├── gemini.ts
│ │ ├── supabase.ts
│ │ └── supabaseServer.ts
│ ├── types/
│ │ ├── chat.ts
│ │ ├── emotion.ts
│ │ └── journal.ts
│ └── middleware.ts
├── .env.local
├── eslint.config.mjs
├── next.config.ts
├── package.json
├── postcss.config.mjs
├── tailwind.config.ts
└── tsconfig.json
- Node.js 20+ and npm
- A Supabase account and project
- A Google AI Studio API key
Create a .env.local file in the root directory:
# Supabase
NEXT_PUBLIC_SUPABASE_URL=your_supabase_project_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
# Google Gemini AI
GEMINI_API_KEY=your_gemini_api_keyYou'll need to create the following tables in Supabase:
create table journal_entries (
id uuid default gen_random_uuid() primary key,
user_id uuid references auth.users not null,
title text not null,
content text not null,
created_at timestamp with time zone default timezone('utc'::text, now()) not null,
updated_at timestamp with time zone default timezone('utc'::text, now()) not null
);create table chat_sessions (
id uuid default gen_random_uuid() primary key,
user_id uuid references auth.users not null,
title text not null default 'New Chat',
created_at timestamp with time zone default timezone('utc'::text, now()) not null
);create table chat_messages (
id uuid default gen_random_uuid() primary key,
session_id uuid references chat_sessions on delete cascade not null,
role text not null check (role in ('user', 'assistant')),
content text not null,
created_at timestamp with time zone default timezone('utc'::text, now()) not null
);create table emotions (
id uuid default gen_random_uuid() primary key,
user_id uuid references auth.users not null,
emotion text not null,
intensity integer not null check (intensity >= 1 and intensity <= 10),
created_at timestamp with time zone default timezone('utc'::text, now()) not null
);- Clone the repository:
git clone https://github.com/belle-hsieh/MindMirror.git
cd MindMirror- Install dependencies:
npm install- Run the development server:
npm run dev- Open http://localhost:3000 in your browser
npm run build
npm startThe app uses Supabase Authentication with middleware protection for:
/chatbot- AI chat interface/journal- Journal entries/mood- Mood tracking/profile- User profile settings
Unauthenticated users are redirected to /login with a redirect parameter.
/login- User sign in/signup- User registration/forgot-password- Request password reset/reset-password- Set new password/profile- User profile and account settings
- Create, edit, and delete personal journal entries
- Rich text editing support
- Voice-to-text input using Web Speech API
- Automatic timestamps
- Log emotions with intensity ratings (1-10)
- Visual word cloud representation of emotional patterns
- Filter by time periods
- Context-aware conversations using Google Gemini
- Session management (create, rename, delete)
- Conversation history
- Automatic chat title generation
Why Two Separate Features?
Currently, MindMirror maintains separate systems for journaling and mood tracking:
- Journal - Free-form text entries for detailed reflection
- Mood Tracker - Explicit emotion logging with intensity ratings
This separation was intentional for several reasons:
- User Control: Allows users to consciously reflect on and label their emotions
- Data Quality: Explicit ratings provide structured, quantifiable data
- Privacy: Users can journal freely without automatic analysis of sensitive content
- Simplicity: Easier initial implementation without NLP dependencies
- Accuracy: User-labeled emotions are ground truth; NLP has inherent inaccuracy
As I future project, I plan to enhance the mood tracking feature with automatic emotion extraction from journal entries using Natural Language Processing.
GET /journal/api- List all entriesPOST /journal/api- Create new entryGET /journal/api/[id]- Get specific entryPUT /journal/api/[id]- Update entryDELETE /journal/api/[id]- Delete entry
GET /chatbot/api/sessions- List all sessionsPOST /chatbot/api/sessions- Create new sessionDELETE /chatbot/api/sessions/[sessionId]- Delete sessionPATCH /chatbot/api/sessions/[sessionId]- Rename sessionGET /chatbot/api/sessions/[sessionId]/messages- Get messagesPOST /chatbot/api/sessions/[sessionId]/messages- Send message
The app is currently deployed on Vercel and live at: 👉 https://mind-mirror-bhsieh.vercel.app/
To deploy your own version:
- Push your code to GitHub
- Import the project on Vercel
- Add environment variables
- Deploy
This project is private and not licensed for public use.
Belle Hsieh
Built with ❤️ using Next.js and Supabase