Example application for the course Developing Enterprise Applications Without Pain and Regret
The application is using microservice architecture, each service encapsulates a bounded contexts. In the part_1 branch, you can see how the application starts as modular monolith at the early stage.
Each microservice is implemented according to the principles of Clean Architecture, and the business logic is implemented using Domain-Driven Design patterns (Aggregates, Entities, Value Objects, Domain Services). The project structure is maintained by ArchUnit.
Currently, a RDMS is used only for a single aggregate, everything else is an InMemory implementation of repositories.
We also tried to implement the principle of Screaming Architecture. The project structure reflects the purpose of the project and its functionality, the same applies to packages and even individual files.
Decisions about important architectural choices are contained in Architecture Decision Records.
The main idea is that it should be as convenient as mush as possible for developers to work at their local computer. Therefore, all necessary actions with the project can be performed by pressing a single "button" located in tools/scripts. Thus, we fully implement the CI concept. GitHubActions is used as a safeguard. If the build fails, the reports artifact contains all the necessary information for diagnostics. For push, you can install a pre-push hook, which will run the entire build before pushing to the repository.
In addition to simple compilation and image preparation, the project uses additional tools, the results of which also affect the success or failure of the build.
- Static analyzer detekt
- Linter - ktlint, (as a plugin to detekt)
- Test coverage control JaCoCo
- Vulnerable dependencies search OWASP DependencyCheck
- Search for new versions for dependencies
- Control of the absence of compiler warnings
Dependencies are listed in ProjectDependencies.kt
With "buttons" from tools/scripts, you can deploy and stop the cluster on the developer's machine without the need to occupy dev\sit\uat environments.
The test pyramid implemented in the project:
- Unit tests
- Integration tests
- Testing repositories
- Testing clients to external services
- Contract tests Pact.io
- Component tests
- End-to-end tests kbdd + Allure
- Project structure tests ArchUnit
- Mutation tests PiTest
- Performance tests Gatling
The example implements:
- Asynchronous interaction between microservices via RabbitMQ
- HATEOAS level REST - Spring HATEOAS
- Use of resilience patterns (for example, the library)
- Centralized error handling
- Input validation by the domain model
- Interaction via Telnet (ktelnet library, copied to the repository with several bug fixes)
In Progress
In Progress
In Progress
Star us and join our Telegram channel