Skip to content
Back to skills

deploy-stack

ASecurity

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 the...

  • 0 votes
  • 0 copies
  • 3 views
  • Added November 19, 2026
ai-agentsgosqlnextjstestinggitapidatabasesecurity

Works with

  • cli
  • api

Security analysis

A92/100
  • mediumUses curl or wget to download content

Pro shows the line behind each finding and how to fix it

Scanned November 19, 2026

npx -y skills add seanaiux/uberdesigner-skills --skill deploy-stack --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of deploy-stack?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for deploy-stack
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/seanaiux-deploy-stack/badge)](https://www.skillsdirectory.com/skills/seanaiux-deploy-stack)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
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:

1. **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.
2. **Accounts or saved data?** Sign-in, forms that save, dashboards, anything per user: add Supabase.
3. **Uploads or heavy media?** User uploads, video, large photo sets: add R2. A handful of images in the repo don't
   need it.
4. **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:

```jsonc
{
  "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 own `404.html`.
- Build, then deploy: `npm run build && npx wrangler deploy`. The first run opens Cloudflare in the browser to sign in.
- `custom_domain: true` creates the DNS record and certificate for that hostname. Add `www.example.com` the 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 command `npx 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:

```txt
/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 `immutable` if every file in it gets a new name when it changes. Media you replace in place
  (`hero.jpg`) gets a short `max-age`, or a version in its name (`hero-v2.jpg`).
- `_headers` applies to static files only. Responses made by Worker code set their own headers.

## 5. Files and media on R2

- Create a bucket: R2 → Create bucket (or `npx wrangler r2 bucket create my-site-media`).
- **Public media** (site photos, video): R2 → the bucket → Settings → **Custom Domains** → `media.example.com`.
  Don't serve from the `r2.dev` address in production: it's rate-limited and meant for development.
- **Private files** (user uploads, paid downloads): no public domain. Bind the bucket to the Worker
  (`"r2_buckets": [{ "binding": "MEDIA", "bucket_name": "my-site-media" }]`) and serve files from code after checking
  who's asking, or hand out short-lived presigned URLs.
- Upload with `npx wrangler r2 object put my-site-media/path/file.jpg --file ./file.jpg --remote`, or any S3 tool with
  an R2 API token.
- **Caching media:** on the media domain, Caching → Cache Rules → a rule for `media.example.com`: eligible for cache,
  Edge TTL a month, Browser TTL a week, or a year for files whose names are versioned. Video plays with range
  requests, which R2 handles; keep each file under a few hundred MB, and use Cloudflare Stream if they need adaptive
  streaming.

## 6. Image sizes and formats

Keep one large original (in R2 or the site) and let Cloudflare make each size:

```txt
https://example.com/cdn-cgi/image/width=800,quality=80,format=auto,fit=cover/https://media.example.com/photos/hero.jpg
```

- Turn it on: Images → Transformations → enable on the zone. If the originals are on another hostname, allow it there
  (R2's custom domain on the same account is simplest).
- `format=auto` serves AVIF or WebP to browsers that take them. Use `srcset` with three or four widths
  (`width=480`, `960`, `1600`, `2400`) and `sizes`, not one huge image.
- Billing counts each unique image and size once a month; format and quality don't add to it. The free plan includes a
  monthly allowance (5,000 unique transformations when last checked): past it, new sizes fail with an error and cached
  ones keep working. A site with many photos times many widths can pass it: keep the width list short.
- Don't resize what's already small (icons, SVG) or GIF-like animations; serve them as they are.

## 7. Database and sign-in with Supabase

- Create a project at supabase.com, in the region nearest the site's visitors. The person creates the account.
- **Keys:** the publishable key can be in the browser; the secret key only in server code and Worker secrets.
- **Row-level security on every table** that holds user data, with a policy per action. A table without it is open to
  anyone with the publishable key. Write the policies before the first real user.
- **Schema as migrations:** keep SQL files in the repo (`supabase/migrations/`) and apply them in order, not by
  clicking in the dashboard.
- **Auth:** set Authentication → URL Configuration → Site URL to the live domain and add the preview and local URLs to
  the redirect list. Use the provider's own email sender for testing only; set up custom SMTP (Resend, Postmark) before
  launch.
- **Free plan:** free projects with little activity are paused after about a week (the owner gets an email first; it
  resumes from the dashboard). A site people depend on goes on the Pro plan; don't rely on a scheduled ping to keep a
  free one awake.
- From a Worker, use `@supabase/supabase-js` with the secret key from `env`, created per request.

## 8. Before you call it live

- [ ] The domain loads over HTTPS, `www` and the bare domain both work, one redirects to the other.
- [ ] A deep link (`/about`, a single-page app route) loads directly and on refresh.
- [ ] `curl -I https://example.com/assets/<a built file>` shows `max-age=31536000, immutable`; the HTML shows
      `max-age=0`.
- [ ] Images come back as AVIF or WebP at the size asked for (check the response's `content-type`).
- [ ] No secret in the built files: search `dist/` for the secret key's first characters.
- [ ] Row-level security is on for every table (Supabase → Advisors shows any that aren't).
- [ ] Their email still works if the nameservers moved.

## What you do, and what the person does

You write the config, run the builds and deploys, and explain each setting. The person creates their own Cloudflare
and Supabase accounts, signs in when Wrangler or the dashboard asks, enters payment details, and buys the domain. Never
handle their passwords or card details, and confirm before anything that costs money or changes a live domain's DNS.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.