Supabase Project Setup
Before setting up your local development environment, you need to create a Supabase project. This guide will walk you through the process.
-
Create a Supabase Account If you haven't already, sign up at supabase.com.
-
Create a New Project
- Log in to your Supabase account and go to the dashboard
- Click on "New Project" and choose an organization (create one if needed)
- Give your project a name and set a secure database password
- Choose a region closest to your target audience for optimal performance
- Click "Create new project" and wait for it to be provisioned
-
Get Your Project Credentials
- Once your project is ready, navigate to your project dashboard
- Go to Project Settings (gear icon) → API
- You'll need the following credentials:
- Project URL:
https://your-project-id.supabase.co
anon
public key (for client-side operations)service_role
key (for server-side operations)
- Project URL:
- Save these credentials for your environment setup
-
Set Up Environment Variables
Create the following environment files:
# apps/web/.env.local
NEXT_PUBLIC_SUPABASE_URL=your_project_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_anon_key
# apps/api/.env
SUPABASE_URL=your_project_url
SUPABASE_SERVICE_ROLE_KEY=your_service_role_key
PORT=8080
# packages/supabase/.env
SUPABASE_ACCESS_TOKEN=your_access_token -
Initialize Local Development
# Navigate to the Supabase package
cd packages/supabase
# Start Supabase locally
npx supabase start
# Apply migrations
npx supabase db reset -
Verify Setup
- Access your local Supabase Studio at http://localhost:54323
- Check that the database tables are created correctly
- Verify that the RLS policies are in place
- Test the organization and team management features
Next Steps
Now that you have your Supabase project set up, you can:
- Set up Supabase locally for development
- Configure the database with your schema
- Run tests to verify your setup