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.

S1 Backend uses dotenv to load environment variables from a .env file at startup. Only one environment variable is required to run the server; all provider OAuth credentials are stored separately in endpoints.json and are never placed in .env. This separation keeps sensitive credentials out of process environment listings while still allowing easy per-environment configuration.

Supported Variables

PORT
number
default:"3000"
The TCP port the HTTP server listens on. Defined in bin/www as process.env.PORT || '3000'. The provided .env.example sets this to 3101, which is the conventional port used across the PDN DEMOS deployment.

Setting Up .env

1

Copy the example file

The repository ships a .env.example that contains every supported variable with safe default values. Copy it to create your local configuration file:
cp .env.example .env
2

Edit the values

Open .env in your editor and adjust the port if needed:
.env
PORT=3101
Save the file. dotenv will load it automatically the next time the server starts.
Both .env and endpoints.json are listed in .gitignore and must never be committed to version control. They contain deployment-specific settings and, in the case of endpoints.json, sensitive OAuth credentials. Committing either file risks exposing credentials in your repository history.

Docker and Environment Variables

When running S1 Backend with Docker Compose, the ${PORT} placeholder in docker-compose.yml is resolved from the shell environment or a .env file located next to docker-compose.yml at Docker Compose runtime — not from the .env file inside the project that dotenv reads at Node.js startup.
docker-compose.yml (port mapping excerpt)
ports:
  - ${PORT}:${PORT}
Both the host-side and container-side ports use the same variable, so the mapping is always symmetric. You can supply the value in either of two ways:
PORT=3101 docker-compose up -d
Docker Compose automatically reads a .env file from the directory where docker-compose.yml lives, so placing PORT=3101 there means you do not need to prefix every docker-compose command with the variable.
The same .env file that Docker Compose reads for variable substitution is also picked up by dotenv inside the Node.js process when the container starts, because bin/www calls require('dotenv').config() unconditionally. A single .env file therefore configures both layers.

Provider Credentials

OAuth credentials for each PDN data provider — including username, password, client_id, client_secret, and token_url — are stored in endpoints.json, not in .env. Keeping credentials out of environment variables prevents them from appearing in process listings, Docker inspect output, or CI logs. See Configuration for the full endpoints.json schema, including all required fields and an annotated example.
In production environments, consider storing endpoints.json using a secrets manager (such as AWS Secrets Manager, HashiCorp Vault, or Azure Key Vault) or Docker secrets, and injecting the file into the container at runtime rather than baking it into the image. This ensures credentials are rotatable without rebuilding the Docker image and are never stored on disk unencrypted.

Build docs developers (and LLMs) love