Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.jacobpevans.com/llms.txt

Use this file to discover all available pages before exploring further.

Proper configuration is the foundation of a reliable project. This guide walks you through creating a config file, setting environment variables, choosing the right options for your environment, and verifying that everything is correct before you run the project.

Setup process

1

Create your config file

Copy the example config file provided in the repository root and rename it for your environment:
cp config.example.yaml config.yaml
Open config.yaml in your editor and fill in the values for your environment. The file uses YAML syntax; see the annotated example below.
2

Set environment variables

Sensitive values such as API keys and database credentials should be provided through environment variables rather than stored in the config file. Create a .env file at the project root:
cp .env.example .env
Then open .env and populate the required values. The application reads these automatically on startup.
3

Configure for your environment

Set the environment field in config.yaml to match where you are running the project. Accepted values are development, staging, and production. Each value adjusts defaults for logging verbosity, error reporting, and caching behavior.
environment: development

server:
  host: "0.0.0.0"
  port: 3000

logging:
  level: debug        # debug | info | warn | error
  format: pretty      # pretty | json

cache:
  enabled: false
  ttl_seconds: 300

paths:
  output_dir: "./dist"
  temp_dir: "./tmp"
For production deployments, set environment: production. This enables JSON log formatting, raises the default log level to info, and turns on caching automatically.
4

Validate your configuration

Run the built-in validation command to check that all required fields are present and that values are within accepted ranges:
npm run config:validate
The command prints a summary of each checked field and exits with a non-zero status code if any problems are found, making it safe to use in CI pipelines.

Common configuration options

OptionDescriptionDefault
environmentRuntime environment (development, staging, production)development
server.portPort the server binds to3000
logging.levelMinimum log level to emitinfo
logging.formatLog output format (pretty or json)pretty
cache.enabledEnable response cachingfalse
cache.ttl_secondsCache entry lifetime in seconds300
paths.output_dirDirectory for build output./dist

Overriding config values at runtime

You can override any config file value by setting a corresponding environment variable using the APP_ prefix and uppercase key path. For example, to override server.port:
APP_SERVER_PORT=8080 npm start
Environment variable overrides take precedence over values in the config file.
Never commit your .env file or any file containing secrets (API keys, passwords, tokens) to version control. Add .env to your .gitignore immediately after creating it. Use a secrets manager or CI environment variables to supply sensitive values in deployed environments.