Syntology Docs

Edge — Cloudflare Worker

One Worker (worker.js) serves the whole domain to avoid Custom-Domain vs Route conflicts. Config: wrangler.toml (account pinned; assets ./public; run_worker_first = true). Custom domains are bound in the dashboard, not declared as [[routes]] (zone permission / silent abort of activation — documented in wrangler.toml comments).

Routing (high level)

AreaModules
Static sitepublic/ via ASSETS binding
Billing / sessionbilling.js, billing-session.js, billing-topup.js, balance-store.js, stripe-client.js, reviewer-billing.js
Trial / OAuthoauth-trial.js, mcp-oauth-authorize.js
Graph proxiesgraph-agent-proxy.js → App Runner; mcp-proxy.js → /mcp (SSE/chunked, no buffer)
Aura HTTP readsgraph-pulse.js, graph-slice.js, graph-neighborhood.js, atlas-api.js, code-library.js
Otherfeedback.js, correction.js (KV only — never auto-applied to graph), rate-limit.js, turnstile.js, agent-telemetry.js

KV / Analytics (bindings — ids in wrangler; secrets via wrangler secret put)

BindingPurpose
WAITLISTLegacy waitlist
BILLINGEntitlement / prepaid balance
TRIAL_TOKENSShort-lived trial bearers (token:<value>, TTL)
FEEDBACKBeta feedback
CODE_LIBRARY_RATECode-library abuse caps
AGENT_TELEMETRYAnalytics Engine dataset syntology_agent_telemetry

Secret names (values never in git): STRIPE_SECRET_KEY, STRIPE_WEBHOOK_SECRET, SESSION_SIGNING_KEY, plus Neo4j web password and GRAPH_API_BASE_URL / internal key as used by proxies (see Worker module headers and wrangler.toml comments).

Public assets worth knowing

  • public/llms.txt / llms-full.txt — agent-oriented truthfulness about what is live vs illustrative.
  • public/app/ — Atlas (WebGL citation map); large data/ gitignored.
  • Marketing pages (demo.html, methodology.html, …): headline numbers often static/illustrative; live widget is graph-pulse (and related).

Deploy notes

wrangler deploy under the Syntology Cloudflare account. Confirm deploy output shows triggers activated, not only “Uploaded.” Managed robots.txt in the CF dashboard can override public/robots.txt if enabled.