./mvnw clean packagewill compile the app, run the unit tests and produce an uber-jar in the target folder.
The following command will run a version of the application with a mongodb as a testcontainer. It will have sample entities created in the db, so that one can easily experiment with the api.
./mvnw spring-boot:test-runYou will need a running mongodb instance that you can spin up with docker-compose.
docker compose -f docker/docker-compose.yml up -dOnce mongodb is up, run the app itself. It will not have any data init. See the previous section for info on how to spin up the app with some data in it.
java -jar target/task-tracker-0.0.1-SNAPSHOT.jarYou may stop the instance once you're finished.
docker compose -f docker/docker-compose.yml downThe REST API covers CRUD operations of the user and task entities. For the task entity specifically, one can add an observer user by its id.
Get the list of all users and tasks
curl http://localhost:8080/api/v1/users
curl http://localhost:8080/api/v1/tasksReplace the task and user id in the following request to add an observer
curl -d '{"id":"3a704760-692a-47ca-96e3-973ca459b759"}' -H "Content-Type: application/json" \
-X POST http://localhost:8080/api/v1/tasks/886a3e58-e5c6-4e0b-ad41-e5fb91b2fa1e/observersThe app reads its configuration from the src/main/resources/application.yml file.
You may override any of the parameters from the command line using the -D flag.