This application demonstrates a simple Note application where a user can create, update, view, filter and delete notes. The application is built using Spring Boot framework and utilizes MongoDB as a database. The functionalities of the app are implemented as REST APIs.
The following APIs are available:
- List Notes:
GET /api/v1/notes
- Create Note:
POST /api/v1/notes
- Get Note:
GET /api/v1/notes/{noteId}
- Update Note:
PUT /api/v1/notes/{noteId}
- Delete Note:
DELETE /api/v1/notes/{noteId}
- Get Note Stats:
GET /api/v1/notes/{noteId}/stats
The application can be run in multiple ways.
docker compose build
docker compose up
Using the following commands three containers will be launched, one for the spring application (port 8080), one for the mongodb database (port 27017) and one for a mongoexpress (port 8081) service to inspect the database if needed. This is the simplest way to run the application as the application and its dependencies will be automatically started.
mvn clean spring-boot:build-image
Using the above command, a single container of the spring application will be created and can be launched alongside an existing mongodb container (should have the name notes-mongodb). It is important to note that both containers must share the same network to interact.
It is also possible to grab the latest SpringBoot docker container from the Github container repository using the following command
docker pull ghcr.io/ahmedts/notesapp:main
In this case the application can be run alongside a mongodb container (should have the name: notes-mongodb). It is important to note that both containers must share the same network to interact.