Skip to main content

Install OGRRE on your computer

In addition to the frontend and backend code, OGRRE relies on a Mongo database and Google Cloud Platform. Before attempting to run OGRRE, follow the previous setup tutorials to learn how to set up MongoDB and configure GCP.

Install frontend

1. Clone Repository

Clone the frontend repository (https://github.com/CATALOG-Historic-Records/orphaned-wells-ui) and navigate to the root of the repository.

2. Install Javascript dependencies

Prerequisites: Node Package Manager (npm). See https://www.npmjs.com/.

cd <orphaned-wells-ui-path>
npm clean-install

3. Set required environment variables.

The frontend relies on a set of environment variables to determine which backend to connect to, which google client to use, and more. The following variables should be defined in a file called .env at the root of the frontend project.

  • REACT_APP_BACKEND_URL: The backend URL to connect to. If running the backend locally, this is likely going to be "http://localhost:8001". If running from a server with a dedicated IP/URL, use the proper address here.
  • REACT_APP_GOOGLE_CLIENTID: The Google Client ID that is provided when using Google's OAuth service. This is necessary for frontend authentication. For more information, see the GCP section on OAuth.

4. Run UI in browser

cd <orphaned-wells-ui-path>
npm start

Install backend

1. Clone Repository

Clone the frontend repository (https://github.com/CATALOG-Historic-Records/orphaned-wells-ui-server) and navigate to the root of the repository.

2. Create conda environment and install Python dependencies.

Prerequisites: Python and conda. For more information on these see the Python and anaconda webpages.

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 .

3. Set required environment variables.

The backend relies on a set of environment variables to determine which database to connect to, which google cloud project to use, and more. The following variables should be defined in a file called .env inside app/internal.

  • ENVIRONMENT: The project or collaborator that this instance is designed for. Each collaborator has their own set of trained processors, and OGRRE uses this variable to determine which processors to look for. For example, "isgs".
  • LOCATION: The Google Cloud location. For example: "us".
  • DB_USERNAME: MongoDB database username. For more information, see the section on creating a MongoDB database user.
  • DB_PASSWORD: MongoDB database user password. For more information, section on creating a MongoDB database user.
  • DB_CONNECTION: MongoDB database connection string. For more information, see the section on connecting to a MongoDB instance.
  • DB_NAME: MongoDB database name.
  • STORAGE_BUCKET_NAME: Google Cloud storage buckent name to store document files in.
  • PROJECT_ID: Google Cloud project ID.
  • STORAGE_SERVICE_KEY: The name of the file storing the Google Cloud connection credentials. For more information, see the section on creating a GCP service account.
  • token_uri: The endpoint URL where an application requests and receives access tokens. This is necessary for user authentication. For more information, see the GCP section on OAuth.
  • client_id: The Google Client ID that is provided when using Google's OAuth service. This is necessary for user authentication. For more information, see the GCP section on OAuth.
  • client_secret: The Google Client secret that is provided when using Google's OAuth service. This is necessary for user authentication. For more information, see the GCP section on OAuth.

4. Start the backend 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>/app && uvicorn main:app --reload --host 127.0.0.1 --port 8001