Skip to main content

Environment Overview

TalentG uses a multi-environment setup to ensure safe development and deployment practices.

Environment Types

Development (Local)

Purpose: Local development and testing Configuration:
  • URL: http://localhost:3000
  • Database: Local Supabase project
  • Authentication: Development Supabase Auth
  • Storage: Local Supabase Storage
  • Logging: Console logging enabled
Setup:
# Install dependencies
pnpm install

# Start development server
pnpm iso:dev

# Environment variables
cp .env.example .env.local
Key Features:
  • Hot reload enabled
  • Debug logging
  • Mock data available
  • Development-only features

Staging

Purpose: Pre-production testing and validation Configuration:
  • URL: https://talentg-staging.vercel.app
  • Database: Staging Supabase project
  • Authentication: Staging Supabase Auth
  • Storage: Staging Supabase Storage
  • Logging: Structured logging
Deployment:
  • Automatic deployment from staging branch
  • Vercel preview deployments
  • Database migrations applied automatically

Production

Purpose: Live application serving end users Configuration:
  • URL: https://talentg.vercel.app
  • Database: Production Supabase project
  • Authentication: Production Supabase Auth
  • Storage: Production Supabase Storage
  • Logging: Production logging with monitoring
Deployment:
  • Automatic deployment from main branch
  • Zero-downtime deployments
  • Database backups enabled

Environment Variables

Required Variables

# Supabase Configuration
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_service_role_key

# Application Configuration
NEXT_PUBLIC_APP_URL=http://localhost:3000
NODE_ENV=development

# Email Configuration
BREVO_API_KEY=your_brevo_api_key
BREVO_TEMPLATE_ID_STRENGTH_REPORT=your_template_id
EMAIL_FROM=TalentG <contact@talentg.io>
QUEUE_CRON_SECRET=your_cron_secret_for_email_processing

# Payment Configuration (Production only)
STRIPE_PUBLISHABLE_KEY=your_stripe_key
STRIPE_SECRET_KEY=your_stripe_secret
STRIPE_WEBHOOK_SECRET=your_webhook_secret

Environment-Specific Values

VariableDevelopmentStagingProduction
NEXT_PUBLIC_APP_URLhttp://localhost:3000https://talentg-staging.vercel.apphttps://talentg.vercel.app
NODE_ENVdevelopmentstagingproduction
LOG_LEVELdebuginfowarn
ENABLE_ANALYTICSfalsetruetrue

Database Management

Schema Migrations

# Generate migration
supabase migration new add_new_table

# Apply migrations
supabase db push

# Reset database (development only)
supabase db reset

Environment-Specific Policies

-- Development: More permissive policies
CREATE POLICY "dev_full_access" ON profiles
  FOR ALL USING (true);

-- Production: Strict RLS policies
CREATE POLICY "prod_user_access" ON profiles
  FOR SELECT USING (auth.uid() = id);

Deployment Strategy

Branch Strategy

  • main: Production deployments
  • staging: Staging deployments
  • feature/*: Development branches

CI/CD Pipeline

  1. Code Push: Triggered on branch push
  2. Build: Next.js build with environment-specific config
  3. Test: Automated testing suite
  4. Deploy: Vercel deployment
  5. Database: Migration application
  6. Health Check: Post-deployment validation

Rollback Strategy

  • Vercel: Automatic rollback to previous deployment
  • Database: Migration rollback scripts
  • Environment Variables: Version-controlled configuration

Monitoring & Logging

Development

  • Console logging with detailed stack traces
  • React DevTools integration
  • Supabase dashboard for database queries

Staging

  • Structured logging with context
  • Performance monitoring
  • Error tracking with Sentry

Production

  • Minimal logging for performance
  • Real-time monitoring
  • Alerting for critical issues
  • Analytics and user behavior tracking

Security Considerations

Environment Isolation

  • Separate Supabase projects per environment
  • Different API keys and secrets
  • Isolated user data and authentication

Access Control

  • Development: Full team access
  • Staging: Limited team access
  • Production: Restricted access with approval process

Data Protection

  • Development: Mock/sample data
  • Staging: Anonymized production data
  • Production: Full data protection compliance