This guide will walk you through setting up your own Supabase instance for the Solo Leveling fitness tracker application.
- A Supabase account (sign up at supabase.com)
- Access to your Supabase project dashboard
- Log in to supabase.com
- Click "New Project"
- Choose your organization
- Enter a project name (e.g., "solo-leveling-fitness")
- Create a strong database password (save this securely!)
- Select a region closest to your users
- Click "Create new project"
- Wait 1-2 minutes for your project to be fully provisioned
- In your project dashboard, navigate to Settings > API
- Copy the following values:
- Project URL (e.g.,
https://xyzabc123.supabase.co) - anon/public key (a long JWT token starting with
eyJ...)
- Project URL (e.g.,
- Also note your Project ID from Settings > General
-
In your local project, copy
.env.exampleto.env:cp .env.example .env
-
Edit
.envand replace the placeholder values:VITE_SUPABASE_URL=https://your-project-ref.supabase.co VITE_SUPABASE_PUBLISHABLE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... VITE_SUPABASE_PROJECT_ID=your-project-id -
Important: Never commit your
.envfile to version control!
You need to run the SQL migrations to set up your database schema. The migrations are located in ./supabase/migrations/.
- Go to your Supabase project dashboard
- Navigate to SQL Editor in the left sidebar
- Click New query
- Copy the contents of each migration file and run them in order:
File: 20260119064145_5c3fc727-e03b-4e75-80ca-d27267150d93.sql
This creates the core tables:
profiles- User profiles with level, XP, rank, etc.workout_sessions- Individual workout sessionssession_exercises- Exercises within sessionsexercise_sets- Sets/reps/weight data for exercisestraining_goals- User fitness goalstraining_preferences- Workout preferences
File: 20260119065541_af69017e-df74-43bb-9634-c0e9b6d3473f.sql
This adds:
- Additional constraints and indexes
- Enhanced RLS policies
File: 20260119070601_add_session_logging.sql
This adds:
- Session logging and tracking features
- Performance optimizations
If you have the Supabase CLI installed:
-
Link your project:
supabase link --project-ref your-project-id
-
Push migrations:
supabase db push
- In Supabase dashboard, go to Table Editor
- You should see all these tables:
profilesworkout_sessionssession_exercisesexercise_setstraining_goalstraining_preferences
- Click on any table in the Table Editor
- Click the "RLS" (Row Level Security) tab
- Verify that RLS is enabled and policies exist
- In your Supabase dashboard, go to Authentication > Users
- Enable Email provider if not already enabled
- Configure your site URL in Authentication > URL Configuration:
- Site URL:
http://localhost:8080(for development) - Add your production URL when deploying
- Site URL:
-
Install dependencies (if not already done):
npm install
-
Start the development server:
npm run dev
-
Open http://localhost:8080 in your browser
-
Try creating an account - this will test your Supabase connection!
- Make sure you've created your
.envfile - Check that the values are correctly copied from your Supabase dashboard
- Restart your development server after changing
.env
- Verify your Site URL is configured in Supabase Authentication settings
- Check that the Email provider is enabled
- Look at the browser console for specific error messages
- Ensure all migrations have been run successfully
- Check that RLS is enabled on all tables
- Verify your anon key is correct
- Check the Supabase logs in Project Settings > Logs
- Verify you ran all three migration files in order
- Check for SQL errors in the Supabase SQL Editor
- Make sure you're looking in the
publicschema
All tables in this application use Row Level Security to ensure users can only access their own data:
- profiles: Users can only read/update their own profile
- workout_sessions: Users can only manage their own workout sessions
- session_exercises: Accessible through workout sessions (user ownership verified)
- exercise_sets: Accessible through exercises (user ownership verified)
- training_goals: Users can only manage their own goals
- training_preferences: Users can only manage their own preferences
This security is enforced at the database level, making it impossible for users to access other users' data, even if they try to modify API requests.
All data in your Supabase project belongs to you:
- You control the database
- You control the authentication
- You control the RLS policies
- You can export data anytime
- You can modify the schema as needed
There are no third-party managed services or fallback connections. Your application connects only to your Supabase instance.
- Test all features of the application
- Configure your production Site URL in Supabase when deploying
- Set up your production environment variables
- Consider setting up Supabase Edge Functions for any backend logic you need
- Review and customize RLS policies for your specific needs
- Supabase Documentation: https://supabase.com/docs
- Supabase Discord: https://discord.supabase.com
- Application Issues: Open an issue in this repository