For the complete documentation index, see llms.txt. This page is also available as Markdown.

Staff Portal API

Developers can set up and run the OpenG2P Registry Staff Portal API on their local machines. This guide outlines the steps to install it on a Linux-based laptop or desktop.

Prerequisites

  • Python3

  • Git

  • PostgreSQL

Installation of Staff Portal API

1. Update system packages

Log in to your Linux server using SSH and update the package list and upgrade the existing packages:

sudo apt update
sudo apt upgrade -y

2. Install dependencies

sudo apt install -y python3-pip python3-dev python3-venv build-essential libpq-dev

3. Install and configure PostgreSQL

The Registry uses PostgreSQL as the database engine. Install PostgreSQL (if not already installed) and create a new database user and database.

sudo apt install -y postgresql
sudo su - postgres
psql
CREATE ROLE registryuser WITH LOGIN NOSUPERUSER CREATEDB CREATEROLE INHERIT REPLICATION CONNECTION LIMIT -1 PASSWORD 'password';
CREATE DATABASE registrydb WITH OWNER = registryuser CONNECTION LIMIT = -1;
exit
exit

4. Clone the Registry APIs Repository

5. Install Python Libraries and Run the API

  • Create a new Python virtual environment:

  • Activate the virtual environment:

  • Install required Python packages:

  • Create a .env file:

  • Run the API server:

Verifying the Installation

Open the OpenAPI docs in your browser at http://127.0.0.1:8002/docs.

Last updated

Was this helpful?