Environment Overview
Risk Legion supports three environments:| Environment | Purpose | Domain |
|---|---|---|
| Development | Local development | localhost |
| Staging | Testing and QA | api-test.risklegion.com |
| Production | Live system | api.risklegion.com |
Supabase Project Setup
1. Create Project
- Go to supabase.com
- Create a new project
- Note down:
- Project URL
- Anon Key (public)
- Service Role Key (secret)
2. Database Setup
Run migrations to set up the database schema:3. Enable Row Level Security
4. Configure Auth
In Supabase Dashboard → Authentication:- Enable Email/Password provider
- Configure password requirements
- Set up email templates (optional)
- Configure redirect URLs
Backend Environment
Required Variables
Generate Secret Key
Frontend Environment
Required Variables
Environment-Specific Files
AWS Setup (EC2)
1. Create EC2 Instance
- Type: t3.small or larger
- AMI: Ubuntu 22.04 LTS
- Security Group: Allow ports 22, 80, 443, 8000
2. Install Docker
3. Configure nginx
4. Set Up SSL
GitHub Secrets
Configure these secrets in GitHub repository settings:AWS Secrets
| Secret | Description |
|---|---|
AWS_ACCESS_KEY_ID | AWS access key |
AWS_SECRET_ACCESS_KEY | AWS secret key |
EC2_HOST | EC2 instance public IP |
EC2_USER | SSH username (ubuntu) |
EC2_SSH_KEY | Private SSH key |
EC2_SSH_PORT | SSH port (22) |
Application Secrets
| Secret | Description |
|---|---|
SUPABASE_URL | Supabase project URL |
SUPABASE_ANON_KEY | Supabase anon key |
SUPABASE_SERVICE_ROLE_KEY | Supabase service role key |
DATABASE_URL | Direct database connection string |
SECRET_KEY | Application secret key |
SENTRY_DSN | Sentry error tracking DSN |
GH_PAT | GitHub Personal Access Token (for GHCR) |
Vercel Setup (Frontend)
1. Connect Repository
- Go to vercel.com
- Import GitHub repository
- Select
risk-legion-frontenddirectory
2. Configure Environment
In Vercel Dashboard → Settings → Environment Variables:| Variable | Value |
|---|---|
VITE_SUPABASE_URL | Your Supabase URL |
VITE_SUPABASE_ANON_KEY | Your anon key |
VITE_API_URL | https://api.risklegion.com |
3. Configure Rewrites
Invercel.json: