Setup
All steps mentioned here have to be executed in the backend/ folder.
Setup
- 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_HOSTdefines the host on which the auth server is running onAUTH_CLIENT_IDthe client id the frontend should use to log inKEYCLOAK_CLIENT_IDthe client id the server uses to communicate with keycloak (needs to be configured in keycloak)KEYCLOAK_CLIENT_SECRETthe client secret the server uses to communicate with keycloak (needs to be configured in keycloak)RUST_LOGused to set the logging config for env_loggerMODEModes the backend can be run in. See doc/tests/mode.md.
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;
Access-Control
To enable/disable the feature "access_control" add or remove the following line from /backend/Cargo.toml
default = ["access_control"]
Note: The feature "access_control" must be enabled if MODE=production is set.
- Install
To install dependencies.
make install
- migration
To update the database.
make migrations
- build
make build
- Start Keycloak
To use the preconfigured Keycloak instance simply copy the newest version of .env.sample to .env
- run
To start the server
make run
Test server using Swagger
Go 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.