CBT-based emotional first aid companion.
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.
- Emotion Naming — identify and label the current emotion, estimate intensity, and notice where it shows up in the body.
- Cognitive Restructuring — surface automatic thoughts, recognize common cognitive distortions, and reframe toward a more balanced perspective (Socratic questioning).
- Micro‑Actions — choose a concrete, under‑5‑minutes action to break the negative loop and regain momentum.
- 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.
- 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.
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.
- 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
- Node.js 18+
- A Supabase project (required for auth, history, and AI functions)
npm installCreate .env in the project root:
VITE_SUPABASE_URL=...
VITE_SUPABASE_PUBLISHABLE_KEY=...
VITE_SUPABASE_PROJECT_ID=...npm run devnpm run build
npm run previewnpm test- Apply migrations in
supabase/migrationsto create tables and RLS policies. - Deploy edge functions in
supabase/functions:socratic-questionscounseling-chat
- Add the secret
LOVABLE_API_KEYin Supabase for AI requests.
src/— app sourcesrc/components/cbt— CBT flow UIsrc/components/history— history + trend viewssupabase/— migrations and edge functionspublic/— static assets
The current UI copy is in Chinese. All content is structured for localization if you want to add English UI strings.
