You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Switch to MADR3 ADR format
* Move PUML diagrams and fix links
* Install Mermaid2 plugin
* Move documentation to mkdocs site and improve it
Signed-off-by: Federico Busetti <[email protected]>
This is an example implementation of microservice applying
12
+
This is an example implementation of a python application applying
13
13
concepts from [Clean Architecture](https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html)
14
14
and [SOLID principles](https://en.wikipedia.org/wiki/SOLID).
15
15
@@ -18,53 +18,26 @@ and [SOLID principles](https://en.wikipedia.org/wiki/SOLID).
18
18
* The application frameworks are decoupled from the domain logic
19
19
* The storage layer is decoupled from the domain logic
20
20
21
-
In this way our components are loosely coupled and the application logic
22
-
(the domains package) is completely independent of the chosen framework
23
-
and the persistence layer.
21
+
This template provides out of the box some commonly used functionalities:
24
22
25
-
## HTTP API Docs and versioning
23
+
* API Documentation using [FastAPI](https://fastapi.tiangolo.com/)
24
+
* Async tasks execution using [Celery](https://docs.celeryq.dev/en/stable/index.html)
25
+
* Repository pattern for databases using [SQLAlchemy](https://www.sqlalchemy.org/) and [SQLAlchemy bind manager](https://febus982.github.io/sqlalchemy-bind-manager/stable/)
26
+
* Database migrations using [Alembic](https://alembic.sqlalchemy.org/en/latest/) (configured supporting both sync and async SQLAlchemy engines)
27
+
*[TODO] Producer and consumer to emit and consume events using [CloudEvents](https://cloudevents.io/) format on [Confluent Kafka](https://docs.confluent.io/kafka-clients/python/current/overview.html)
26
28
27
-
API documentation is provided by [FastAPI](https://fastapi.tiangolo.com/features/)
28
-
on `/docs` and `/redoc` paths using OpenAPI format.
29
+
## Documentation
29
30
30
-
I believe that versioning an API at resource level provides a much more
31
-
flexible approach than versioning the whole API.
31
+
The detailed documentation is available:
32
32
33
-
The example `books` domain provides 2 endpoints to demonstrate this approach
33
+
* Online on [GitHub pages](https://febus982.github.io/bootstrap-python-fastapi/)
34
+
* Offline by running `make docs` after installing dependencies with `make dev-dependencies`
34
35
35
-
*`/api/books/v1` (POST)
36
-
*`/api/books/v2` (POST)
36
+
## How to use
37
37
38
-
## Package layers
39
-
40
-
This application is structured following the principles of Clean Architecture.
41
-
Higher level layers can import directly lower level layers. An inversion of control
42
-
pattern has to be used for lower level layers to use higher level ones.
43
-
44
-
Packages are ordered from the highest level to the lowest one.
We need to record the architectural decisions made on this project.
12
-
13
-
## Decision
14
-
15
-
We will use Architecture Decision Records, as [described by Michael Nygard](http://thinkrelevance.com/blog/2011/11/15/documenting-architecture-decisions).
16
-
17
-
## Consequences
18
-
19
-
See Michael Nygard's article, linked above. For a lightweight ADR toolset, see Nat Pryce's [adr-tools](https://github.com/npryce/adr-tools).
# date: {YYYY-MM-DD when the decision was last updated}
8
+
# deciders: {list everyone involved in the decision}
9
+
# consulted: {list everyone whose opinions are sought (typically subject-matter experts); and with whom there is a two-way communication}
10
+
# informed: {list everyone who is kept up-to-date on progress; and with whom there is a one-way communication}
11
+
---
12
+
# Use Markdown Any Decision Records
13
+
14
+
## Context and Problem Statement
15
+
16
+
We want to record any decisions made in this project independent whether decisions concern the architecture ("architectural decision record"), the code, or other fields.
17
+
Which format and structure should these records follow?
18
+
19
+
## Considered Options
20
+
21
+
*[MADR](https://adr.github.io/madr/) 3.0.0 – The Markdown Any Decision Records
22
+
*[Michael Nygard's template](http://thinkrelevance.com/blog/2011/11/15/documenting-architecture-decisions) – The first incarnation of the term "ADR"
23
+
* Other templates listed at <https://schubmat.github.io/DecisionCapture>
24
+
* Formless – No conventions for file format and structure
25
+
26
+
## Decision Outcome
27
+
28
+
Chosen option: "MADR 3.0.0", because
29
+
30
+
* Implicit assumptions should be made explicit.
31
+
Design documentation is important to enable people understanding the decisions later on.
32
+
See also [A rational design process: How and why to fake it](https://doi.org/10.1109/TSE.1986.6312940).
33
+
* MADR allows for structured capturing of any decision.
34
+
* The MADR format is lean and fits our development style.
35
+
* The MADR structure is comprehensible and facilitates usage & maintenance.
0 commit comments