Backend server-side code for the orphaned wells UI
The following steps assume that:
condais already installed and configured
Run the following command to create and activate a new Conda environment named uow-server-env:
conda env create --file environment.yml && conda activate uow-server-envThis will install the correct runtime versions of the backend (Python) and the backend dependencies.
Alternatively, if you already have an environment that you would like to install the dependencies in,
activate your environment and run the command:
pip install .This section is for developers who plan to modify or contribute to the server's codebase. In the same environment where you installed the package, run the following command:
pip install -r requirements-dev.txtCredentials are necessary for backend functionality. This includes Google Cloud's document AI features, MongoDB database access, and Google Cloud Storage for storing documents/images. To access these functionalities, you must create the following credential files and place them in the < orphaned-wells-ui-server-path >/ogrre/internal/ directory:
- .env
- Must contain PROJECT_ID, LOCATION, PROCESSOR_ID, DB_USERNAME, DB_PASSWORD, STORAGE_SERVICE_KEY (3rd item on this list)
- creds.json
- Must contain GCP Storage Bucket credentials. To generate this file using gcloud api, see https://cloud.google.com/document-ai/docs/libraries#authentication.
- STORAGE_SERVICE_KEY file
- Name doesn't matter as long as it matches what you store in .env
- Must contain google cloud client credentials. See https://docs.gspread.org/en/latest/oauth2.html#for-bots-using-service-account.
conda activate uow-server-envcd <orphaned-wells-ui-server-path>/app && uvicorn main:app --reload --host 127.0.0.1 --port 8001