Java Spring-boot Micro-services blueprint
Features:
- Spring-boot fresh build
- docker with Docker compose.
- open API and swagger.
- makefile.
- Logs slf4j.
- message broker - rabbitmq.
- auth service- keycloak ( todo).
- Service registry.
- API-gateway.
- Design patterns (Pub-Sub, Command, Repository, Singleton).
- layer architecture (DDD).
- SpringBoot CI/CD Pipeline.
- kubernetes.
- make build
- make run
- to reload the Service use make reload
- URL: http://localhost:15672
- username: guest
- password: guest
I used OpenAPI with swagger for API docs, also followed Domain driven design with services Layer architecture to make it easy to understand the code
to check the API docs on localhost:
- Client Service http://localhost:8083
- transaction Service http://localhost
- invoice Service http://localhost:8082
For Async communications I used rabbitmq, and for sync I used normal http calls later on grpc will be good use, also we can use REDIS as improvement.
To achieve low latency: we crete empty invoice with Due_date based on client billing_interval everytime We are adding new client, then every time we add a new transaction to the system we process it and add it to the invoice, then we run a cron job every day to process all Due date invoices. after invoice is processed we mark it as done and create new one with new due date.
- Pub-Sub: I used bub-sub model along with events streaming broker rabbitmq.
- Command: I used two commands class for chargeClientCommand and createInvoiceCommand.
- Repository: Used repository pattern to decouple Domain layer from DB layer, for example we can mock the repository and use DB memory.
- Singleton: Singleton pattern is used in Spring bean.
I commented the part of pushing the images to DockerHub then uploading it to the cloud but, you can easily uncomment that to make it work.
the goal was to build the skeleton and base Architecture of the system, but these are Things need to be done when have more time:
-
Review and add more unit, integrations, contracts and App tests.
-
Build Frontend with React.js.
-
Add more App Validations.
-
Focus more on documentation.
-
Auth Service with Keycloak.
-
REDIS.
-
GRPC (support HTTP2/Websocket).
-
Note make sure you have Docker installed and give it enough memory from the setting, because we have 6 services running with 4 DBs.



