https://github.com/ayeshlk/dispatch-controller
Drone dispatch controller sample application showcasing spring-boot capabilities for RESTful API development
https://github.com/ayeshlk/dispatch-controller
h2-database lombok rest-api spring-boot spring-boot-jdbc spring-boot-validation spring-hateoas
Last synced: 12 months ago
JSON representation
Drone dispatch controller sample application showcasing spring-boot capabilities for RESTful API development
- Host: GitHub
- URL: https://github.com/ayeshlk/dispatch-controller
- Owner: ayeshLK
- License: apache-2.0
- Created: 2023-04-04T18:42:13.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-06-29T19:33:07.000Z (about 3 years ago)
- Last Synced: 2025-06-19T05:27:36.137Z (about 1 year ago)
- Topics: h2-database, lombok, rest-api, spring-boot, spring-boot-jdbc, spring-boot-validation, spring-hateoas
- Language: Java
- Homepage:
- Size: 169 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Dispatch Controller
[](https://github.com/ayeshLK/dispatch-controller/actions/workflows/daily-build.yml)
[](https://github.com/ayeshLK/dispatch-controller/actions/workflows/trivy-scan.yml)
*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:
1. RESTful API development using Spring Boot.
2. Spring Boot validations.
3. Spring Boot database connectivity (via JDBC).
4. Running a periodic task using Spring Scheduling.
5. 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](_docs/dispatch-controller.postman_collection.json) which can be used to test the API.
## Prerequisites
- OpenJDK 17+
- Maven 3.8.5.+
## Build, Test, and Run ##
### Build Application ###
Execute the following command to build the application.
```shell
mvn clean install
```
### Test Application ###
Maven usually runs tests when we build the project. But, to run the tests separately, execute the following command.
```shell
mvn clean test
```
### Run Application ###
#### Run Locally ####
Once you build the project execute the following command to run the app locally.
```shell
java -jar dispatch-controller-service/target/dispatch-controller-service-0.0.1-SNAPSHOT.jar
```
#### Run a Docker Container ####
To build the docker container, execute the following command.
```shell
mvn compile jib:dockerBuild
```
To run the docker container, execute the following command.
```shell
docker run -p 9000:9000 -t -d dispatch-controller-service:0.0.1-SNAPSHOT
```