Skip to content

Navaneeth187/LumiaAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌟 Lumina AI

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.


✨ Features

πŸ’¬ AI Wellness Companion

  • Context-aware therapeutic conversations
  • Active listening and reflective responses
  • Structured CBT-based guidance
  • Emotional pattern recognition
  • Cognitive distortion detection
  • Burnout, overwhelm, and stress identification

πŸ“Š Mental Wellness Dashboard

  • Mood tracking over time
  • Stress trend visualization
  • Emotion frequency analysis
  • Cognitive distortion insights
  • Session statistics and historical patterns

🧘 Guided Breathing Exercises

  • Interactive 4-7-8 breathing technique
  • Animated breathing cues
  • Smooth Framer Motion transitions
  • Calming wellness experience

πŸ”’ Privacy & Data Ownership

  • Local SQLite storage
  • User-controlled data deletion
  • GDPR-aligned data purge workflow
  • No unnecessary personal data collection

πŸ— Architecture

                +---------------------------------------+
                |          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

πŸ›  Tech Stack

Frontend

  • React 19
  • TypeScript
  • Vite
  • Framer Motion
  • Recharts
  • Lucide React

Backend

  • Node.js
  • Express
  • TypeScript
  • better-sqlite3

AI Layer

  • Google Gemini
  • @google/genai

Database

  • SQLite (lumina.db)

πŸ“ Project Structure

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

πŸš€ Installation

Prerequisites

  • Node.js 20+
  • npm or pnpm
  • Google Gemini API Key

Clone Repository

git clone https://github.com/yourusername/lumina-ai.git

cd lumina-ai

Install Dependencies

npm install

Environment Variables

Create a .env file:

GEMINI_API_KEY=your_google_gemini_api_key
PORT=3000

Development

Start frontend and backend:

npm run dev

Production Build

Frontend

npm run build

Server Bundle

esbuild server.ts \
  --bundle \
  --platform=node \
  --format=cjs \
  --packages=external \
  --sourcemap \
  --outfile=dist/server.cjs

Run Production Server

node dist/server.cjs

πŸ—„ Database Schema

Users

CREATE TABLE IF NOT EXISTS users (
  id INTEGER PRIMARY KEY AUTOINCREMENT,
  name TEXT,
  onboarding_completed BOOLEAN DEFAULT 0
);

Sessions

CREATE TABLE IF NOT EXISTS sessions (
  id INTEGER PRIMARY KEY AUTOINCREMENT,
  user_id INTEGER,
  start_time DATETIME DEFAULT CURRENT_TIMESTAMP
);

Messages

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
);

Mood Entries

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
);

πŸ”Œ REST API

User

Get User

GET /api/user

Complete Onboarding

POST /api/user/onboard

Request:

{
  "name": "Jane"
}

Dashboard

Analytics Overview

GET /api/dashboard

User Statistics

GET /api/user/stats

Chat Sessions

Create Session

POST /api/chat/session

Get Sessions

GET /api/chat/sessions

Get History

GET /api/chat/history?sessionId=1

Build Context

POST /api/chat/context

Save AI Analysis

POST /api/chat/save

Data Purge

DELETE /api/user/data

Deletes:

  • Messages
  • Sessions
  • Mood entries
  • Analytics history
  • Emotional insights

🧠 Clinical Intelligence Layer

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

Supported Cognitive Distortions

  • Catastrophizing
  • All-or-Nothing Thinking
  • Emotional Reasoning
  • Overgeneralization
  • Mental Filtering
  • Personalization

πŸ“‹ AI Response Schema

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;
}

🎨 Core Components

Chat Interface

src/components/Chat.tsx

Features:

  • Session history drawer
  • Context-aware conversations
  • CBT insight badges
  • Trigger visualization
  • Cognitive distortion tagging
  • Crisis support notifications

Dashboard

src/components/Dashboard.tsx

Features:

  • Mood trends
  • Stress analytics
  • Emotion tracking
  • Distortion frequency charts
  • User wellness statistics

Breathing Exercise

src/components/Breathing.tsx

Features:

  • 4-7-8 breathing cycle
  • Guided animations
  • Framer Motion transitions
  • Relaxation-focused interactions

πŸ” Security & Privacy

  • SQLite local persistence
  • Secure API architecture
  • Explicit user consent model
  • Full data deletion capability
  • No hidden analytics collection
  • Privacy-first design philosophy

⚠ Disclaimer

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.


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages