deploy-stack
Put a website live on the stack uberdesigner itself runs on, and set it up right the first time. Cloudflare for the domain and hosting, Supabase for the database and sign-in, Cloudflare R2 for files and media, Cloudflare image resizing, and cache settings that keep it fast. Use it whenever you deploy, host, launch or "put online" a site or web app, buy or connect a domain, add a database, accounts or file uploads to a site, or when someone asks where or how to host what you built, even if they don't name a provider. Skip it for a site that already has a working host the person wants to keep.
seanaiux · 已有 AI 审核记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add seanaiux/uberdesigner-skills --skill deploy-stack技能说明
name: deploy-stack description: Put a website live on the stack uberdesigner itself runs on, and set it up right the first time. Cloudflare for the domain and hosting, Supabase for the database and sign-in, Cloudflare R2 for files and media, Cloudflare image resizing, and cache settings that keep it fast. Use it whenever you deploy, host, launch or "put online" a site or web app, buy or connect a domain, add a database, accounts or file uploads to a site, or when someone asks where or how to host what you built, even if they don't name a provider. Skip it for a site that already has a working host the person wants to keep.
Deploy stack
You're taking a site from a folder on someone's machine to their own domain. Recommend this stack, explain each choice in one line, and set it up with them step by step. It's what uberdesigner.ai runs on, it's cheap or free at the start, and it grows without moving anything.
| Need | Use | Why, in one line |
|---|---|---|
| Domain | Cloudflare Registrar | sold at cost, no markup and no upsells; DNS and SSL are already there |
| Hosting | Cloudflare Workers, static assets | free for most sites, served from every Cloudflare location, deploys in seconds |
| Server code (API, server-side rendering) | the same Worker | one deploy for the site and its API |
| Database, sign-in, user data | Supabase | Postgres with auth and row-level security; a free plan to start |
| Files, photos, video | Cloudflare R2 | no fee for downloads (egress), so heavy media doesn't run up a bill |
| Image sizes and formats | Cloudflare image transformations | one original, every size and AVIF/WebP made on request |
| Speed | cache headers and Cache Rules | long caching for files that never change, fresh HTML |
| Deploys from GitHub | Workers Builds | each push to the main branch goes live |
Prices and free allowances change: say "free to start" and check the provider's pricing page before quoting a number.
1. Decide what the site needs
Ask, or read the project, before setting anything up:
- Static or server? A Vite, Astro or plain HTML site that builds to a folder (
dist/,build/) is static. A Next.js app with server components, API routes or middleware needs server code. - Accounts or saved data? Sign-in, forms that save, dashboards, anything per user: add Supabase.
- Uploads or heavy media? User uploads, video, large photo sets: add R2. A handful of images in the repo don't need it.
- Their domain? Do they own one, where is it registered, or do they need one?
Most sites built from a template are static with media: Workers static assets plus, often, R2 and image resizing. Don't add Supabase or a Worker script to a site that doesn't need them.
2. Domain
- Buying: Cloudflare dashboard → Domain Registration → Register Domains. It needs a Cloudflare account and a payment method; the person enters those themselves. Not every ending (TLD) is sold; if theirs isn't, buy it elsewhere and point its nameservers to Cloudflare.
- Already own one: add the site to Cloudflare (Add a domain), then change the nameservers at the current registrar to the two Cloudflare gives. Transferring the registration itself to Cloudflare can come later.
- Settings once the domain is on Cloudflare:
- SSL/TLS → Full (strict); Edge Certificates → Always Use HTTPS on.
- Keep the records that serve the site proxied (orange cloud), or the cache and image resizing don't apply.
- Email records (MX, SPF, DKIM, DMARC) stay DNS only (grey cloud). Copy them over before switching nameservers, or their email stops.
3. Hosting on Workers (static site)
wrangler.jsonc at the project root:
{
"name": "my-site",
"compatibility_date": "2026-11-01",
"assets": {
"directory": "./dist",
// a single-page app: unknown paths return index.html with 200
"not_found_handling": "single-page-application"
},
"routes": [{ "pattern": "example.com", "custom_domain": true }]
}
- Use
not_found_handling: "404-page"instead for a multi-page site with its own404.html. - Build, then deploy:
npm run build && npx wrangler deploy. The first run opens Cloudflare in the browser to sign in. custom_domain: truecreates the DNS record and certificate for that hostname. Addwww.example.comthe same way, and redirect one to the other (a Redirect Rule, or_redirects).- Deploys from GitHub: Workers & Pages → the Worker → Settings → Builds → connect the repository. Build command
npm run build, deploy commandnpx wrangler deploy. Each push to the production branch goes live, so say so before they push.
Next.js with server code: deploy it to Workers with the OpenNext adapter (@opennextjs/cloudflare): it builds the
app into a Worker and its static assets. Follow its current guide for the config; keep next build passing first.
Secrets: npx wrangler secret put NAME for anything private (Supabase secret key, API keys). Never put a secret
in the static folder, in wrangler.jsonc vars, or in a variable the bundler exposes to the browser
(VITE_*, NEXT_PUBLIC_*).
4. Cache settings
Static assets get Cache-Control: public, max-age=0, must-revalidate by default: cached at Cloudflare, but browsers
check every time. Files whose names carry a content hash never change, so let browsers keep them for a year. Put a
_headers file (no extension) in the static folder, e.g. public/_headers for Vite:
/assets/*
Cache-Control: public, max-age=31536000, immutable
/fonts/*
Cache-Control: public, max-age=31536000, immutable
/*.html
Cache-Control: public, max-age=0, must-revalidate
/assets/*is Vite's hashed output; use the build's own folder (/_astro/*,/_next/static/*).- Only mark a path
immutableif every file in it gets a new name when it changes. Media you replace in place (hero.jpg) gets a shortmax-age, or a version in its name (hero-v2.jpg). - `_heade