This project is a test bed for microservices applications running on the latest technologies around Java + Spring + Containers.
- all microservices
- all containerized
- latest versions
- multiple databases
- code coverage > 90%
- clear code
- build always passing
- always a work in progress
- Java 11
- Spring Boot 2.1.0
- Spring Web (using tomcat at moment, thinking about moving to undertow -because of that)
- Spring Cloud (eureka, zuul, etc.)
- Spring DevTool / Actuator (for speeding up the development/restart, etc)
- Spring Admin (for monitoring)
- Spring Security / Oauth2 (for authentication)
- Lombok (for avoiding boilerplate code)
- Swagger-ui / OpenApi (for exposing the rest services in an easy/user-friendly web page)
- Log4j2 (for logging)
- jUnit5 (for testing)
- Docker (generate docker image for the microservices, run the application, etc)
- Kubernetes (run in a k8s cluster)
- MongoDB
- Mysql
- Postgresql
For avoiding having a poor example of data, the subject of the microservices will be around Algorithms and Data Structures. So, the microservices will implement a few of the basic algorithms (search, sorting, common problems, etc.). I'm using the book Algorithms, 4th Edition by Robert Sedgewick and Kevin Wayne, as a base for the algorithms and data structures.
- I know that most of the implementation of the algorithms could be done in static methods, utility classes, etc. However, I will use spring services just to show how that works.
- I could copy and paste the code from the book and use them. But I will be testing myself to create them and code them in a way which they will be easier to understand (code style, comments, etc).
For making things easier, all microservices projects are subproject/modules from this maven project. That will make things easier than have separated git repositories for each one.
I've also added some module prefix for a better understanding:
- ms- : for microservices
- lib- : for library/jar
- server- : for servers
- app-: for app gateway
app-algorithms > Subproject for the app gateway microservice project.
lib-core > Subproject with few reusable codes for the microservices implementation. Just a library.
lib-data-structures > Subproject with data structures implementation. Just a library.
ms-problems-service > Subproject for the problems microservice.
ms-searching-service > Subproject for the searching microservice.
ms-sorting-service > Subproject for the sorting microservice.
server-admin > Subproject for the server admin.
server-eureka > Subproject for the service discovery - eureka server/service.
The apps are deployed as containers on the cloud. Please feel free to test it.
The faster way, running using the docker images that the last successful build generated.
docker-compose up
It should start up all the services. That is it. Play around and have fun! :)
Getting the code and compiling and running it.
.\mvnw install docker:build -D maven.test.skip=true
Note: skipping the testing for speeding up
docker-compose up