Skip to content

Commit a7c1ba7

Browse files
authored
Merge pull request #537 from nanotaboada/docs/readme-review
docs(readme): align structure and update prose
2 parents 0810c52 + 6e207d6 commit a7c1ba7

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

README.md

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ Proof of Concept for a RESTful API built with [Python 3](https://www.python.org/
2121
- [Tech Stack](#tech-stack)
2222
- [Project Structure](#project-structure)
2323
- [Architecture](#architecture)
24+
- [Architecture Decisions](#architecture-decisions)
2425
- [API Reference](#api-reference)
2526
- [Prerequisites](#prerequisites)
2627
- [Quick Start](#quick-start)
2728
- [Testing](#testing)
28-
- [Docker](#docker)
29+
- [Containers](#containers)
2930
- [Releases](#releases)
3031
- [Environment Variables](#environment-variables)
3132
- [Command Summary](#command-summary)
32-
- [Architecture Decisions](#architecture-decisions)
3333
- [Contributing](#contributing)
3434
- [Legal](#legal)
3535

@@ -157,23 +157,27 @@ graph RL
157157

158158
### Arrow Semantics
159159

160-
Arrows point from a dependency toward its consumer. Solid arrows (`-->`) denote **strong (functional) dependencies**: the consumer actively invokes behavior — registering route handlers, dispatching requests, executing async queries, or managing the database session. Dotted arrows (`-.->`) denote **soft (structural) dependencies**: the consumer only references types without invoking runtime behavior. This distinction follows UML's `«use»` dependency notation and classical coupling theory (Myers, 1978): strong arrows approximate *control or stamp coupling*, while soft arrows approximate *data coupling*, where only shared data structures cross the boundary.
160+
Arrows follow the injection direction: `A --> B` means A is injected into B. Solid arrows (`-->`) represent active dependencies — components wired via FastAPI's `Depends()` mechanism and invoked at runtime. Dotted arrows (`-.->`) represent structural dependenciesthe consumer references types without invoking runtime behavior.
161161

162162
### Composition Root Pattern
163163

164-
The `main` module acts as the composition rootit creates the FastAPI application instance, configures the lifespan handler, and registers all route modules via `app.include_router()`. Rather than explicit object construction, dependency injection is provided by FastAPI's built-in `Depends()` mechanism: `routes` declare their dependencies (e.g. `AsyncSession`) as function parameters and FastAPI resolves them at request time. This pattern enables dependency injection, improves testability, and ensures no other module bears responsibility for wiring or lifecycle management.
164+
`main` is the composition root: it creates the FastAPI application instance, configures the lifespan handler, and registers all route modules via `app.include_router()`. Dependencies are resolved at request time via FastAPI's `Depends()` mechanism.
165165

166166
### Layered Architecture
167167

168-
The codebase is organized into four conceptual layers: Initialization (`main`), HTTP (`routes`), Business (`services`), and Data (`schemas`, `databases`).
168+
Four layers: Initialization (`main`), HTTP (`routes`), Business (`services`), and Data (`schemas`, `databases`).
169169

170-
Third-party dependencies are co-resident within the layer that consumes them: `FastAPI` and `aiocache` inside HTTP, and `SQLAlchemy` inside Data. `routes` holds a soft dependency on `SQLAlchemy` `AsyncSession` is referenced only as a type annotation in `Depends()`, without any direct SQLAlchemy method calls at the route level.
170+
Third-party packages are placed inside the subgraph of the layer that uses them`FastAPI` and `aiocache` in HTTP, `SQLAlchemy` in Data. The soft dependency from `routes` to `SQLAlchemy` reflects `AsyncSession` appearing only as a type annotation in `Depends()`, with no direct SQLAlchemy calls at the route level.
171171

172-
The `models` package is a **cross-cutting type concern**it defines Pydantic request and response models consumed across multiple layers, without containing logic or behavior of its own. Dependencies always flow from consumers toward their lower-level types: each layer depends on (consumes) the layers below it, and no layer invokes behavior in a layer above it.
172+
`models` is a cross-cutting type concern — Pydantic request/response models consumed across all layers, with no logic of its own.
173173

174174
### Color Coding
175175

176-
Core packages (blue) implement the application logic, third-party dependencies (red) are community packages, and tests (green) ensure code quality.
176+
Blue = core application packages, red = third-party libraries, green = tests.
177+
178+
## Architecture Decisions
179+
180+
Key architectural decisions are documented as ADRs in [`docs/adr/`](docs/adr/README.md).
177181

178182
## API Reference
179183

@@ -271,7 +275,7 @@ Tests are located in the `tests/` directory and use `httpx` for async integratio
271275

272276
**Coverage target:** 80% minimum.
273277

274-
## Docker
278+
## Containers
275279

276280
This project includes full Docker support with Docker Compose for easy deployment.
277281

@@ -405,11 +409,6 @@ PYTHONUNBUFFERED=1
405409
| `docker compose down` | Stop Docker container |
406410
| `docker compose down -v` | Stop and remove Docker volume |
407411

408-
## Architecture Decisions
409-
410-
Key architectural decisions are documented as ADRs in
411-
[`docs/adr/`](docs/adr/README.md).
412-
413412
## Contributing
414413

415414
Contributions are welcome! Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on the code of conduct and the process for submitting pull requests.
@@ -423,4 +422,4 @@ Contributions are welcome! Please read [CONTRIBUTING.md](CONTRIBUTING.md) for de
423422

424423
## Legal
425424

426-
This project is provided for educational and demonstration purposes and may be used in production environments at your discretion. All referenced trademarks, service marks, product names, company names, and logos are the property of their respective owners and are used solely for identification or illustrative purposes.
425+
This project is provided for educational and demonstration purposes and may be used in production at your own discretion. All trademarks, service marks, product names, company names, and logos referenced herein are the property of their respective owners and are used solely for identification or illustrative purposes.

0 commit comments

Comments
 (0)