General Information Service is a FastAPI-based backend service that acts as a middle-layer API adapter between OpenGIN (Open General Information Network) backend and the OpenGINXplore frontend application.
The service is responsible for communicating with OpenGIN APIs, processing and aggregating the retrieved government information, and exposing frontend-friendly endpoints tailored to OpenGINXplore’s data needs. It abstracts the complexity of OpenGIN’s data structures and delivers well-structured, optimized responses for visualization and exploration.
flowchart LR
FE["Frontend<br/>(OpenGINXplore)"]
API["GI-Service<br/>(API Adapter / BFF)"]
CORE["OpenGIN<br/>(Core Data Platform)"]
FE <-->| REST | API
API <-->| Query APIs | CORE
%% Base styles
classDef blue fill:#E3F2FD,stroke:#1565C0,stroke-width:1px,color:#0D47A1
classDef green fill:#C8E6C9,stroke:#1B5E20,stroke-width:3px,color:#0B3D0B
class FE blue
class CORE blue
class API green
| Feature | Description |
|---|---|
| Active Ministries by Date | Provides an API to retrieve the list of ministries that were active on a given date, enabling time-aware views of government structures. |
| Active Departments by Ministry | Exposes endpoints to fetch departments active under a specific ministry for a given date, ensuring historically accurate organizational data. |
| Latest Dataset Access | Supplies various types of datasets (tabular) for the most recent available years, optimized for frontend consumption. |
| Prime Minister & Minister Details | Retrieves active Prime Minister details along with assigned ministers for a specified date, including portfolio associations. |
| Backend for Frontend (BFF) APIs | Acts as a dedicated BFF layer for the frontend, orchestrating parallel API calls to upstream services and returning frontend-ready responses. |
- Python 3.8 to 3.13
- pip (Python package installer)
- Git
Clone the Repository
git clone https://github.com/LDFLK/GI-SERVICE.git
cd GI-SERVICE-
Create Virtual Environment
# Create virtual environment python -m venv .venv # Activate virtual environment # On Windows: .venv\Scripts\activate # On macOS/Linux: source .venv/bin/activate
-
Install Dependencies
pip install -r requirements.txt
-
Environment Configuration
Create a
.envfile in the root directory:# Base URLs for Read(Query) services in OpenGIN BASE_URL_QUERY=http://0.0.0.0:8081
-
Run the Application
# Development server uvicorn main:app --reload --host 0.0.0.0 --port 8000The API will be available at:
http://localhost:8000
# Make sure docker daemon running
# Up containers
docker compose up
# Build & Up containers
docker compose up --buildOnce the server is running, you can access:
- Interactive API Docs:
http://localhost:8000/docs(Swagger UI) - Alternative Docs:
http://localhost:8000/redoc(ReDoc)
- Organization Contract: See Contract
- Data Contract: See Contract
| Variable | Description | Default |
|---|---|---|
BASE_URL_QUERY |
Query(Read) OpenGIN service URL | http://0.0.0.0:8081 |
Please see our Contributing.
Please see our Code of Conduct.
Please see our Security Policy.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.