Architecture
Set runs the dashboard, API, and short-link redirects on Cloudflare Workers or Pages.
What happens when someone opens a short link
- A visitor opens a short link on your domain
- Set looks up the link and redirects (or shows a password/warning page)
- You manage links in the dashboard or via the API (both require login)
- If analytics is enabled, visits show up in reports and logs
Cloudflare services Set uses
| Binding name | Product | Required? | Plain meaning |
|---|---|---|---|
DB | D1 | Yes | Main database — the real home of your links |
KV | KV | Yes | Fast cache for redirects + one-time setup flag |
ANALYTICS | Analytics Engine | Recommended | Visit events for charts and logs |
R2 | R2 | Optional | File storage for backups and social images |
AI | Workers AI | Optional | Suggests 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.