This guide will walk you through setting up Supabase for the VideoStream platform.
- Go to Supabase and sign up for an account if you don't have one.
- Create a new project:
- Click on "New Project"
- Enter a name for your project (e.g., "VideoStream")
- Set a secure database password
- Choose a region closest to your users
- Click "Create new project"
- Once your project is created, go to the project dashboard
- In the left sidebar, click on "Project Settings" (the gear icon)
- Click on "API" in the settings menu
- You'll find your project URL and anon/public key here
- Copy these values to use in your
.env.localfile:
NEXT_PUBLIC_SUPABASE_URL=your-project-url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key
- In the Supabase dashboard, go to the "SQL Editor" section
- Click "New Query"
- Paste the contents of the
supabase-schema.sqlfile from this project - Click "Run" to execute the SQL commands
The SQL commands will create a storage bucket for videos, but you should verify:
- Go to the "Storage" section in the Supabase dashboard
- You should see a bucket named "videos"
- If not, create it manually:
- Click "New Bucket"
- Name it "videos"
- Check "Public bucket" to allow public access to videos
- Click "Create bucket"
- Go to the "Authentication" section in the Supabase dashboard
- Under "Providers", ensure "Email" is enabled
- Optionally, you can configure additional providers like Google, GitHub, etc.
- Under "URL Configuration":
- Set your site URL (e.g., http://localhost:3000 for development)
- Add redirect URLs (e.g., http://localhost:3000/auth/callback)
After completing the above steps and configuring your application with the correct environment variables, you should be able to:
- Sign up and sign in users
- Upload videos to the storage bucket
- Store video metadata in the database
- Retrieve and play videos
If you encounter issues:
- Check that your environment variables are correctly set
- Verify that the SQL schema was properly executed
- Ensure the storage bucket is properly configured
- Check the Supabase dashboard logs for any errors