Refactor API configuration and improve WebSocket handling in frontend and backend
This commit is contained in:
@@ -1,32 +1,64 @@
|
||||
# Backend Environment Variables
|
||||
# Copy this file to .env.local for local development
|
||||
|
||||
# Server Configuration
|
||||
PORT=8080
|
||||
# ===================
|
||||
# REQUIRED VARIABLES
|
||||
# ===================
|
||||
|
||||
# Database Configuration
|
||||
# Format: postgres://username:password@host:port/database?sslmode=disable
|
||||
DATABASE_URL=postgres://collab:collab123@localhost:5432/collaboration?sslmode=disable
|
||||
|
||||
# Redis Configuration (optional, for future use)
|
||||
REDIS_URL=redis://localhost:6379
|
||||
# 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
|
||||
|
||||
# CORS Configuration
|
||||
# Comma-separated list of allowed origins
|
||||
ALLOWED_ORIGINS=http://localhost:5173,http://localhost:3000
|
||||
# ===================
|
||||
# SERVER CONFIGURATION
|
||||
# ===================
|
||||
|
||||
# JWT Secret (use a strong random string in production)
|
||||
JWT_SECRET=your-secret-key-change-this
|
||||
# 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
|
||||
|
||||
# Google OAuth (get from https://console.cloud.google.com/)
|
||||
# ===================
|
||||
# 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
|
||||
GOOGLE_REDIRECT_URL=http://localhost:8080/api/auth/google/callback
|
||||
# Redirect URL - auto-derived from BACKEND_URL if not set
|
||||
# GOOGLE_REDIRECT_URL=http://localhost:8080/api/auth/google/callback
|
||||
|
||||
# GitHub OAuth (get from https://github.com/settings/developers)
|
||||
# GitHub OAuth (https://github.com/settings/developers)
|
||||
GITHUB_CLIENT_ID=your-github-client-id
|
||||
GITHUB_CLIENT_SECRET=your-github-client-secret
|
||||
GITHUB_REDIRECT_URL=http://localhost:8080/api/auth/github/callback
|
||||
# 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
|
||||
|
||||
Reference in New Issue
Block a user