Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 97 additions & 0 deletions Backend/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# Environment Configuration Template

# ============================================================
# DATABASE CONFIGURATION (PostgreSQL/Supabase)
# ============================================================

# Required: PostgreSQL Connection Credentials
user=your_database_user
password=your_database_password
host=your_database_host
port=5432
dbname=your_database_name

# For Supabase users:
# 1. Go to: https://app.supabase.com/project/YOUR_PROJECT/settings/database
# 2. Copy connection details from the "Connection string" section
# 3. Extract the credentials and paste them above

# Example for Supabase:
# user=postgres
# password=your_project_password
# host=db.xyzabcdefgh.supabase.co
# port=5432
# dbname=postgres

# ============================================================
# SUPABASE REST API (Fallback & Additional Features)
# ============================================================

# Required for REST API fallback when PostgreSQL fails
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_KEY=your_supabase_anon_key

# Get these from:
# https://app.supabase.com/project/YOUR_PROJECT/settings/api

# ============================================================
# AI SERVICES
# ============================================================

# Google Gemini API (for trending niches)
GEMINI_API_KEY=your_gemini_api_key
# Get from: https://makersuite.google.com/app/apikey

# YouTube Data API (for channel info)
YOUTUBE_API_KEY=your_youtube_api_key
# Get from: https://console.cloud.google.com/apis/credentials

# ============================================================
# ADVANCED DATABASE SETTINGS (Optional)
# ============================================================

# Connection Pool Configuration
DB_POOL_SIZE=5 # Number of connections in the pool
DB_MAX_OVERFLOW=10 # Additional connections allowed beyond pool_size
DB_POOL_TIMEOUT=30 # Seconds to wait for a connection from the pool
DB_POOL_RECYCLE=3600 # Recycle connections after N seconds (1 hour)

# Connection Retry Settings
DB_MAX_RETRIES=3 # Number of connection retry attempts
DB_RETRY_DELAY=1.0 # Initial delay between retries (exponential backoff)
DB_CONNECTION_TIMEOUT=10 # Seconds to wait for connection establishment

# IPv6/Network Settings
DB_PREFER_IPV4=true # Prefer IPv4 connections (helps with IPv6 issues)
DB_SSL_MODE=require # SSL mode: disable, allow, prefer, require, verify-ca, verify-full

# Fallback Configuration
DB_USE_REST_FALLBACK=true # Use Supabase REST API when PostgreSQL fails

# ============================================================
# APPLICATION SETTINGS (Optional)
# ============================================================

# Debug mode (shows detailed errors)
DEBUG=false

# CORS Origins (comma-separated)
CORS_ORIGINS=http://localhost:5173,http://localhost:3000

# ============================================================
# TROUBLESHOOTING
# ============================================================

# If you experience connection issues:
# 1. IPv6 Issues: Set DB_PREFER_IPV4=true and use Supabase Connection Pooler
# 2. Timeout Issues: Increase DB_CONNECTION_TIMEOUT and DB_POOL_TIMEOUT
# 3. SSL Issues: Try DB_SSL_MODE=disable for local development
# 4. General Issues: Enable DEBUG=true for detailed error messages

# For Supabase Connection Pooler (IPv4 compatible):
# 1. Enable in Supabase Dashboard β†’ Database β†’ Connection Pooler
# 2. Update your host:
# host=aws-0-us-east-1.pooler.supabase.com
# port=6543

# See DATABASE_SETUP.md for detailed troubleshooting guide
Loading