Source code | https://github.com/DiamondLightSource/scaup-backend |
Sample Consignment, Administration and User Parametrisation backend
The API supports a configuration file, that follows the example set in config.json
, but most importantly, two environment variables need to be set:
SQL_DATABASE_URL
: The URL for the databaseCONFIG_PATH
: Path for the configuration fileSCAUP_PRIVATE_KEY
: Private key for encoding JWTsSCAUP_PUBLIC_KEY
: Public key for decoding JWTsSCAUP_EXPEYE_TOKEN
: Token for making requests to Expeye. Useful for machine users.
Running development server on your machine:
- Install the package with
pip install .
orpip install -e .
- Set the SQL_DATABASE_URL environment variable according to your database's location
- Run
uvicorn
with uvicorn scaup.main:app --reload --port 8000
Note: Due to Postgres specific features being used, the target database must be Postgres. An example can be found in the database folder.
- Build the database Docker image in database with
podman build . -t diamond-ispyb
- Run with
podman run -p 3306:3306 --detach --name diamond-ispyb localhost/diamond-ispyb
- You may change the port or where the container itself runs, just remember to update .test.env
- Run with
- Run
pytest tests