Cooking App is a microservice based application to serve as a household database of recipes. This repository is the RESTful backend component, which is planned to serve to the database Admin GUI and (in the future) the client apps (for listing and search recipes).
This application is written on Java 8 and uses Spring Boot, Hibernate. The build automation is handled by Maven. The database migrations are managed by means of Liquibase.
This backend has a fully-functional frontend GUI application: Cooking App Admin. The complete fully-containerized build can be found here.
Use this Cooking App Containerized repository to run a fully-functional demo in 1 click. The present API backend app is one of the containers there.
First build the app with maven:
mvn package
then launch the jar artifact:
java -jar ./app/target/cooking-app-api-1.0.0.jar --spring.config.location=/path/to/env.properties --spring.profiles.active=production
The env.properties (you are free to use any file name) file contains the settings like database credentials, etc. You may find details below.
docker create --name cooking-api-endpoint --link mysql -p 8800:8800 vintagedreamer/cooking-api-endpoint:latest
docker cp /path/to/db.properties cooking-api-endpoint:/app/configuration/db.properties
docker start cooking-api-endpoint
This is the mininum list of required parameters (with sample values) you should to provide to the application:
db.driverClassName=com.mysql.jdbc.Driver
hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
db.url=jdbc:mysql://dbhost:3306/cooking?characterEncoding=UTF-8&autoReconnect=true&useSSL=false
db.username=db_user
db.password=db_pass
spring.cors.origins=*
hibernate.hbm2ddl.auto=validate
This sample can also be found in the env.properties.dist file supplied with this repository.
The app contains built-in Swagger - a very handy tool for testing and documenting the API.
- Swagger UI: http://localhost:8800/swagger-ui.html
- Swagger 2.0 API documentation: http://localhost:8800/v2/api-docs
The database is designed with perspective. Not all the entities are maintained by application yet. Use Swagger UI (see above) to see the list of available endpoints.
This application is developed by Alexander Palamachuk.