Documentation Index
Fetch the complete documentation index at: https://mnah05-boiler-go-21-79.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Boiler-Go uses environment variables for all configuration. Copy.env.example to .env and customize values for your environment.
All configuration is validated at startup. The application will fail fast if any required variables are missing or invalid.
Quick reference
Server configuration
APP_PORT
HTTP server port for the API service.- Validation: Must be between 1 and 65535
- Example:
8080,3000,8000 - Production: Use standard ports (80, 443) behind a reverse proxy
cmd/api/main.go:90-97 for the full configuration.
Database configuration
DATABASE_URL
PostgreSQL connection string with full connection parameters.- Format:
postgres://user:password@host:port/dbname?sslmode=mode - Validation:
- Scheme must be
postgresorpostgresql - Must include host
- Must include database name
- Scheme must be
- SSL Modes:
disable,require,verify-ca,verify-full
Connection pool settings
The database pool is configured with sensible defaults ininternal/db/pool.go:32-36:
Redis configuration
REDIS_ADDR
Redis server address and port.- Format:
host:port - Example:
localhost:6379,redis.example.com:6379 - Used for: Caching, session storage, background job queue (Asynq)
REDIS_PASSWORD
Redis authentication password.- Default: Empty (no authentication)
- Production: Always use strong passwords
- Security: Store in secrets manager, not version control
REDIS_DB
Redis database index.- Range: 0-15 (default Redis configuration)
- Validation: Must be between 0 and 15
- Use case: Separate logical databases on the same Redis instance
Redis supports 16 logical databases (0-15) by default. Use different indexes to isolate data between environments on the same server.
Timeout configuration
All timeout values accept Go duration strings.HEALTH_CHECK_TIMEOUT
Maximum duration for health check requests.- Format:
1s,500ms,2s,5s - Recommendation: Keep low for fast health check responses
- Used by:
/healthendpoint
API_SHUTDOWN_TIMEOUT
Graceful shutdown timeout for the API server.- Format:
10s,30s,1m - Behavior: Wait for in-flight requests to complete before forcing shutdown
- Recommendation: Long enough for typical request duration
cmd/api/main.go:124-125:
WORKER_SHUTDOWN_TIMEOUT
Graceful shutdown timeout for the background worker.- Format:
30s,1m,5m - Behavior: Wait for in-flight tasks to complete before forcing shutdown
- Recommendation: Longer than API timeout to allow task completion
cmd/worker/main.go:161-176:
Logging configuration
LOG_OUTPUT
Log output destination.- Options:
stdout,file,both - Validation: Must be one of the three allowed values
- Production: Use
stdoutfor container environments,filefor traditional deployments
stdout
Logs to standard output.Best for:
- Docker containers
- Kubernetes
- Cloud platforms
- Development
file
Logs to a file on disk.Best for:
- Traditional servers
- Local file rotation
- Offline analysis
both
Logs to both destinations.Best for:
- Hybrid environments
- Debugging
- Backup logging
LOG_FILE
Log file path whenLOG_OUTPUT is file or both.
- Default:
- API:
logs/api.log - Worker:
logs/worker.log
- API:
- Format: Relative or absolute path
- Requirements: Parent directory must exist or be writable
Leave
LOG_FILE empty to use default paths. Each service (API/worker) automatically uses its own default file.cmd/api/main.go:35-38 and cmd/worker/main.go:35-38:
Validation rules
All configuration is validated at startup byinternal/config/config.go:60-92. The application will exit with a descriptive error if validation fails.
Required fields
Validation checks
- APP_PORT: Must be a valid number between 1-65535
- DATABASE_URL: Must be valid PostgreSQL URL with scheme, host, and database name
- REDIS_DB: Must be between 0 and 15
- Timeouts: Must be positive duration values
- LOG_OUTPUT: Must be
stdout,file, orboth
internal/config/config.go:76-77:
Environment-specific examples
Development
Production
Docker Compose
In Docker Compose, use service names (postgres, redis) instead of localhost for inter-container communication.
Next steps
Docker deployment
Deploy with Docker and Docker Compose
Production checklist
Ensure production readiness