Configuration
Whatomate uses a TOML configuration file for all settings. By default, it looks for config.toml in the current directory.
Configuration File
# Application settings[app]environment = "development" # development, productiondebug = true
# Server settings[server]host = "0.0.0.0"port = 8080read_timeout = 30write_timeout = 30
# Database settings[database]host = "localhost"port = 5432user = "whatomate"password = "your-password"name = "whatomate"sslmode = "disable"
# Redis settings[redis]host = "localhost"port = 6379password = ""db = 0
# JWT settings[jwt]secret = "your-jwt-secret-key"access_expiry_mins = 15refresh_expiry_days = 7
# Storage settings[storage]type = "local" # local or s3local_path = "./uploads"Environment Variables
Configuration values can be overridden using environment variables:
| Variable | Description |
|---|---|
WHATOMATE_ENV | Environment (development/production) |
WHATOMATE_DATABASE_HOST | Database host |
WHATOMATE_DATABASE_PORT | Database port |
WHATOMATE_DATABASE_USER | Database user |
WHATOMATE_DATABASE_PASSWORD | Database password |
WHATOMATE_DATABASE_NAME | Database name |
WHATOMATE_REDIS_HOST | Redis host |
WHATOMATE_REDIS_PORT | Redis port |
WHATOMATE_JWT_SECRET | JWT signing secret |
Database Setup
PostgreSQL
# Create databasecreatedb whatomate
# Or using psqlpsql -c "CREATE DATABASE whatomate;"Run Migrations
./whatomate server -migrateWhatsApp API Configuration
Configure your WhatsApp Business API credentials in the application settings after logging in:
- Navigate to Settings → Accounts
- Click Add Account
- Enter your credentials:
- Phone Number ID - From Meta Business Suite
- Business Account ID - From Meta Business Suite
- Access Token - Generated in Meta for Developers
- Webhook Verify Token - Your custom verification token
Building
Development Build
make build # Backend only (no frontend embedded)For development, run backend and frontend separately:
- Backend:
make runor./whatomate server - Frontend:
cd frontend && npm run dev
Production Build
make build-prod # Single binary with embedded frontendThis creates a self-contained binary that serves both API and frontend.
| Command | Frontend | Use Case |
|---|---|---|
make build | Not embedded | Development |
make build-prod | Embedded | Production |
CLI Reference
Whatomate uses a single binary with subcommands:
./whatomate <command> [options]Commands
| Command | Description |
|---|---|
server | Start the API server (with optional embedded workers) |
worker | Start background workers only (no API server) |
version | Show version information |
help | Show help message |
Server Options
./whatomate server [options]
-config string Path to config file (default "config.toml") -migrate Run database migrations on startup -workers int Number of embedded workers, 0 to disable (default 1)Worker Options
./whatomate worker [options]
-config string Path to config file (default "config.toml") -workers int Number of workers to run (default 1)Deployment Scenarios
All-in-One (Simple)
Run API and workers in a single process:
./whatomate serverSeparate API and Workers (Scalable)
Run API server without embedded workers:
./whatomate server -workers=0Run workers on separate machines:
./whatomate worker -workers=4Docker Compose
# Start all servicesdocker-compose up -d
# Scale workersdocker-compose up -d --scale worker=3Production Recommendations
For production deployments:
- Set
environment = "production"anddebug = false - Use strong, unique values for
jwt.secret - Enable SSL for database connections (
sslmode = "require") - Use Redis authentication in production
- Configure proper firewall rules
- Set up SSL/TLS termination (nginx, Caddy, or cloud load balancer)
- Consider running API and workers separately for better scaling