By following the next steps you would have a running Spring Boot application, which is able to respond to requests
from ./Rest/Dispatch.rest
, and maintain its data in containerized Postgres ./Pods/PostgreSQL
- A very simple
Basic
authentication using InMemory UserDetailsService, a JWS token could be implemented or SSO via Keycloak. - Basic
ControllerAdvices
along with fewCustomExceptions
. Seeders
read fromclasspath
Json files; A robust generator usingEasyRandom
would be better, and would facilitate JUnit.classpath
Json files should be filtered based on profiles (Ex. Production) usingmaven-resources-plugin
application-prod.yml
andlog4j2.xml
should be externalized.- Username & Passwords should be sourced either provided by environment variables, or from
Spring Cloud Config
service, or at least encrypted inapplication.properties
usingJasypt
- Logs could be better viewed on
Zipkin
- .. etc.
Medication
images are implemented asStrings
which could be filled withBase64
encoded images, or URL. In case of URLs, aCDN
could be used instead of serving static resources.- Multiple
Medications
can be loaded to oneDrone
. However, AMedication
can only be loaded to oneDrone
Liquibase
orFlyway
should be used for database tracking and migrations.mapStruct
orOrika
should be used in Service & Facade layer to convert DAOs to DTOs
- Lombok
- Gson
- Apache Commons "Lang"
-
- Any JDK >= 17
-
- Spin up a Postgres container by running
docker-compose up --build
in./Pods/PostgreSQL
. - Build project by running
mvn clean package
command in theDrones
directory. - Launch project by running
mvn spring-boot:run
command in theDrones
directory.
- Spin up a Postgres container by running
-
- Development configurations could be changed via
application-dev.yml
. - Development profile is active by default.
- Development configurations could be changed via
-
- JDK
- In case of JIT; Any JDK >= 17
- In case of AOT; GraalVM 22.3
- JDK
-
- Configure your preferable DBMS via
application-prod.yml
- Build project by one of the following methods:
- Either by create JIT jar by running
mvn -Pprod clean package
command in theDrones
directory. - Or by creating AOT native image by running
mvn -Pnative native:compile
command in theDrones
directory.
- Either by create JIT jar by running
- Deploy the jar or the binary created by the previous step.
- Configure your preferable DBMS via
-
- Seeders only works in development mode.
- If
./Pods/PostgreSQL
is used, a volume must be added to persist data.
./Rest/Dispatch.rest
contains multiple examples, which covers task requirements.
SERVICE | PORT |
---|---|
Drones | 8080 (Dev), dynamic (Prod) |
Postgres | 5432 |