This guide will help you set up the LifeWeeks application with Supabase and Hugging Face AI integration.
git clone <your-repo-url>
cd lifeweeks
npm installCopy the environment template:
cp .env.example .env.localFill in your environment variables in .env.local:
# Supabase Configuration
NEXT_PUBLIC_SUPABASE_URL=your-supabase-project-url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-supabase-anon-key
# Hugging Face Configuration
HUGGINGFACE_API_KEY=your-huggingface-api-key- Go to supabase.com
- Create a new project
- Wait for the project to be ready
- Go to Settings > API to get your URL and anon key
- Go to Authentication > Settings
- Enable Email authentication
- Set Site URL to
http://localhost:3000(for development) - Add your production URL when deploying
- Go to SQL Editor in your Supabase dashboard
- Copy the entire content from
supabase-setup.sql - Paste and run the script
- Verify tables are created in Table Editor
- Go to huggingface.co
- Create an account and sign in
- Go to Settings > Access Tokens
- Create a new token with "Read" permissions
- Copy the token to your
.env.local
npm run devVisit http://localhost:3000 to see the application.
Solution: Run the database setup script from supabase-setup.sql. This creates the proper RLS policies and triggers.
Solution: The database tables haven't been created. Run the setup script in Supabase SQL Editor.
Solution:
- Check your Hugging Face API key is correct
- Ensure you have internet connection
- The app will fall back to simple keyword analysis if AI fails
Solution:
- Check the database status indicator in the dashboard
- Verify your user profile exists in the users table
- Try adding sample data using the "Add Sample Data" button
Run these queries in Supabase SQL Editor to verify setup:
-- Check if tables exist
SELECT table_name FROM information_schema.tables
WHERE table_schema = 'public';
-- Check RLS policies
SELECT schemaname, tablename, policyname, permissive, roles, cmd, qual
FROM pg_policies
WHERE schemaname = 'public';
-- Check if user profile exists (replace with your user ID)
SELECT * FROM auth.users LIMIT 5;
SELECT * FROM public.users LIMIT 5;The application includes a sample data seeder that creates realistic life events for testing:
- Career events: Job changes, promotions, projects
- Education events: Graduations, courses, certifications
- Personal events: Moving, relationships, health, family
- Travel events: Vacations, adventures, trips
Click "Add Sample Data" in the dashboard to populate your timeline with test data.
- RLS (Row Level Security) is enabled on all tables
- Users can only access their own data
- API routes verify authentication
- Environment variables are protected
- Push your code to GitHub
- Connect your repo to Vercel
- Add environment variables in Vercel dashboard
- Update Supabase Site URL to your Vercel domain
The app works on any platform that supports Next.js:
- Netlify
- Railway
- Render
- Self-hosted
If you encounter issues:
- Check the database status indicator in the dashboard
- Look at browser console for error messages
- Verify all environment variables are set
- Ensure Supabase setup script was run completely
- Check Supabase logs in the dashboard
Once setup is complete:
- Create your account using the signup page
- Add sample data or create your first event
- Explore the timeline visualization
- Try the AI-powered insights
- Generate art for your life chapters
Enjoy mapping your life journey! 🌟