Skip to content

Commit 1ed33b2

Browse files
committed
Improve README
1 parent 4efc8f9 commit 1ed33b2

1 file changed

Lines changed: 12 additions & 7 deletions

File tree

README.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,32 @@ Project template for Python projects + uv + Vertical Slice Architecture
44

55
# Execute project
66

7+
**Initialize environment:**
8+
79
```bash
810
docker compose --file compose-dev.yaml up --detach
911
```
1012

11-
**Visual Studio Code -> Run and Debug -> api** (or `uv run -- fastapi dev src/python_template/api/main.py`)
13+
**Run project:**
14+
15+
> Visual Studio Code -> Run and Debug -> api
16+
17+
(or `uv run -- fastapi dev src/python_template/api/main.py`)
18+
19+
**Destroy environment:**
1220

1321
```bash
1422
docker compose --file compose-dev.yaml down --volumes
1523
```
1624

17-
# Reasonings
18-
19-
## Settings and .env files
25+
# Settings and .env files
2026

21-
Each backend must be deployed to several environments (development, staging, production...), but each company uses different environments (from one to any number), so the backend is the only one that knows the number of environments and their names.
27+
The API must be deployed to several environments (development, staging, production...), but each company uses different environments (from one to any number), so the API is the only one that knows the number of environments and their names.
2228
Then, each environment has its own settings (e.g., the logging level or URL of an external service may vary between environments).
2329

2430
So, we'll use this rules to store settings:
25-
- Store settings in `.env` files.
2631
- A `.env` file for common settings.
2732
- A `.env.{environment}` file for each environment.
2833
- If a setting is in both `.env` and `.env.{environment}`, the one in `.env.{environment}` takes precedence.
2934

30-
Regarding the location of those files, the typical is to save `.env` files in the root of the project, but due to some popular tools and packages (Jupyter, FastAPI, Docker Compose...) load automatically and exclusively the file `.env`, ignoring the environments and the priority order defined by the backend (e.g., `.env.{environment}` has priority over `.env` because it's the current environment), then we need to store the `.env` files in another location (in this case, in the `api` folder) and give the backend the responsibility of loading them, taking into account the environment name.
35+
Regarding the location of those files, the typical is to save `.env` files in the root of the project, but due to some popular tools and packages (Jupyter, FastAPI, Docker Compose...) load automatically and exclusively the file `.env`, ignoring the environments and the priority order defined by the API (e.g., `.env.{environment}` has priority over `.env` because it's the current environment), then we need to store the `.env` files in another location (in this case, in the `api` folder) and give the backend the responsibility of loading them, taking into account the environment name.

0 commit comments

Comments
 (0)