-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Summary
The goal is to implement structured configuration management using Viper to handle environment variables and configuration files in a unified way.
This change replaces the early-stage ad-hoc environment variable handling and prepares the codebase for future scalability.
Motivation
As the project grows, simple environment variables are not sufficient to manage configuration. We will need:
-
Support for multiple environments (development, staging, production).
-
A centralized way to define defaults and load overrides.
-
Config files (e.g., YAML or TOML) for local and deployment setups.
Using Viper provides:
-
A single API for reading environment variables, flags, and config files.
-
Built-in support for defaults and automatic environment binding.
-
Future flexibility for reloading or merging configs dynamically.
TODO
-
Added dependency on Viper.
-
Added runtime selection for Postgres and SQLite backends based on configuration.
-
Validate config values and provide sane defaults (e.g. default url, fallback database).
-
Add support for configuration files (e.g. config.yaml).
-
Integrate config-driven setup into application initialization.