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 consists of two main services:- API Server: Handles HTTP requests and serves the REST API
- Worker: Processes background jobs using Asynq
Prerequisites
Before running the services, ensure you have:Configured environment variables
Your
.env file should be properly configured. See Development setup for details.Running the API server
Start the API server using the Makefile command:go run ./cmd/api and starts the HTTP server on the port specified in your .env file (default: 8080).
Verify the API is running
Test the health check endpoint:API logs
The API server logs all requests and errors based on yourLOG_OUTPUT configuration:
stdout: Logs appear in your terminalfile: Logs are written to the path specified inLOG_FILEboth: Logs appear in both terminal and file
Running the worker
Start the background worker in a separate terminal:go run ./cmd/worker and starts processing jobs from the Redis queue.
Worker functionality
The worker service:- Connects to Redis using the
REDIS_ADDRconfiguration - Processes background jobs asynchronously
- Handles retries and error logging
- Supports graceful shutdown with
WORKER_SHUTDOWN_TIMEOUT
Running both services simultaneously
For a complete development environment, run both services in separate terminal windows:Stopping services
Stop API or Worker
PressCtrl+C in the terminal where the service is running. The service will gracefully shut down, waiting for ongoing requests or jobs to complete within the configured timeout.
Stop development services
To stop PostgreSQL and Redis:Troubleshooting
Connection refused errors
Connection refused errors
Ensure PostgreSQL and Redis are running:If containers aren’t running, start them with
make dev.Port already in use
Port already in use
If port 8080 is already in use, change the
APP_PORT in your .env file:Database migration errors
Database migration errors
Environment variables not loaded
Environment variables not loaded
Verify your
.env file exists in the project root and contains all required variables from .env.example.Next steps
- Learn about Database migrations
- Run the Testing suite
- Deploy your application with the Deployment guide