Configuration
Pillow’s services are configured primarily through YAML config files and environment variable overrides. This page covers the configuration for each component.
Mill API Configuration
Section titled “Mill API Configuration”Mill reads its config from a YAML file. For local development, this is mill/config/config-local.yaml. All values can be overridden via environment variables prefixed with MILL_ (e.g. MILL_DATABASE_POSTGRES_HOST).
Database (PostgreSQL)
Section titled “Database (PostgreSQL)”database: postgres: host: "localhost" port: 5432 user: "pillow" password: "pillow" database: "pillow" ssl_mode: "disable" max_open_conns: 25 max_idle_conns: 10 conn_max_lifetime: "5m" query_timeout: "30s"For production, set credentials via environment variables:
MILL_DATABASE_POSTGRES_HOST=your-db-hostMILL_DATABASE_POSTGRES_PORT=5432MILL_DATABASE_POSTGRES_USER=your_userMILL_DATABASE_POSTGRES_PASSWORD=your_passwordMILL_DATABASE_POSTGRES_DATABASE=pillowMILL_DATABASE_POSTGRES_SSL_MODE=requireredis: host: "localhost" port: 6379 password: "" db: 0 pool_size: 10 min_idle_conns: 5 max_retries: 3Kafka (Redpanda)
Section titled “Kafka (Redpanda)”Kafka is used for the enrichment pipeline and property ingestion events.
kafka: brokers: - "localhost:19092" consumer_group: "mill-ingestion" topics: property_ingestion: "property-ingestion" property_enrichment: "property-enrichment" property_updates: "property-updates"Set kafka.disabled: true to run Mill without Kafka.
Server
Section titled “Server”server: host: "0.0.0.0" port: 4000 mode: "debug" # "debug" or "release" read_timeout: "30s" write_timeout: "30s" idle_timeout: "60s"Authentication
Section titled “Authentication”auth: jwt_secret: "change-this-in-production" jwt_expiry: "1h" refresh_expiry: "24h" issuer: "mill-analytics"Logging
Section titled “Logging”logging: level: "debug" # debug, info, warn, error format: "console" # console or json output: "stdout"Libpostal (Geocoding)
Section titled “Libpostal (Geocoding)”For enhanced address parsing, configure the libpostal integration:
libpostal: remote_url: "http://localhost:4400" timeout: "30s" max_retries: 3Pillow App Configuration
Section titled “Pillow App Configuration”The Next.js frontend reads from pillow-app/.env.local:
NEXT_PUBLIC_MILL_API=http://localhost:4000MILL_API=http://localhost:4000MILL_API_TIMEOUT=10000
# Optional: Mapbox for interactive mapsNEXT_PUBLIC_MAPBOX_TOKEN=your-mapbox-tokenInfrastructure (Docker Compose)
Section titled “Infrastructure (Docker Compose)”Local infrastructure is managed via Docker Compose. The development stack includes PostgreSQL (with PostGIS), Redis, and Redpanda:
# Start all infrastructuredocker compose -f docker-compose.dev.yml up -d
# Stop infrastructuredocker compose -f docker-compose.dev.yml down
# View logsdocker compose -f docker-compose.dev.yml logs -f postgresThe Mill also provides a smaller compose file for integration tests:
cd millmake docker-compose-up # Start Redis + PostgreSQLmake docker-compose-down # Stop and clean volumesEnvironment-Specific Settings
Section titled “Environment-Specific Settings”Development
Section titled “Development”The default config-local.yaml is tuned for local development:
- Debug logging enabled
- Rate limiting disabled
- Sample data loaded on startup
- Deduplication disabled
Production
Section titled “Production”For production, use a dedicated config file or override via environment variables:
- Set
MILL_SERVER_MODE=release - Set
MILL_LOGGING_LEVEL=infoandMILL_LOGGING_FORMAT=json - Enable rate limiting
- Use strong JWT secrets
- Enable SSL for PostgreSQL (
ssl_mode: require)
Health Checks
Section titled “Health Checks”Verify the system is configured correctly:
# Mill API healthcurl http://localhost:4000/health
# PostgreSQL connectivitypsql -h localhost -U pillow -d pillow -c "SELECT 1"
# Redis connectivityredis-cli ping
# Infrastructure statusdocker compose -f docker-compose.dev.yml psDatabase Setup
Section titled “Database Setup”PostgreSQL is provisioned automatically by Docker Compose. Mill auto-migrates the schema on startup. For a manual reset:
# Connect to PostgreSQLpsql -h localhost -U pillow -d pillow
# Apply schema manually (if needed)psql -h localhost -U pillow -d pillow < mill/scripts/create_comprehensive_properties_table.sqlSecurity Best Practices
Section titled “Security Best Practices”- Never commit secrets or credentials to version control
- Use environment variables for sensitive values in production
- Rotate JWT secrets regularly
- Enable SSL/TLS for all production database connections
- Use Kubernetes Secrets or a secrets manager for production deployments
Next Steps
Section titled “Next Steps”- API Documentation — explore available endpoints
- Mill Guide — understand the core API service
- Connectors — learn about data collection
- Deployment — production deployment options