Environment Variables Setup
Create Environment File
Copy the example environment file to create your local configuration:The
.env.local file will contain all your sensitive configuration values.Supabase Configuration
Create Supabase Project
- Go to Supabase and sign in
- Click New Project
- Choose your organization
- Enter a project name and database password
- Select a region close to your users
- Click Create new project
Project provisioning takes 2-3 minutes. Wait for it to complete before proceeding.
Get API Credentials
Navigate to Settings → API in your Supabase project:Copy:
- Project URL →
NEXT_PUBLIC_SUPABASE_URL - Anon/Public Key →
NEXT_PUBLIC_SUPABASE_ANON_KEY
Google OAuth Setup
Create Google Cloud Project
- Go to Google Cloud Console
- Click Select a project → New Project
- Enter a project name and click Create
Enable Google+ API
- In your Google Cloud project, go to APIs & Services → Library
- Search for “Google+ API”
- Click on it and press Enable
Create OAuth Credentials
- Go to APIs & Services → Credentials
- Click Create Credentials → OAuth client ID
- If prompted, configure the OAuth consent screen first:
- Choose External user type
- Fill in required app information
- Add your email as a test user
- For Application type, select Web application
- Add authorized redirect URI:
- Click Create
- Copy the Client ID and Client Secret
Dodo Payments Configuration
Create Dodo Payments Account
- Sign up at Dodo Payments
- Complete the onboarding process
- Verify your email address
Final Environment File
Your complete.env.local should look like this:
Initialize Database Schema
With your environment variables configured, push the database schema to Supabase:- users - Stores user account information
- subscriptions - Tracks active and past subscriptions
- payments - Records payment history and invoices
Your application is now configured and ready for deployment!
