Prerequisites
Before you begin, make sure you have:- A Supabase account (sign up at supabase.com)
- Node.js 18+ installed
- The Goalst source code cloned to your machine
Create a Supabase project
Create a new project
Log in to your Supabase dashboard and create a new project. You’ll need to provide:
- Project name
- Database password (save this securely)
- Region (choose one closest to your users)
Wait for project provisioning
Supabase will provision your project infrastructure. This typically takes 1-2 minutes.
Get your API credentials
You’ll need two values from the API settings page:Keep your API keys secure. Never commit them to version control or expose them publicly.
Project URL
Your project URL follows this format:Anonymous key
The anon (anonymous) key is a public key that allows client-side access to your Supabase project with Row Level Security (RLS) policies enforced. Copy the anon public key from the Project API keys section.Configure environment variables
Goalst uses environment variables to store your Supabase credentials securely.Copy the example file
Navigate to your Goalst source directory and copy the example environment file:
Add your credentials
Open Replace:
.env in your editor and replace the placeholder values:.env
https://your-project-id.supabase.cowith your actual Project URLyour_anon_key_herewith your actual anon key
Supabase client initialization
Goalst initializes the Supabase client once and exports it for use throughout the application:src/shared/services/supabase-client.ts
- Authentication (sign up, sign in, sign out)
- Database queries
- Real-time subscriptions
- Storage operations
Enable authentication providers
By default, Goalst uses email/password authentication. To enable additional providers:Configure email authentication
Ensure Email is enabled. You can customize:
- Email confirmation (recommended for production)
- Password requirements
- Email templates
Set up database tables
Goalst requires specific database tables and Row Level Security policies. Refer to your database migration files or schema documentation for the complete setup.
- User profiles table
- Goals table
- Sub-goals table (for recursive goal structure)
Test your connection
To verify your Supabase configuration:Try signing up
Create a new account. If successful, your Supabase configuration is working correctly.
Troubleshooting
Invalid API key error
If you see authentication errors:- Verify your
.envfile has the correct values - Ensure there are no extra spaces or quotes around the values
- Restart your development server after changing environment variables
CORS errors
If you encounter CORS issues:- Check that your local development URL (
http://localhost:4422) is allowed in Supabase - Go to Settings > API > URL Configuration
- Add your development URL to the allowed origins
Email confirmation issues
If email confirmations aren’t working:- Check your email settings in Authentication > Email Templates
- For development, consider disabling email confirmation
- For production, configure a custom SMTP server in Settings > Auth
Next steps
Authentication
Learn how authentication flows work in Goalst
Deployment
Deploy your Goalst application to production