New (2022) accrediation backend for AGEPoly
sudo su postgres
to impersonate the admin user of PostgreSQLcreateuser -W whiskey
to create a user named whiskey for our server, type whiskey
as in the password promptcreatedb -O whiskey whiskey
to create a user named whiskey for our server, -O to set it as the owner of the dbrustup
cargo b|c|r
(one of b=build, c=check, r=run). This will download and compile the dependencies. There will be some errors because SQLx is unable to use the database at the moment to compile-check the queries.cargo install sqlx-cli
sqlx migrate run --database-url postgres://whiskey:whiskey@localhost/whiskey
to run the migrations on the server. This is required if you want to fully compile. Notice the URL parameter. When compiling with the IDE, provide the URL as an env variable DATABASE_URL.clear && DATABASE_URL="postgres://whiskey:whiskey@localhost/whiskey" cargo c
to check if the errors are gonecargo sqlx prepare --database-url postgres://whiskey:whiskey@localhost/whiskey
Files and folders related to deployment:
This project (whiskey-api) is related to its frontend (whiskey-app) but at this time of writing the frontend is provided programmatically by the backend and doesn't require any intervention at the infrastructure level.
Whiskey's backend requires the deployment of:
sqlx-cli
.The backend itself is provided as a Docker image hosted on Gitlab built with the Dockerfile.
Order of execution when a push to main occurs :
Click here for the interactive database model
DATABASE_URL=postgres://$(DB_USER):$(DB_PASSWORD)@$(DB_HOST):$(DB_PORT)/$(DB_NAME)
is the DSN required by SQLx for the database connection. It is computed from the env variables provided by the infrastructure (Helm Chart agepoly-deployment).ROCKET_PORT=4000
HYDRA_ADMIN_ENDPOINT
is the endpoint (up to the http port number) of the Hydra Admin API.ROCKET_LOG_LEVEL
ROCKET_ADDRESS=0.0.0.0
the listening address for Rocket (0.0.0.0
is the wildcard)