Project-Manager is a simple application for managing projects at company. You can create teams and add members to it. You can create, modify projects and assing teams to them. More you'll find below.
We'll go from traditional layered architecture to hexagonal architecture A.K.A. Ports and Adapters architecture.
./gradlew bootRun
- to run application.
./gradlew test
- to run unit tests.
./gradlew clean build test
- one to rule them all 💍
Idea is to see how does project changes while time passes with each branch there some change to the project structure or just new features that were implemented.
-
Look at endpoints here: /infrastructure/adapter/incoming/rest/
-
Checkout tests. In domain package you have unit tests that do tests of application core. They are isolated from framework and outside world. Tests are made on repository implemented as HashMap.
🏠 Architecture: Layered Architecure
-
POST: /teams
- create a team. -
POST: /teams/:teamName/members
- add members to the team. -
GET: /teams
- show teams.
Needs and constraints:
- Team cannot be created if already exists
- How many projects team has?
🏠 Architecture: Layered Architecure
-
POST: /projects/drafts
- create project draft (only project name). -
POST: /projects
- create full project (project with features📊). -
GET: /projects
- show draft projects
Needs and constraints:
- JobPosition must be valid (Developer, Scrum Master...)
- Team can have no more than 3 projects at the time
🏠 Architecture: Hexagonal Architecure
Things done:
- Moving from layered (n-tier) architecture to Hexagonal Architecture (ports and adapters). 😎
- Introduced idea of shared-kernel from DDD
Improved tests:
- Unit tests without touching IO. Domain is tested with unit tests. Idea of
InMemoryRepository
as HashMap. - Only the main paths (happy paths) are integration tests because sad path was tested with unit tests.
- We also have acceptance tests that are practically similar to above, but shows complete flow of bounded-context.
Refactor introducing simple CQRS.
🏠 Architecture: Hexagonal Architecure
-
GET: /projects/:id
- show project (project not project draft) -
PUT: /projects/:id
- change/update project -
PATCH: /projects/:id/started
- start team when team assigned -
PATCH: /projects/:id/ended
- close project when features are done
🏠 Architecture: Hexagonal Architecture (modularization on package level)
🕳 Tests: Integration/Acceptance/Unit
Backing-Services from Twelve-Factor-App methodology.
Services from our zoo:
🦓 user-autorization-service - authentication gateway that protects back-end resources. There is two kinds of resources protected and unprotected. First one requires user-level authentication and second one is just read-only such as listing of offers/products.
🐼 edge-service - gives possibility to expose unified REST API from all of ours backend services. To be able to do this, the Edge Service matches a request route’s URL fragment from a front-end application to a back-end microservice through a reverse proxy to retrieve the remote REST API response.
🐰 discovery-service - Edge-service matches a request route’s URL fragment from a front-end application to a back-end microservice through a reverse proxy to retrieve the remote REST API response.
🐿 centralized-configuration-server - Spring Cloud application that centralizes external configurations using various methodologies of building twelve-factor applications.
- monitoring, grafana, actuator, performance tests with gatling
- Kotlin with spring
- Spock (groovy) for tests
- ArchUnit (kotlin) for architecture tests
- Gradle to build project
- PL: Prawie trywialna aplikacja do zarządzania projektami - bardziej szczegółowy opis projektu.
- ENG: The nature of domain driven design - about DDD strategic tools.