API-HUB reads configuration exclusively from environment variables — there are no config files with secrets checked into the repository. For local development, copyDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/VisualGraphxLLC/API-HUB/llms.txt
Use this file to discover all available pages before exploring further.
.env.example to .env at the repo root and populate it. For production deployments on ECS Fargate, inject the required variables from Secrets Manager via the task definition. The frontend reads a separate frontend/.env.local file for browser-accessible configuration.
Backend Variables
These variables are read by the FastAPI process at startup. Place them in.env at the repo root.
Required in Production
The following seven variables are enforced at boot time whenENVIRONMENT=production. The process will not start if any of them are missing or blank.
POSTGRES_URL
POSTGRES_URL
Type: String — asyncpg connection URLThe full connection string used by SQLAlchemy’s async engine. Must use the When running inside Docker Compose, replace Docker Compose sets this automatically for the
postgresql+asyncpg:// scheme.localhost with the service name postgres:api service using the POSTGRES_USER, POSTGRES_PASSWORD, and POSTGRES_DB values.SECRET_KEY
SECRET_KEY
Type: Fernet key (base64-encoded, 44 characters)Encrypts and decrypts
EncryptedJSON columns: suppliers.auth_config and customers.ops_auth_config. The EncryptedJSON SQLAlchemy type decorator in database.py applies AES-128 Fernet encryption transparently on every read and write.Generate a valid key:JWT_SECRET_KEY
JWT_SECRET_KEY
Type: String — any high-entropy random stringSigns and verifies auth tokens issued at
/api/auth/login. If this value changes, all existing sessions are immediately invalidated and users must log in again.Generate a suitable value:INGEST_SHARED_SECRET
INGEST_SHARED_SECRET
ALLOWED_ORIGINS
ALLOWED_ORIGINS
Type: Comma-separated list of URLsControls which browser origins the FastAPI CORS middleware permits. In production this is the definitive allowlist — no wildcard or regex fallback is applied.In development mode (
ENVIRONMENT=development), the middleware additionally permits any http://localhost:* or http://127.0.0.1:* origin via regex, so you do not need to enumerate every local port.Default (development only):N8N_WEBHOOK_BASE_URL
N8N_WEBHOOK_BASE_URL
Type: URL stringBase URL that FastAPI uses to construct webhook trigger URLs pointing at n8n. In Docker Compose this is the internal service URL. In production it is the public or VPC-internal URL of your n8n deployment.
API_BASE_URL
API_BASE_URL
Type: URL stringThe FastAPI base URL as seen by the n8n container. n8n workflows read this from
$env.API_BASE_URL when constructing HTTP request URLs to the backend.Optional Backend Variables
ENVIRONMENT
ENVIRONMENT
Values:
development (default) | productionControls three behaviours:- Startup check: production mode enforces all required env vars and blocks boot on missing values.
- CORS: production mode disables the
allow_origin_regexlocalhost fallback; onlyALLOWED_ORIGINSentries are permitted. - Cookie security: production mode sets
SecureandSameSite=Stricton auth cookies.
N8N_API_BASE_URL
N8N_API_BASE_URL
Type: URL string — default:
http://n8n:5678FastAPI uses this URL to call the n8n REST API for workflow listing and trigger-by-ID operations (proxied through /api/n8n/workflows/{id}/trigger).N8N_API_KEY
N8N_API_KEY
Type: StringAPI key for the n8n REST API. Generate from n8n editor → Settings → API. Required if you want to trigger workflows from the admin UI via
POST /api/n8n/workflows/{id}/trigger.N8N_PUSH_WEBHOOK_URL
N8N_PUSH_WEBHOOK_URL
Type: Full webhook URLThe complete URL of the OPS push webhook in n8n. FastAPI posts to this URL when triggering an OPS push job.
DISABLE_SCHEDULER
DISABLE_SCHEDULER
Values:
true | unset (default: scheduler enabled)Set to true to prevent the 24-hour background sync scheduler from starting. Useful in environments where syncs are triggered exclusively via n8n cron workflows, or during debugging when you want to eliminate background activity.POSTGRES_USER / POSTGRES_PASSWORD / POSTGRES_DB
POSTGRES_USER / POSTGRES_PASSWORD / POSTGRES_DB
Type: Strings — used by Docker Compose onlyThese variables configure the
postgres service and are interpolated into the POSTGRES_URL that Docker Compose passes to the api service. They are not read directly by the FastAPI application.PS_DIRECTORY_URL
PS_DIRECTORY_URL
Type: URL — default shown belowThe PromoStandards directory service endpoint used to auto-discover all 994+ registered suppliers and their endpoint versions.
SANMAR_SFTP_* (SanMar only)
SANMAR_SFTP_* (SanMar only)
Type: Strings — optional, SanMar imports onlySanMar product data is fetched via SFTP in addition to SOAP. These variables are only required if you are configuring a SanMar supplier.
Frontend Variables
The Next.js frontend reads variables fromfrontend/.env.local. Only variables prefixed with NEXT_PUBLIC_ are bundled into the browser JavaScript bundle.
NEXT_PUBLIC_API_URL
NEXT_PUBLIC_API_URL
Type: URL stringThe FastAPI base URL used by browser-side fetch calls. This must be a URL the end user’s browser can reach — not an internal Docker network hostname.
NEXT_PUBLIC_N8N_URL
NEXT_PUBLIC_N8N_URL
Type: URL stringThe n8n editor URL, used by the admin Workflows page to display workflow links.
NEXT_PUBLIC_PUSH_WORKFLOW_ID
NEXT_PUBLIC_PUSH_WORKFLOW_ID
Type: String — n8n workflow IDThe workflow ID of the OPS push workflow, used by the frontend to construct the trigger URL via the n8n proxy.
Security Reference
Credential Encryption
All supplier and customer credentials are stored as encrypted JSONB via the
EncryptedJSON SQLAlchemy type. The SECRET_KEY Fernet key encrypts these columns transparently on every write and decrypts them on every read. No plaintext credentials ever reach the database.Ingest Authentication
The
INGEST_SHARED_SECRET protects the FastAPI ingest endpoints from unauthorised callers. It is passed as the X-Ingest-Secret header by n8n workflows and validated on every ingest request. n8n and FastAPI must share the exact same value.JWT Session Tokens
Auth tokens are signed with
JWT_SECRET_KEY and stored as HTTP-only cookies. In production mode, cookies are issued with Secure and SameSite=Strict flags. Changing JWT_SECRET_KEY immediately invalidates all active sessions.CORS Enforcement
In production,
ALLOWED_ORIGINS is the sole source of truth for permitted browser origins. The development regex fallback (which allows any localhost port) is disabled when ENVIRONMENT=production.