Skip to content

About

Backend server-side code for the orphaned wells UI

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Repository files navigation

orphaned-wells-ui-server

Backend server-side code for the orphaned wells UI

Backend infrastructure automation and the approval-gated deployment rollout are documented in Terraform CI. Cloud plan/apply is disabled until ENABLE_TERRAFORM_CI=true; phase one retains the existing deployment key. Terraform PRs, including forks, run formatting and validation without cloud credentials or remote state. Live plans run from reviewed main; plans with changes require separate terraform-apply approval. Verified no-change plans finish automatically without applying. Manual Terraform plan/apply remains supported in the deployment guide. Existing installations should follow the PR workflow migration.

Getting started (developer)

Prerequisites

The following steps assume that:

  1. conda is already installed and configured

1. Creating the Conda environment

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-env

This 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 .

For Developers:

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.txt

2. Add credential/environment files

Credentials are necessary for MongoDB, Google Cloud Storage uploads, and Google Document AI processing.

Create the backend environment file from the template:

cp ogrre/.env.example ogrre/.env

Fill in the required values described in ogrre/.env.example.

For Google-backed non-Docker local development, place these local service-account JSON keys in ogrre/, or use absolute paths in .env:

  1. storage-service-key.json
    • Storage runtime service account.
    • Used only for Google Cloud Storage upload bucket reads, writes, deletes, and signed/download URL interactions.
    • STORAGE_SERVICE_KEY in .env must point to this file.
  2. document-ai-service-key.json
    • Document AI runtime service account.
    • Used for online/batch Document AI processing and processor deployment/undeployment from the app.
    • DOCUMENT_AI_SERVICE_KEY in .env must point to this file.

Do not use the deployment/Terraform service-account key for local app runtime. That identity is for infrastructure changes and Kubernetes/App Engine deployment automation.

Running the server

Ensure that the uow-server-env Conda environment is active

conda activate uow-server-env

Start server on port 8001

cd <orphaned-wells-ui-server-path>
uvicorn ogrre.main:app --reload --host 127.0.0.1 --port 8001

For Docker-based local development, place the same two runtime key files at deployment/secrets/storage-service-key.json and deployment/secrets/document-ai-service-key.json, then run the backend container:

cd <orphaned-wells-ui-server-path>/deployment
docker compose --env-file ../ogrre/.env up web

Documentation

About

Backend server-side code for the orphaned wells UI

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages