master/docs/002-config-yaml-plus-env.md

677 B

002 Config From YAML and Env

Context

  • The service needs readable project configuration and safe handling of sensitive values.
  • The final configuration object should be easy to inject and test.

Decision

  • Keep non-sensitive defaults in YAML files under config/.
  • Read sensitive values only from environment variables.
  • Merge YAML and env sources into one AppConfig dataclass tree in adapter/config/.
  • Keep configuration parsing and validation outside domain/ and usecase/.

Consequences

  • Local configuration remains simple to inspect and version.
  • Secrets stay out of committed files.
  • Inner layers depend on typed config data, not on env or YAML readers.