- Depending on your IDE, install Java dependencies in
/api
-
Run
docker-compose up
to start the postgreSQL server -
Depending on your IDE, start the Cheese API server in
/api
-
Go to the
README.md
file in/app
for instructions on setting up the frontend
To view Swagger UI, start the API server and go to http://localhost:8080/swagger-ui/index.html
.
To view the raw openapi JSON, go to http://localhost:8080/v3/api-docs
Database migrations are performed using flyway, they are automatically applied to the database when running the application.
Inside com.cheese.api
create a new SQL file in resources/db/migration
.
The convention for the file name is VX__the_description.sql
, where X
equals the version number.
When naming columns and tables, the column name price_per_kilo
will map to pricePerKilo
in the ORM.
For example, the following table:
@Entity(name="cheese")
public class Cheese {
private Integer pricePerKilo;
}
Requires a migration:
CREATE TABLE IF NOT EXISTS cheese (
price_per_kilo INTEGER NOT NULL,
);