Two things live on Cloudflare: the marketing site (Pages) and the Pro API (Worker). Both are free at your scale.
| Service | URL |
|---|---|
| Marketing site | https://animevocab.pages.dev |
| Pro API (after Worker deploy) | https://avc-api.<your-subdomain>.workers.dev |
After buying animevocab.com: Cloudflare dashboard → Pages → animevocab → Custom domains → add the domain.
- Buy animevocab.com (Cloudflare Registrar is easiest — domain is on Cloudflare automatically).
- Create a Cloudflare account if you don't have one.
- If you bought the domain elsewhere, add the site in Cloudflare and point your registrar's nameservers to Cloudflare.
npx wrangler loginThis opens a browser; approve access. After that, an agent (or you) can deploy from this repo.
The site lives in web/ (Next.js + OpenNext for Cloudflare).
cd web
npm install
npm run dev # local dev at http://localhost:3000
npm run preview # test in Workers runtime locally
npm run deploy # build + deploy to CloudflareOr from repo root: npm run deploy:site
Production URL: https://animevocab.com (custom domain on Worker animevocab)
Custom domain: Cloudflare dashboard → Workers & Pages → animevocab → Custom domains → add animevocab.com and www.animevocab.com.
Legacy static HTML is in site/ (deprecated).
cd backend
npm install
npx wrangler kv namespace create AVC_KV # paste id into backend/wrangler.toml
npx wrangler secret put OPENAI_API_KEY
npx wrangler secret put DODO_API_KEY
npm run deployCopy the printed URL (e.g. https://avc-api.<subdomain>.workers.dev) into src/config.ts as BACKEND_URL, then npm run build and reload the extension.
Optional: add a custom route in Cloudflare (e.g. api.animevocab.com) → Worker avc-api.
Pushes to master run .github/workflows/deploy.yml, which deploys:
| Job | Target | Command |
|---|---|---|
| Deploy marketing site | Cloudflare Worker animevocab (Next.js via OpenNext) |
npm run deploy in web/ |
| Deploy Pro API | Cloudflare Worker avc-api |
wrangler deploy from backend/ |
- Create a Cloudflare API token: dash.cloudflare.com/profile/api-tokens → Create Token → Edit Cloudflare Workers template (or custom token with Account → Workers Scripts → Edit, Workers KV Storage → Edit, Cloudflare Pages → Edit).
- Add it to GitHub: repo Settings → Secrets and variables → Actions → New repository secret
- Name:
CLOUDFLARE_API_TOKEN - Value: your token
- Name:
- Disable duplicate Cloudflare Git builds (they cause the red “Workers Builds: avc-api” check and wrong root directory):
- Cloudflare dashboard → Workers & Pages → avc-api → Settings → Builds → disconnect Git / disable automatic builds
- If Pages is also connected to Git separately, disconnect that too — the GitHub Action handles both deploys.
After the secret is set, merge to master and watch Actions → Deploy.
npm run deploy:site # marketing site → Pages
npm run deploy:api # Pro API → Worker avc-apiCloudflare Pages Git integration only (site)
Connect the repo in Cloudflare Pages (Workers & Pages → Create → Connect to Git). Settings:
| Setting | Value |
|---|---|
| Build command | (empty) |
| Build output directory | site |
| Root directory | / |
Prefer the GitHub Action above so the API deploys on the same merge.
-
https://animevocab.comloads the landing page -
https://animevocab.com/privacy.htmlloads (Chrome Web Store needs this URL in the listing) - Worker deployed;
BACKEND_URLinsrc/config.tsupdated - Add
og.png(1200×630) tosite/for social previews