Dispatch Controller simulates a drone based medicine logistics management system. Clients can connect to the system and carry out necessary actions through the RESTful API provided by the dispatch-controller-service
.
The application's top-level component diagram is shown below.
Following functional areas will be covered during the implementation of this project:
- RESTful API development using Spring Boot.
- Spring Boot validations.
- Spring Boot database connectivity (via JDBC).
- Running a periodic task using Spring Scheduling.
- Spring Boot testing.
An H2 in-memory database is utilized in this project to streamline the development process. The proposed structure of the database for the application is shown in the following ER diagram.
Project also contains a Postman collection which can be used to test the API.
- OpenJDK 17+
- Maven 3.8.5.+
Execute the following command to build the application.
mvn clean install
Maven usually runs tests when we build the project. But, to run the tests separately, execute the following command.
mvn clean test
Once you build the project execute the following command to run the app locally.
java -jar dispatch-controller-service/target/dispatch-controller-service-0.0.1-SNAPSHOT.jar
To build the docker container, execute the following command.
mvn compile jib:dockerBuild
To run the docker container, execute the following command.
docker run -p 9000:9000 -t -d dispatch-controller-service:0.0.1-SNAPSHOT