This page is based on a tutorial by the famous Chad the Tutor. To make it run please execute the following steps:
- Install maven
- Clone the repository
- Run maven install
mvn install
- Execute the steps to set up the Postgres DB
- Go to the folder
gravel
and run the commandmvn spring-boot:run
First Install postgresql and check installation from your console with the command psql --version
(keep your password in mind).
- Log in as
postgres
user withpsql -U postgres
and create a database withCREATE DATABASE <db-name>;
- Create a new role with limited permissions for spring boot with
CREATE ROLE <role-name> WITH PASSWORD '<password>';
- Give log in permissions to the new role with
ALTER ROLE <role-name> WITH LOGIN;
- Grant privileges to new role with
GRANT CREATE, DROP ON DATABASE <db-name> TO <role-name>;
- Update the SQL scripts to match your requirements
To set up all the tables for this application it is recommended to use the scripts in numeric order.
- You can open a CLI and navigate to the repo folder to execute
psql -U postgres -f .\01_setup-data.sql
- If the data script was successful you can execute
psql -U postgres -f .\02_setup-security.sql
Either you can use the embedded version of maven running .\gravel\mvnw.cmd spring-boot:run
or you can install maven, go to the gravel
directory and run mvn spring-boot:run
.