This repository contains the backend microservice for managing activities (such as tasks, calendar events, etc.) in the Digi-Dojo project.
The first version of this microservice can be found here.
The architecture is built on Java using Spring Boot. It follows a hybrid architecture, handling both sync and async requests.
- The synchronous requests are based on Spring Boot Rest Controller.
- The asynchronous requests are based on Apache Kafka.
The package structure is divided mainly into application and domain, following a clean architecture approach.
- Java 17 or higher
- Gradle
- Docker
- Docker Compose
- Clone the repository of the shared model:
git clone git@github.com:Digi-Dojo/DigiDojoSharedModel.git
cd DigiDojoSharedModel
-
(Optional) Follow the instructions in the package's
README.md
file to build it. -
Clone the repository:
git clone git@github.com:Digi-Dojo/ActivityPlannerService.git
cd ActivityPlannerService
-
Create a
.env
file based on.env.sample
file sample to configure connections -
Build and run your containers:
docker-compose build
docker-compose up
The server will be running on localhost:8100
.
- When you are done, drop the containers:
docker-compose down
To run tests, execute the following command in the project root:
gradle test
This will run all test classes in the src/test/java
directory.
If you don't want to run the server in a docker container, you can:
-
Export the
.env
file runningexport $(cat .env | xargs) && export DB_PORT=3333 && export DB_HOST=localhost
in the root folder. -
Run the docker container related to the database:
docker-compose up aps_postgres
- Build the project:
gradle clean build
- Run the server:
gradle bootRun
- After closing the server, turn off the database:
docker-compose down