Files
DocNest/backend/.env.example

65 lines
1.9 KiB
Plaintext

# Backend Environment Variables
# Copy this file to .env.local for local development
# ===================
# REQUIRED VARIABLES
# ===================
# Database Configuration
# Format: postgres://username:password@host:port/database?sslmode=disable
DATABASE_URL=postgres://collab:collab123@localhost:5432/collaboration?sslmode=disable
# JWT Secret - Use a strong random string (min 32 characters)
# Generate with: openssl rand -hex 32
JWT_SECRET=your-secret-key-change-this-in-production
# ===================
# SERVER CONFIGURATION
# ===================
# Server port (default: 8080)
# Can be overridden with --port flag: go run cmd/server/main.go --port 8081
PORT=8080
# Environment: development, staging, production
# Controls: cookie security (Secure flag), logging verbosity
ENVIRONMENT=development
# Backend URL (used to auto-construct OAuth callback URLs)
# If not set, defaults to http://localhost:${PORT}
# Set explicitly for production: https://api.yourdomain.com
BACKEND_URL=http://localhost:8080
# Frontend URL (for OAuth redirects after login)
FRONTEND_URL=http://localhost:5173
# ===================
# CORS CONFIGURATION
# ===================
# Comma-separated list of allowed origins
ALLOWED_ORIGINS=http://localhost:5173,http://localhost:3000
# ===================
# OAUTH CONFIGURATION
# ===================
# Google OAuth (https://console.cloud.google.com/)
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret
# Redirect URL - auto-derived from BACKEND_URL if not set
# GOOGLE_REDIRECT_URL=http://localhost:8080/api/auth/google/callback
# GitHub OAuth (https://github.com/settings/developers)
GITHUB_CLIENT_ID=your-github-client-id
GITHUB_CLIENT_SECRET=your-github-client-secret
# Redirect URL - auto-derived from BACKEND_URL if not set
# GITHUB_REDIRECT_URL=http://localhost:8080/api/auth/github/callback
# ===================
# OPTIONAL SERVICES
# ===================
# Redis (for future use)
REDIS_URL=redis://localhost:6379