Skip to main content

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.

  1. Create a Supabase Account If you haven't already, sign up at supabase.com.

  2. 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
  3. 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)
    • Save these credentials for your environment setup
  4. 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
  5. Initialize Local Development

    # Navigate to the Supabase package
    cd packages/supabase

    # Start Supabase locally
    npx supabase start

    # Apply migrations
    npx supabase db reset
  6. 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:

  1. Set up Supabase locally for development
  2. Configure the database with your schema
  3. Run tests to verify your setup