Skip to content

Architecture

Set runs the dashboard, API, and short-link redirects on Cloudflare Workers or Pages.

  1. A visitor opens a short link on your domain
  2. Set looks up the link and redirects (or shows a password/warning page)
  3. You manage links in the dashboard or via the API (both require login)
  4. If analytics is enabled, visits show up in reports and logs

Cloudflare services Set uses

Binding nameProductRequired?Plain meaning
DBD1YesMain database — the real home of your links
KVKVYesFast cache for redirects + one-time setup flag
ANALYTICSAnalytics EngineRecommendedVisit events for charts and logs
R2R2OptionalFile storage for backups and social images
AIWorkers AIOptionalSuggests short codes and titles

D1 is where links are really stored. KV is a fast copy used for redirects. After you save a link, Set updates the cache; if the cache is wrong, it is dropped and reloaded from D1.

This fork starts from fresh tenant-owned resources and a one-time first-owner bootstrap. See multitenant provisioning.

Better Auth sessions and verified Cloudflare Access users share one interactive-user contract. Sessions store their active organization on the session row; Access identities store it in user_preferences. Middleware resolves either form into the same workspace, role, and permission context. Instance administration is separate: ordinary workspace routes always require membership, while explicit /api/admin/** routes use the audited instance-admin capability.

R2 and AI are optional extras. Start with Getting Started.