Skip to content

Commit 14d3422

Browse files
committed
Fix docs
1 parent 203264a commit 14d3422

2 files changed

Lines changed: 26 additions & 11 deletions

File tree

README.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -562,9 +562,12 @@ from the structured TOML files. More details are available at https://github.com
562562

563563
1. Configure local environment
564564

565-
* Create `.secrets.toml` in `config/local` following `.secrets.toml.example`
566-
* Edit TOML files in `config/local` according to your project requirements
567-
* When using Docker Compose, remember to pass `APP_ENV` to your service:
565+
* In this project, local configuration is already prepared in `config/local/`.
566+
Nothing needs to be created — adjust files only if you want to change defaults.
567+
* If you want to adjust settings, edit the existing TOML files in `config/local/` directly.
568+
`.env.local` will be generated automatically — **don’t** create or edit it manually.
569+
* Docker Compose in this project is already configured with `APP_ENV`.
570+
Just keep in mind this variable if you change the setup:
568571

569572
```yaml
570573
services:
@@ -574,8 +577,6 @@ services:
574577
APP_ENV: ${APP_ENV}
575578
```
576579
577-
* `.env.local` will be generated later — **don't** create it manually
578-
579580
2. Set environment variable
580581
581582
```shell
@@ -690,6 +691,10 @@ Makefile commands.
690691

691692
- [Martin Fowler. Patterns of Enterprise Application Architecture. 2002](https://www.amazon.com/Patterns-Enterprise-Application-Architecture-Martin/dp/0321127420)
692693

694+
## Adjacent
695+
696+
- [Vladimir Khorikov. Unit Testing Principles. 2020](https://www.amazon.com/Unit-Testing-Principles-Practices-Patterns/dp/1617296279)
697+
693698
# ⭐ Support the Project
694699

695700
If you find this project useful, please give it a star or share it!
@@ -724,7 +729,7 @@ frequent and lively communication challenges, as well as the ⚗️ Reagento (ad
724729
- [x] simplify settings
725730
- [x] simplify annotations
726731
- [ ] add integration tests
727-
- [ ] explain code
732+
- [ ] explain design choices
728733

729734
[^1]: Session and token share the same expiry time, avoiding database reads if the token is expired.
730735
This scheme of using JWT **is not** related to OAuth 2.0 and is a custom micro-optimization.

src/app/domain/entities/user.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
11
"""
2-
- Flat (non-nested) models are best kept anemic (without methods).
3-
The behavior of such models is described in the domain service.
2+
- In the early stages of development
3+
when the domain model is not yet clearly defined,
4+
it is wiser to keep entities
5+
flat (non-nested) and anemic (without behavior).
6+
Their behavior resides in separate domain services,
7+
even though this weakens encapsulation.
48
5-
- When working with non-flat models, such as aggregates, it makes sense
6-
to have rich models (with methods). The behavior of these models is
7-
described within the models themselves.
9+
- Once the core logic is well established,
10+
some entities can, as aggregate roots,
11+
become non-flat and rich (with behavior).
12+
This best enforces invariants
13+
but can be tricky to design once and for all.
14+
15+
- Prefer rich value objects early,
16+
freeing entities and services
17+
from an excessive burden of local rules.
818
"""
919

1020
from dataclasses import dataclass

0 commit comments

Comments
 (0)