- Make a copy of the application-development-sample.yaml named application-development.yaml
- Edit the application-development.yaml file so that the db_name, user, and passwords match your environment.
- Make a copy of the application-test-sample.yaml named application-test.yaml
- Edit the application-test.yaml file so that the db_name, user, and passwords match your environment.
NOTE: Be sure that that empty database schema is created prior to running. Flyway migrations will not create MySQL databases.
Example:
CREATE DATABASE dbname
CHARACTER SET utf8
COLLATE utf8_general_ci;
To create a backup of the MySQL database, run:
mysqldump --complete-insert --lock-all-tables --extended-insert=false --default-character-set=utf8 -uxxUSERxx -pxxPASSxx dbname | gzip -9 > dbname.sql.gz
- To clean: mvn clean
- To build: mvn package -Dspring.profiles.active=test
- To run: mvn spring-boot:run -Dspring-boot.run.profiles=development (app runs at http://localhost:8080/)
- To run unit tests: mvn test -Dspring.profiles.active=test
Note: You must be logged before accessing any actuator endpoints.
See here for a full list of actuator endpoints.
To access Swagger documentation, while running the app go to http://localhost:8080/swagger-ui.html
- To deploy, run:
sudo java -Dspring.profiles.active=production -jar ./target/poc-0.0.1-SNAPSHOT.jar &
- Add Docker.
- Finish adding better error handling.
- Update readme to provide better overview of how code works.
- Add in-line comments to provide clear understanding of functionality.
- Add ModelMapper DTO (https://www.baeldung.com/entity-to-and-from-dto-for-a-java-spring-application)