PRODUCTION · SALESFORCE REPORTING PROXY

Producer leaderboards, refreshed every five minutes.

Phantom Ledger is a Railway-hosted proxy that syncs Salesforce report data across all five lines of business on a five-minute schedule and serves it from a shared cache — powering the Top Producers widget on SharePoint and any surface that needs ranked producer performance without hammering Salesforce on every request.

5 LOBs · one endpoint Cached every 5 min GitHub ↗
COMPONENTS
01 · Report Proxy
Internal · Railway
Cached Salesforce report API

A lightweight Express server that authenticates to Salesforce via OAuth 2.0 client credentials and refreshes all five reports together every five minutes, caching the parsed results server-side. Every request — the widget, a debug call, or a dozen browser tabs at once — reads from that shared cache, so Salesforce is called once per cycle no matter who's watching. If one report's fetch fails, that LOB simply keeps serving its last known-good data.

Endpoint GET /reports (served from 5-min cache)
Auth Salesforce OAuth 2.0 client credentials
Refresh All 5 reports fetched together, every 5 min
Resilience A failed fetch falls back to last cached data
Internal service · no UI
02 · Top Producers Widget
🏆
Internal · SharePoint
Embedded leaderboard for SharePoint

A self-contained HTML widget that calls /reports and renders a ranked leaderboard for each line of business — a grand total up top, Top 10 producers underneath, and a colored metric banner on every column (Premium · MTD, Revenue · Last 30 Days, Policies · Last 30 Days). A "last updated" footer, stamped in the viewer's own timezone, keeps the cache interval visible at a glance.

Embed iframe in SharePoint modern page
Header Grand total by LOB, Top 10 detail below
Bands Metric + time window per column
Refresh Client polls every 5 min, local-time stamped
Preview widget ↗
03 · Per-LOB Debug
🔍
Internal · JSON
Individual LOB endpoints

Each line of business has its own scoped endpoint for debugging and verification — also served from the shared five-minute cache rather than calling Salesforce directly, so checking a single report adds no extra load or wait. Useful for validating parse logic or confirming data shape without pulling all five reports at once.

Pattern GET /reports/:lob (from cache)
LOB keys CL · PL · PC · EB · MEDICARE
Health GET / → status + cache timestamp
TOP_N Configurable via env (default: 10)
Internal · no public UI
Runtime
Node.js ≥18 Express
Data Source
Salesforce Analytics API v59.0
Auth
OAuth 2.0 Client Credentials Token Cache
Infrastructure
Railway CORS origin lock 5-min server cache

Phantom Ledger is an internal system at YourPolicy — not a public product. Built on Express and deployed on Railway, syncing Salesforce every five minutes so the leaderboard stays fast without hammering the API.