Skip to content

Sample reactive application using Angular, Spring Boot, Spring Webflux and MongoDB. It also demonstrates the Change Streams feature of MongoDB.

License

Notifications You must be signed in to change notification settings

pictet-technologies-open-source/reactive-todo-list

Repository files navigation

CircleCI CodeFactor License: MIT

Made with Love by Pictet Technologies LinkedIn

Medium

Reactive Todo List

This project aims to explain how to build a fully reactive web application with Spring Boot, Spring WebFlux, Angular and MongoDB. It demonstrates how to deal with concurrent modifications using optimistic locking, Change Streams and Server Sent Events.

Project structure

Folder Description
docker Contains the docker-compose.yml used to setup the application
todo-list-application Spring boot application (back-end)
todo-list-ui Angular application (front-end)

Local environment

Build the application

In order to build the application you need to have the following softwares installed:

  • open JDK or oracle JDK >= 8
  • docker & docker compose
  • npm
$ build.sh

Start the application

$ start.sh

Once the application is started you can access it using the following links :

Name Link
UI http://localhost:8080
Swagger UI http://localhost:8080/swagger-ui/#/item-controller
Mongo Express http://0.0.0.0:8081/

If you only want to start mongoDb, execute the following command

$ start.sh -mongo-only

Stop the application

$ stop.sh

Production environment

Build the application

You need to have docker installed to build the application.

Ensure that the URL of the application has been correctly configured in the following file.

todo-list-ui/src/app/environments/environment.prod.ts

Then build the application in production mode. To do so, go the the root folder and execute the following command.

$ mvnw clean install -Pprod

Deploy the application to Heroku

You need to have the Heroku client installed to deploy the application (see Heroku client)

After having built the application in production mode, follow these steps:

Go the the todo-list-application folder
$ cd todo-list-application
Log in to heroku
$ heroku login
Log in to Continer registry
$ heroku container:login
Push your Docker-based app
$ heroku container:push web -a application_name_in_heroku
Deploy the changes
$ heroku container:release web -a application_name_in_heroku