Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Architecture refactoring #61

Merged
merged 153 commits into from
Oct 7, 2024

Conversation

raf-nr
Copy link
Contributor

@raf-nr raf-nr commented Sep 21, 2024

Clean architecture

The project architecture was completely redone in accordance with the principles of clean architecture:

  • The basic business logic was moved to a separate domain module, which does not depend on the “external world”.
  • Business scenarios were highlighted and placed in the usecase module. They manage domain entities and nothing else. They do not depend on the “ external world” in any way and communicate with it using interfaces.
  • Database models, data store and external task settings, as well as all other infrastructure elements were placed in the infrastructure module.
  • The repository module contains implementations of repositories - a design pattern that provides an abstraction for working with a data store, without specifying the details of the structure of this store.
  • Similarly, the worker module contains the implementation of all background task workers.

Tests

Unit tests have been added for all module elements:

  • domain
  • repository
  • usecase

@raf-nr raf-nr force-pushed the clean-architecture-refactor branch from 82f3a16 to e5e1c21 Compare September 27, 2024 01:31
@raf-nr raf-nr force-pushed the clean-architecture-refactor branch from 3439ac5 to 84b3b83 Compare October 1, 2024 14:56
@raf-nr raf-nr force-pushed the clean-architecture-refactor branch from 84b3b83 to 51a9876 Compare October 1, 2024 15:53
@raf-nr raf-nr force-pushed the clean-architecture-refactor branch from 51a9876 to 4b1fcfa Compare October 2, 2024 14:40
@raf-nr raf-nr force-pushed the clean-architecture-refactor branch 2 times, most recently from ddb8541 to 896c9c5 Compare October 2, 2024 21:58
@raf-nr
Copy link
Contributor Author

raf-nr commented Oct 2, 2024

Типы поправил, от sqlaclhemy_mixins полностью избавились.
В дополнение к этому сделал нормальный "универсальный" unit of work, который работает теперь для всех типов репозиториев.
Добавил новые unit и интеграционные тесты, а также тесты, проверяющие зависимости между модулями на соблюдение принципов clean architecture.

@raf-nr raf-nr force-pushed the clean-architecture-refactor branch 2 times, most recently from e78384e to f529031 Compare October 2, 2024 22:12
@raf-nr raf-nr force-pushed the clean-architecture-refactor branch from f529031 to b19ed84 Compare October 2, 2024 22:13
@raf-nr raf-nr requested a review from toadharvard October 4, 2024 20:49
@toadharvard toadharvard merged commit 84a044b into Desbordante:main Oct 7, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants