Personal website built with Astro, Tailwind CSS, and deployed to Cloudflare Workers.
- Astro 6 — server-rendered (
output: 'server') via the@astrojs/cloudflareadapter - Tailwind CSS v4 — installed as the
@tailwindcss/viteplugin (CSS-first config) - TypeScript — Astro's
strictpreset - Cloudflare Workers — runtime in dev (via Astro 6's workerd integration) and in production
- Node.js 22.12+ (
.nvmrcis set to22— runnvm use) - npm
- A Cloudflare account (only required for deploys)
npm installnpm run devStarts the Astro dev server. Open the printed URL (default: http://localhost:4321).
npm run buildOutputs the Worker bundle and static assets to dist/.
npm run previewRuns wrangler dev against dist/, serving the built Worker on the same workerd runtime that Cloudflare uses in production.
Connect the repo once in the Cloudflare dashboard and every push to main deploys automatically:
- Go to Workers & Pages → Create application → Import a repository.
- Authorize Cloudflare for this GitHub repo and select it.
- Set the build settings:
- Build command:
npm run build - Deploy command:
npx wrangler deploy
- Build command:
- Save. Cloudflare will run the first build and deploy on completion.
npx wrangler login # one-time
npm run deployThis builds and pushes the Worker (and its static assets) using the settings in wrangler.jsonc.
.
├── astro.config.mjs # Astro + Cloudflare adapter + Tailwind Vite plugin
├── wrangler.jsonc # Cloudflare Workers config
├── public/ # Static assets copied as-is
└── src/
├── pages/ # Routes (file-based)
└── styles/
└── global.css # `@import "tailwindcss";` — extend with `@theme` here