Single-user personal startpage on TanStack Start, Cloudflare Workers, and D1.
- Quick sign-in with a passkey
- Fast migration from a legacy sui2 instance
- Optional Tailscale service entries
-
Fork this repository on GitHub.
-
Create the D1 database
wrangler d1 create sui3
Note the returned
database_id. -
Configure repository secrets
Under Settings → Secrets and variables → Actions, add:
Secret Purpose CLOUDFLARE_API_TOKENAPI token with Cloudflare Workers Admin, D1 Edit, and Zone Edit permissions CLOUDFLARE_ACCOUNT_IDYour Cloudflare account ID SUI3_DOMAIN_PRODUCTIONCustom domain, e.g. start.example.comSUI3_D1_DATABASE_ID_PRODUCTIONThe database_idfrom step 2 -
Push to
masterThe included GitHub Actions workflow auto-generates
wrangler.production.jsonc, builds, deploys to Cloudflare Workers, and applies D1 migrations on every push. -
Configure Worker runtime values
Set these in the Cloudflare dashboard (Workers & Pages → sui3 → Settings → Variables and Secrets), or generate the config locally and use the Wrangler CLI:
SUI3_DOMAIN_PRODUCTION=start.example.com \ SUI3_D1_DATABASE_ID_PRODUCTION=<database_id> \ node scripts/generate-wrangler-config.js production wrangler secret put SETUP_TOKEN --config wrangler.production.jsonc wrangler secret put CREDENTIAL_ENCRYPTION_KEY --config wrangler.production.jsonc wrangler secret put WEBAUTHN_RP_ID --config wrangler.production.jsonc wrangler secret put WEBAUTHN_ORIGIN --config wrangler.production.jsonc
Value Example Purpose SETUP_TOKENrandom string One-time passkey enrollment secret CREDENTIAL_ENCRYPTION_KEYopenssl rand -base64 32Encrypts integration credentials in D1 WEBAUTHN_RP_IDstart.example.comMust match the hostname used in the browser WEBAUTHN_ORIGINhttps://start.example.comOrigin used for WebAuthn wrangler.production.jsoncis generated byscripts/generate-wrangler-config.jsfrom secrets and is gitignored. The basewrangler.jsonccontains no account-specific values so it can safely live in version control.
- Open
https://your-domain/setup, enterSETUP_TOKEN, and enroll your passkey. This only works once. - Open
/adminand import your sui2data.json(apps only; overwrites all existing categories and apps). - Optional: to enable Tailscale Services, create a Tailscale OAuth client
with the read-only
all:readscope, then enter its client ID and client secret in Admin → Tailscale. SUI3 derives the tailnet MagicDNS suffix from internal device FQDNs returned by the Tailscale API and refreshes it on every sync. If discovery fails during setup, Admin reveals an optional manual DNS fallback.
pnpm install
pnpm db:migrate:local
pnpm devCopy .dev.vars values as needed:
SETUP_TOKEN— used once on/setupWEBAUTHN_RP_ID=localhostWEBAUTHN_ORIGIN=http://localhost:8333CREDENTIAL_ENCRYPTION_KEY— base64-encoded 32-byte key used to encrypt integration credentials
Generate a local encryption key with openssl rand -base64 32. Keep the same
value between restarts or re-enter the Tailscale credential in Admin.
- Open http://localhost:8333/setup and enroll your passkey
- Open
/adminand import your sui2data.json
| Script | Purpose |
|---|---|
pnpm dev |
Local dev |
pnpm build |
Build using the development Wrangler bindings |
pnpm build:production |
Build using wrangler.production.jsonc |
pnpm deploy |
Production build + Wrangler deploy |
pnpm db:migrate:local |
Apply D1 migrations locally |
pnpm db:migrate:remote |
Apply D1 migrations remotely |
See AGENTS.md for architecture and auth details.