Skip to content

DiamondLightSource/scaup-backend

Repository files navigation

Scaup API

Code CI Apache License

Source code https://github.com/DiamondLightSource/scaup-backend

Sample Consignment, Administration and User Parametrisation backend

Configuration

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 database
  • CONFIG_PATH: Path for the configuration file
  • SCAUP_PRIVATE_KEY: Private key for encoding JWTs
  • SCAUP_PUBLIC_KEY: Public key for decoding JWTs
  • SCAUP_EXPEYE_TOKEN: Token for making requests to Expeye. Useful for machine users.

Deployment

Running development server on your machine:

  1. Install the package with pip install . or pip install -e .
  2. Set the SQL_DATABASE_URL environment variable according to your database's location
  3. 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.

Testing

  • 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 pytest tests

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors 2

  •  
  •  

Languages