SQL files to set up the Supabase database for this project.
- Copy
.env.exampleto.envand fill in your credentials - Run the init script:
./data/init-db.shRun these files in order in your Supabase SQL Editor:
- schema.sql - Creates tables and indexes
- policies.sql - Enables RLS and creates policies
- seed.sql - Inserts lookup data (roles, statuses, sample tags)
- triggers.sql - Creates triggers (auto-create profile on signup)
Create a public bucket named assets for image uploads:
- Go to Storage in your Supabase dashboard
- Click "New bucket"
- Name:
assets - Enable "Public bucket"
1. Create GitHub OAuth App:
- Go to GitHub Developer Settings
- Click "New OAuth App"
- Fill in:
- Application name: Your app name
- Homepage URL:
http://localhost:3000(or your production URL) - Authorization callback URL:
https://<project-id>.supabase.co/auth/v1/callback
- Click "Register application"
- Copy the Client ID
- Click "Generate a new client secret" and copy the Client Secret
2. Configure in Supabase:
- Go to Authentication → Providers
- Find GitHub and enable it
- Paste your Client ID and Client Secret
- Save
1. Create Google OAuth Credentials:
- Go to Google Cloud Console
- Create a new project (or select existing)
- Go to APIs & Services → Credentials
- Click Create Credentials → OAuth client ID
- If prompted, configure the OAuth consent screen first:
- User Type: External
- App name, email, etc.
- Scopes:
email,profile,openid
- Back to Credentials → Create OAuth client ID:
- Application type: Web application
- Name: Your app name
- Authorized JavaScript origins:
http://localhost:3000https://<project-id>.supabase.co
- Authorized redirect URIs:
https://<project-id>.supabase.co/auth/v1/callback
- Click "Create" and copy Client ID and Client Secret
2. Configure in Supabase:
- Go to Authentication → Providers
- Find Google and enable it
- Paste your Client ID and Client Secret
- Save
After configuring providers, test login at http://localhost:3000/login
Copy .env.example to .env and fill in:
SUPABASE_PROJECT_ID=your_project_id
NEXT_PUBLIC_SUPABASE_URL=https://<project-id>.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_anon_key
# For init script only
SUPABASE_DB_PASSWORD=your_database_password
SUPABASE_DB_REGION=aws-0-eu-west-1Where to find:
- Project ID: From your project URL
- Anon Key: Project Settings → API →
anonpublic key - DB Password: The password you set when creating the project
- DB Region: Project Settings → Database → Connection string (e.g.,
aws-0-eu-west-1)