This is a simple project of a task management system that's composed of 3 separated components (3 tier):
- tms-backend responsible for the business layer. It exposes API via REST using Spring boot and Spring data
- tms-frontend responsible for the presentation layer using Spring boot, Thymeleaf views and Bootstrap
- MongoDB as a database
You can skip the rest of this document by clicking on this demo video here
There are 2 ways to build and run the project on a preferred Ubuntu machine:
- Simple way, using the provided docker compose file
- Manual way, that requires just a bit of configuration
Shown in demo video this requires that you have docker + compose plugin installed and docker group added so you can run it without sudo.
Run the following line on the root folder of the project to start all application 3 tiers:
bash run-all.shWe first need to install MongoDB on our localhost using this link:
MongoDB Community Edition
Alternatively if you have docker installed it can be run with just 2 command lines:
docker network create -d bridge my-net
docker run --name mongo --network=my-net -p 27017:27017 -d mongo:4.4.29Once installed and up that is all for the DB, no need to set up any schema.
To configure tms-backend replace the following line in tms-backend/src/main/resources/application.properties with:
spring.data.mongodb.uri=mongodb://localhost:27017To run tms-backend run the following line on the root folder of the project:
./gradlew tms-backend:bootRunWe need to run the frontend now.
To configure tms-frontend replace the following line in tms-frontend/src/main/resources/application.properties with:
tms-backend-api-address=http://localhost:9090We can see that the backend is exposing the REST API on port:9090 to avoid any port conflicts.
To run tms-frontend run the following line on the root folder of the project:
./gradlew tms-frontend:bootRunThat is all, everything should be up and running.
Before going to the web interface we need to mention some useful links on the backend side.
REST API documentation is autogenerated here: http://localhost:9090/swagger-ui/index.html
OpenAPI is autogenerated here: http://localhost:9090/api-docs
If you ran the project using docker compose there a free MongoDB client named Mongo Express here: http://localhost:9091/ with credentials admin:pass
Here we can see the backend is generating some test data via application.properties with generate-test-data=true

Web interface can be accessed here: http://localhost:8080/
Validation of create/edit task is done client side via JS

This project was done very simple and serves as a template for a quick 3 tier setup using spring boot.
It is not ready for production by any means as this iteration is missing some important features like:
- enabling https on both applications
- changing the REST endpoints name to include versioning as "v1"
- enabling spring security on both applications
- adding a login page
- adding pagination and sorting
Note
The following ports need to be free on your machine for the application to work: 8080, 9090, 9091, 27017
Tip
I case you have older JDK version than JDK 17 and you are using IntelliJIDEA as IDE make sure Gradle JVM is set to JDK 17 in:
File | Settings | Build, Execution, Deployment | Build Tools | Gradle -> Gradle JVM
