A starter template designed to help Claude Code quickly bootstrap backend projects with a structured configuration system.
This template provides:
- Config directory with
.propsfiles for environment-specific settings - Python configuration module for reading and accessing configuration values
- Constants module with predefined section and key names for type-safe config access
backend-template/
├── config/
│ ├── config.props # Default/base configuration
│ ├── config.dev.props # Development overrides
│ └── config.prod.props # Production overrides
├── src/
│ └── config/
│ ├── __init__.py
│ ├── loader.py # Configuration loading and parsing
│ └── constants.py # Section and key name constants
├── .gitignore
└── README.md
Configuration files use a simple .props format with sections and key-value pairs:
[database]
host=localhost
port=5432
[server]
host=0.0.0.0
port=8080from src.config import ConfigLoader
# Load default config
config = ConfigLoader()
# Load with environment override
config = ConfigLoader(env="dev")
# Access values
db_host = config.get("database", "host")
server_port = config.get_int("server", "port")from src.config.constants import Sections, Keys
config = ConfigLoader()
# Type-safe access using constants
db_host = config.get(Sections.DATABASE, Keys.HOST)
server_port = config.get_int(Sections.SERVER, Keys.PORT)When an environment is specified, values are loaded in this order:
config.props(base configuration)config.{env}.props(environment-specific overrides)
Later values override earlier ones.
- Copy this template to your project
- Edit
config/config.propswith your base settings - Create environment-specific overrides as needed
- Import and use
ConfigLoaderin your application
MIT