From browser to backend, top to bottom.
Every request enters through the Vercel edge. The edge either serves a committed file, runs a function under /api, or stops the request at the session gate.
cortex-session HMAC cookie with Web Crypto on three prefixes. No valid cookie: 302 to /login.html?next=... Unmatched routes rewrite to /index.html.assets/js/ignite-data.js.bootcamp/ is gated.apps/ are unlinked.next path./index.html.cortex-session cookie: <expiry>.<hmac>, HttpOnly, SameSite=Strict./login.html. Does not revoke SparkHub tokens.platform.js dual() runs each Azure Functions handler on Vercel. hmacCookie and sessionAuth check the session cookie; sparkhubJwt checks SparkHub RS256 tokens against JWKS.data/cards.json and renders project cards. The idea form does not persist.cards.json. The two lists differ./api/partner-app/me, KB search and JWKS.api/ handlers.k-store). At build time, snapshots Nexus and Stash through the CLI.Two paths explain most of the system.
A gated request shows how the edge and API cooperate. A release shows why source changes alone never reach the site.
Opening a gated app
- middleware.js finds no valid
cortex-sessioncookie and sends a 302 to/login.html?next=<path>. - sparkhub-auth.js stores a PKCE verifier and state, then redirects to SparkHub. Prod enters Kainos SSO first.
- SparkHub returns a code to sparkhub-callback.html. The helper checks state and posts the code and verifier to
/api/sparkhub-login. - api/sparkhub-login exchanges the code at
/oauth/tokenand confirms identity at/api/partner-app/me. - It signs an 8-hour expiry with
CORTEX_SESSION_SECRETand sets the cookie. The browser keeps SparkHub tokens for Juno. - The browser returns to
next. The edge verifies the signature and expiry, then serves the committed bundle.
Shipping a change
- Edit source in the app folder, for example
build/stash/src/. - Run that app's own build:
npm, orpnpmfor PPS Catalog. - Commit the regenerated
app/orout/folder with the source. - Push. Vercel git integration deploys the repo root as static files and
api/as functions.
No root build
Each app builds in its own folder. There is no root CI, lint or test workflow.
Fails closed
A missing CORTEX_SESSION_SECRET locks every gated prefix rather than opening it.
Static means public
Ungated files and client bundles are readable by anyone. Secrets belong in functions only.
Two credentials
SparkHub issues the access JWT for KB search. CORTEX issues its own HMAC cookie for pages. Neither stands in for the other.
Chat is open
api/chat needs no session. An in-process limiter allows a burst of 12, then 0.2 requests per second.
Page checks are cosmetic
Outside the three gated prefixes, the chrome's /api/verify check hides content in the browser. It does not protect file downloads.
Nexus has no backend
Customers ship in the bundle as a KB snapshot; research lives in localStorage. Cosmos DB appears only in separate Ignite runtimes.
Snapshots, not live reads
Nexus and Stash pull SparkHub KB data at build time. Refreshing them means a rebuild and a commit.
Two Ignite catalogues
The homepage reads ignite-data.js; the Ignite landing reads cards.json. Edit both or they drift further.