SPAR Self Service API
This page provides comprehensive documentation for the installation of SPAR Self Service API, a service designed for data mapping within the Social Payments Account and Registry (SPAR) system.
Installation
Prerequisites
Any machine running Linux (e.g., Ubuntu), macOS, or Windows
Python3.10 or later
Git
PostgreSQL
virtualenv
eSignet: Ensure that eSignet is properly configured. Refer to the eSignet Deployment Guide for setup instructions.
SPAR Mapper API Configuration: Ensure that the SPAR Mapper API is properly configured according to the SPAR Mapper API Installation.
Python dependencies
The following dependencies are managed in the installation steps below.
Steps to install
Install from source
Clone the repository.
Navigate to the project root.
Create a virtual environment with Python 3.
Activate the virtual environment.
Install the necessary dependencies.
Configure database credentials and other environment variables in the .env file.
Run migrations to set up the database.
Seeding the database (optional)
This will seed the database with default values. Make sure to update the eSignet configuration in the DB as per your installation.
PostgreSQL DB Setup
Create a new role/user called sparuser and create a new database called spardb, with sparuser as the owner. No need to run this step, if Postgres was installed through OpenG2P's deployment script.
Then run the script.
The following optional Env vars can also be passed.
Quick start
Start the development server.
Access Swagger API Documentation.
Configuration
Environment variables
Set the following environment variables to configure the spar-mapper-api.
Authentication
The spar-self-service-api
supports authentication via eSignet. Refer to the deployment documentation for eSignet here for setup instructions.
Setting up redirection
To integrate the SPAR Self-Service UI with any login provider, you need to add the redirect_uri
in the authorization_parameter column.
This URL needs to be updated in the
login_providers
table, specifically in theauthorization_parameters
column for the eSignet record.Make sure to replace
selfservice.qa.openg2p.net
with the appropriate domain that matches your eSignet configuration.
Testing
Run the unit tests with pytest.
Contributing
Contribution guidelines are available here.
Last updated