Docs

Self-hosting & the API

The runtime shape of PostLens — a zero-dependency Node server, the request path, and the environment it needs.

PostLens runs as a single zero-dependency Node 22 server that serves the built React app, the classic composer, and a small JSON API. Scoring calls TypeSafe Jev; saving uses Supabase. Both secrets live only in server-side environment variables.

The request path

/api/analyze runs bearer auth, a CORS allowlist, a per-minute cap, an exact-input cache, a concurrency cap, and a daily provider cap before it ever reaches the evaluator. /healthz, /api/config, POST /api/check (the public check, with its own per-address caps) and POST /api/hit (the cookieless page-view beacon) are the only unauthenticated routes; everything else needs a principal.

bearer token ─▶ CORS ─▶ rate cap ─▶ cache ─▶ concurrency ─▶ daily cap ─▶ evaluator

Two principals

A signed-in founder (a Supabase JWT, verified against the project JWKS and checked against the owner allow-list) and the extension (a founder access token). Both map to the one owner, so their rows share a single swipe file.