Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/PDNMX/s1_backend/llms.txt

Use this file to discover all available pages before exploring further.

This guide walks you through everything needed to run S1 Backend on your local machine and issue your first successful API calls. By the end you will have the Express server running, the provider registry configured, and a working GET / health-check response in your terminal.
1

Clone the repository

Clone the S1 Backend source from GitHub and enter the project directory:
git clone https://github.com/PDNMX/s1_backend.git
cd s1_backend
2

Install dependencies

Install all Node.js dependencies listed in package.json. Use whichever package manager you prefer:
yarn install
The key runtime packages installed are: express, axios, cors, log4js, dotenv, and qs.
3

Create configuration files

S1 Backend requires two configuration files at the project root. Neither is committed to version control, so you must create them from the provided examples.Create .env
cp .env.example .env
The default .env file contains:
.env
PORT=3101
You can change PORT to any available port. If the variable is absent the server defaults to port 3000.
Create endpoints.json
cp endpoints.json.example endpoints.json
The example file ships with one placeholder provider entry:
endpoints.json
[
  {
    "supplier_id": "EDOMEX",
    "supplier_name": "Secretaría Ejecutiva del Sistema Estatal Anticorrupción del Estado México",
    "system_id": 1,
    "type": "REST",
    "levels": [
      "estatal"
    ],
    "url": "",
    "entities_url": "",
    "token_url": "",
    "username": "",
    "password": "",
    "client_id": "",
    "client_secret": ""
  }
]
Each object in the array represents one federated data provider. See the Configuration guide for a full description of every field.
The GET / and GET /v1/providers endpoints work immediately with an empty credentials set. However, /v1/summary and /v1/search will not return live data until you fill in real OAuth 2.0 credentials and API URLs for at least one provider.
4

Start the server

Choose between production mode (plain Node.js) and development mode (auto-reload with nodemon):
yarn start
Both commands launch bin/www, which reads PORT from your .env file. The process starts silently — there is no startup banner. Once the server is ready it listens for incoming connections on the configured port.The server listens on http://localhost:3101 (or whichever port you set). If no PORT is defined in .env, it falls back to http://localhost:3000.
5

Make your first API call

With the server running, open a second terminal and verify the gateway is live:Health check — GET /
curl http://localhost:3101/
Expected response:
{
  "title": "API del Sistema 1",
  "version": "1.0"
}
List registered providers — GET /v1/providers
curl http://localhost:3101/v1/providers
Expected response (with the example endpoints.json):
[
  {
    "supplier_id": "EDOMEX",
    "supplier_name": "Secretaría Ejecutiva del Sistema Estatal Anticorrupción del Estado México",
    "levels": ["estatal"]
  }
]
The status field is read from each provider’s entry in endpoints.json. Because the example file does not include a status value, the field is omitted from the serialized JSON response.
Fill in the url, token_url, username, password, client_id, and client_secret fields in endpoints.json with real provider details before calling /v1/summary or /v1/search. See the Configuration guide for the full field reference.

Next Steps

Configuration

Learn every endpoints.json field and how OAuth 2.0 token acquisition works.

API Reference

Explore the request and response schemas for /v1/summary and /v1/search.

Build docs developers (and LLMs) love