All steps mentioned here have to be executed in the backend/ folder.
- Rename
.env.sampleto.envand enter the data according to your setup.
DATABASE_URLis the Connection URI to your PostgreSQL databaseBIND_ADDRESS_HOSTdefines the host on which the server will run onBIND_ADDRESS_PORTdefines the port on which the server will run onAUTH_DISCOVERY_URIthe .well-known endpoint of the auth server (see RFC 8414 for more detail)AUTH_CLIENT_IDthe client id the frontend should use to log inRUST_LOGused to set the logging config for env_logger
To install an extension, a user needs to be a 'superuser',
The user 'permaplant' doesn't have the required permissions to create the 'postgis' extension.
Set it up using the postgres user.
Ensure that you grant the necessary permissions for the user to use Postgres.
One way to do this, is by using the following command:
sudo -u postgres psql
CREATE USER permaplant WITH CREATEDB PASSWORD 'permaplant';
ALTER USER permaplant WITH SUPERUSER;- Install
To install dependencies.
make install- migration
To update the database.
make migration- build
make build- Start Keycloak
You can do one of the following two steps, the first one being the simpler one, but with less configuration options.
- To use the preconfigured Keycloak instance simply copy the newest version of
.env.sampleto.env - To use the local Keycloak variant follow the steps in Keycloak Setup
You then also have to change following two env variables in.envAUTH_DISCOVERY_URI=http://localhost:8081/realms/PermaplanT/.well-known/openid-configurationAUTH_CLIENT_ID=PermaplanT
- run
To start the server
make runGo to http://localhost:8080/doc/api/swagger/ui/.
Now follow the steps described in the API documentation page.
You can find other ways to make requests by following How to obtain access tokens.