A Professional Mental Wellness Companion & Analytical Platform
Lumina AI is a full-stack, clinically-inspired mental wellness platform that combines conversational AI, Cognitive Behavioral Therapy (CBT) techniques, emotional analytics, and secure data management into a unified experience.
Built with React 19, Vite, Express, SQLite, and Google Gemini, Lumina AI helps users reflect on emotions, identify cognitive patterns, track mental wellness trends, and engage in supportive AI-guided conversations.
- Context-aware therapeutic conversations
- Active listening and reflective responses
- Structured CBT-based guidance
- Emotional pattern recognition
- Cognitive distortion detection
- Burnout, overwhelm, and stress identification
- Mood tracking over time
- Stress trend visualization
- Emotion frequency analysis
- Cognitive distortion insights
- Session statistics and historical patterns
- Interactive 4-7-8 breathing technique
- Animated breathing cues
- Smooth Framer Motion transitions
- Calming wellness experience
- Local SQLite storage
- User-controlled data deletion
- GDPR-aligned data purge workflow
- No unnecessary personal data collection
+---------------------------------------+
| Vite SPA Frontend |
| (React 19 / Framer Motion / Recharts)|
+---+-------------------------------+---+
| ^
Direct Browser API Calls REST API Calls
(Google Gemini Integration) (CRUD & Analytics)
| |
v v
+----------+------------+ +-----------+-----------+
| Google Gemini Models | | Express Server |
+-----------------------+ +-----------+-----------+
|
v
better-sqlite3
|
v
SQLite Database
- React 19
- TypeScript
- Vite
- Framer Motion
- Recharts
- Lucide React
- Node.js
- Express
- TypeScript
- better-sqlite3
- Google Gemini
@google/genai
- SQLite (
lumina.db)
lumina-ai/
β
βββ src/
β βββ components/
β β βββ Chat.tsx
β β βββ Dashboard.tsx
β β βββ Breathing.tsx
β β
β βββ pages/
β βββ hooks/
β βββ services/
β βββ App.tsx
β
βββ server/
β βββ routes/
β βββ database/
β βββ server.ts
β
βββ dist/
β
βββ lumina.db
β
βββ package.json
βββ vite.config.ts
βββ tsconfig.json
βββ README.md
- Node.js 20+
- npm or pnpm
- Google Gemini API Key
git clone https://github.com/yourusername/lumina-ai.git
cd lumina-ainpm installCreate a .env file:
GEMINI_API_KEY=your_google_gemini_api_key
PORT=3000Start frontend and backend:
npm run devnpm run buildesbuild server.ts \
--bundle \
--platform=node \
--format=cjs \
--packages=external \
--sourcemap \
--outfile=dist/server.cjsnode dist/server.cjsCREATE TABLE IF NOT EXISTS users (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT,
onboarding_completed BOOLEAN DEFAULT 0
);CREATE TABLE IF NOT EXISTS sessions (
id INTEGER PRIMARY KEY AUTOINCREMENT,
user_id INTEGER,
start_time DATETIME DEFAULT CURRENT_TIMESTAMP
);CREATE TABLE IF NOT EXISTS messages (
id INTEGER PRIMARY KEY AUTOINCREMENT,
session_id INTEGER,
role TEXT,
content TEXT,
timestamp DATETIME DEFAULT CURRENT_TIMESTAMP,
emotion TEXT,
mood_score INTEGER,
stress_level INTEGER,
crisis_detected BOOLEAN,
suggested_strategy TEXT,
cognitive_distortion TEXT,
therapeutic_focus TEXT,
trigger_identified TEXT
);CREATE TABLE IF NOT EXISTS mood_entries (
id INTEGER PRIMARY KEY AUTOINCREMENT,
user_id INTEGER,
date DATE DEFAULT CURRENT_DATE,
mood_score INTEGER,
stress_level INTEGER,
notes TEXT,
dominant_emotion TEXT
);GET /api/userPOST /api/user/onboardRequest:
{
"name": "Jane"
}GET /api/dashboardGET /api/user/statsPOST /api/chat/sessionGET /api/chat/sessionsGET /api/chat/history?sessionId=1POST /api/chat/contextPOST /api/chat/saveDELETE /api/user/dataDeletes:
- Messages
- Sessions
- Mood entries
- Analytics history
- Emotional insights
Lumina AI incorporates structured emotional analysis through Google Gemini.
The system is designed around:
- Reflective listening
- CBT-informed guidance
- Cognitive distortion identification
- Emotional progression tracking
- Burnout detection
- Stress pattern recognition
- Actionable coping strategies
- Catastrophizing
- All-or-Nothing Thinking
- Emotional Reasoning
- Overgeneralization
- Mental Filtering
- Personalization
interface LuminaAnalysis {
response: string;
detected_emotion: string;
mood_score: number;
stress_level: number;
crisis_detected: boolean;
suggested_coping_strategy: string | null;
cognitive_distortion: string | null;
therapeutic_focus: string;
trigger_identified: string | null;
}src/components/Chat.tsx
Features:
- Session history drawer
- Context-aware conversations
- CBT insight badges
- Trigger visualization
- Cognitive distortion tagging
- Crisis support notifications
src/components/Dashboard.tsx
Features:
- Mood trends
- Stress analytics
- Emotion tracking
- Distortion frequency charts
- User wellness statistics
src/components/Breathing.tsx
Features:
- 4-7-8 breathing cycle
- Guided animations
- Framer Motion transitions
- Relaxation-focused interactions
- SQLite local persistence
- Secure API architecture
- Explicit user consent model
- Full data deletion capability
- No hidden analytics collection
- Privacy-first design philosophy
Lumina AI is a wellness support tool and is not a replacement for professional medical, psychiatric, or psychological care.
If a user experiences a mental health crisis, they should immediately contact local emergency services, a licensed mental health professional, or a crisis support organization.