AI-powered journaling tool for mental wellness and self-reflection.
npm install
npm run devVisit https://reflevapp.com
NOTE: A majority of the functionality will not work if you don't set up the database.
Create .env.local with the following variables:
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY=your_supabase_anon_key
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
HUGGINGFACE_API_KEY=your_huggingface_api_keySet up a Supabase SQL database schema using the supabase-schema.sql
src/
├── app/
│ ├── api/
│ │ ├── analyze-topics/
│ │ ├── chat/
│ │ ├── detect-mood/
│ │ ├── embed/
│ │ └── generate-tags/
│ ├── auth/
│ │ └── callback/
│ ├── dashboard/
│ ├── login/
│ ├── therapist/
│ │ ├── login/
│ │ ├── dashboard/
│ │ └── invite/
│ └── page.tsx
│
├── components/
│ ├── 3d/
│ │ └── MoodRoom.tsx
│ ├── dashboard/
│ │ ├── views/
│ │ │ ├── HomeView.tsx
│ │ │ ├── JournalView.tsx
│ │ │ ├── HabitsView.tsx
│ │ │ ├── ChatView.tsx
│ │ │ ├── ProfileView.tsx
│ │ │ └── SettingsView.tsx
│ │ ├── DashboardContent.tsx
│ │ ├── DashboardNav.tsx
│ │ ├── Sidebar.tsx
│ │ └── QuickActions.tsx
│ ├── journal/
│ │ ├── JournalEditor.tsx
│ │ └── JournalList.tsx
│ └── landing/
│ ├── Header.tsx
│ ├── Hero.tsx
│ ├── HowItWorks.tsx
│ └── Footer.tsx
│
└── lib/
├── api.ts # API client functions
├── database.ts # Database utilities
├── store.ts # Zustand state management
└── supabase.ts # Supabase client
POST /api/chat- AI chat with journal contextPOST /api/detect-mood- Classify mood from textPOST /api/generate-tags- Generate tags for journal entriesPOST /api/analyze-topics- Analyze topics for therapistsPOST /api/embed- Generate text embeddings
All database operations use Supabase client-side SDK with Row Level Security (RLS). See src/lib/store.ts for data fetching patterns.
The project uses Supabase with the following main tables:
profiles- User profile informationjournal_entries- Journal entries with mood and tagsjournal_tags&journal_entry_tags- Tagging systemhabits- Long-term habitsdaily_tasks- Daily task managementtask_history- Task completion historyinsights- AI-generated insightstherapists- Therapist accountsuser_therapist_connections- Sharing relationshipsprofile_stats- User statisticsbadges&user_badges- Achievement systemgoals- User goalschat_topics- Extracted chat topics
See DATABASE_SETUP.md for detailed schema setup instructions.
- Next.js 14 - React framework with App Router
- TypeScript - Type safety
- Supabase - Database and authentication
- Zustand - State management
- Tailwind CSS - Styling
- Three.js / React Three Fiber - 3D visualization
- Hugging Face API - AI/LLM services
- Lucide Icons - Icon library
- date-fns - Date utilities
Edit tailwind.config.js:
theme: {
extend: {
colors: {
// Add your brand colors
}
}
}- Row Level Security (RLS) enabled on all Supabase tables
- User data isolation via RLS policies
- Secure OAuth flow with Supabase
- API routes protected with authentication checks