Skip to content

Environment Variables Configuration

The project uses environment variables for configuration across different services. Here’s a guide to setting up the required environment variables:

Frontend Environment Variables

Expo App (frontend/apps/expo/.env)

  • EXPO_PUBLIC_SITE_URL: Your site’s URL (default: http://localhost:8081)
  • EXPO_PUBLIC_SUPABASE_URL: Your Supabase project URL
  • EXPO_PUBLIC_SUPABASE_ANON_KEY: Your Supabase anonymous key
  • EXPO_PUBLIC_FIREBASE_*: Firebase configuration (get from Firebase Console)
  • EXPO_PUBLIC_GOOGLE_CLIENT_ID_*: Google OAuth client IDs for different platforms
  • EXPO_PUBLIC_REST_BACKEND_URL: Your Express.js backend URL
  • EXPO_PUBLIC_STRIPE_*: Stripe configuration (if using payments)

Next.js App (frontend/apps/next/.env)

  • NEXT_PUBLIC_SITE_URL: Your site’s URL (default: http://localhost:3000)
  • NEXT_PUBLIC_SUPABASE_URL: Your Supabase project URL
  • NEXT_PUBLIC_SUPABASE_ANON_KEY: Your Supabase anonymous key
  • NEXT_PUBLIC_FIREBASE_*: Firebase configuration (get from Firebase Console)
  • NEXT_PUBLIC_GOOGLE_CLIENT_ID_WEB: Google OAuth client ID for web
  • NEXT_PUBLIC_REST_BACKEND_URL: Your Express.js backend URL
  • NEXT_PUBLIC_STRIPE_*: Stripe configuration (if using payments)

Backend Environment Variables

Express.js Server (backend/express-js/.env)

  • PORT: Server port (default: 8080)
  • MONGODB_URL: MongoDB connection URL
  • JWT_*: JWT configuration for authentication
  • SMTP_*: Email service configuration
  • GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET: Google OAuth credentials
  • MINIO_*: MinIO storage configuration
  • TWILIO_*: Twilio configuration for SMS/OTP

Supabase Server (backend/supabase/.env)

  • SUPABASE_API_URL: Supabase API URL (default: http://127.0.0.1:54323)
  • SITE_URL: Your site’s URL
  • SUPABASE_SMTP_*: Email service configuration
  • SUPABASE_AUTH_GOOGLE_*: Google OAuth configuration

Getting API Keys and Credentials

  1. Supabase: Create a project at Supabase and get your project URL and anon key.
  2. Firebase: Create a project at Firebase Console and get your configuration.
  3. Google OAuth: Create OAuth credentials at Google Cloud Console.
  4. Stripe: Create an account at Stripe and get your API keys.
  5. Twilio: Create an account at Twilio for SMS/OTP functionality.

Security Notes

  • Never commit sensitive environment variables to version control
  • Use different API keys for development and production
  • Keep your .env files in .gitignore
  • Use environment variable encryption for production deployments

For more information about how environment variables are handled in the application, see the Configuration and Environment Setup guide.