Skip to content

aurora1112-j/mindflow

Repository files navigation

MindFlow

CBT-based emotional first aid companion.

MindFlow cover

MindFlow is an AI-assisted mental wellness companion grounded in Cognitive Behavioral Therapy (CBT). It guides users through a three-step flow—Emotion Naming → Cognitive Restructuring → Micro‑Actions—to build emotional awareness, challenge unhelpful thoughts, and take small, achievable steps toward relief.

Core Method (CBT 3‑Step)

  1. Emotion Naming — identify and label the current emotion, estimate intensity, and notice where it shows up in the body.
  2. Cognitive Restructuring — surface automatic thoughts, recognize common cognitive distortions, and reframe toward a more balanced perspective (Socratic questioning).
  3. Micro‑Actions — choose a concrete, under‑5‑minutes action to break the negative loop and regain momentum.

Key Features

  • Guided emotion check‑in (custom labels, intensity meter, body‑sensation mapping).
  • Cognitive distortion detection + AI‑generated Socratic questions to explore alternative views.
  • Micro‑actions tailored to the selected emotion (grounding, self‑care, social connection, problem solving).
  • Crisis keyword detection with a safety modal and support resources.
  • Session history: calendar view, trend chart, and a shareable summary card.
  • Auth + user profiles backed by Supabase.

Product Principles

  • Accessible support: always available, low‑friction check‑ins.
  • Evidence‑based: structured around CBT techniques.
  • Privacy‑first: minimal data collection, security by design.
  • Progressive change: tiny, repeatable steps that build habit.

Safety & Ethics

MindFlow is not a substitute for professional medical advice, diagnosis, or treatment. It makes AI limitations explicit, discourages dependency, and encourages users to seek professional help when appropriate. Crisis signals trigger safety messaging and guidance to local support resources.

Tech Stack

  • Vite + React + TypeScript
  • Tailwind CSS + shadcn/ui + Framer Motion
  • Supabase Auth + Postgres (profiles, CBT sessions)
  • Supabase Edge Functions for AI (Socratic questions, supportive chat)
  • Lovable AI Gateway (Gemini 3 Flash preview) for LLM responses

Getting Started

Prerequisites

  • Node.js 18+
  • A Supabase project (required for auth, history, and AI functions)

Install

npm install

Environment Variables

Create .env in the project root:

VITE_SUPABASE_URL=...
VITE_SUPABASE_PUBLISHABLE_KEY=...
VITE_SUPABASE_PROJECT_ID=...

Run

npm run dev

Build

npm run build
npm run preview

Tests

npm test

Supabase Setup (recommended)

  • Apply migrations in supabase/migrations to create tables and RLS policies.
  • Deploy edge functions in supabase/functions:
    • socratic-questions
    • counseling-chat
  • Add the secret LOVABLE_API_KEY in Supabase for AI requests.

Repo Structure

  • src/ — app source
  • src/components/cbt — CBT flow UI
  • src/components/history — history + trend views
  • supabase/ — migrations and edge functions
  • public/ — static assets

Localization

The current UI copy is in Chinese. All content is structured for localization if you want to add English UI strings.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages