This is a Next.js project template that runs on Cloudflare workers including next-intl, Tailwind CSS, ESLint, Prettier and BProgress.
Install dependencies
Install with your preferred package manager (example commands):
# bun
bun install
# npm
npm install
# yarn
yarn install
# pnpm
pnpm install
Configure environment (.dev.vars)
- Create a
.dev.varsfile at the project root with any environment variables you need (one per line: KEY=VALUE). Example:
NEXT_PUBLIC_API_URL=https://api.example.com
CF_ACCOUNT_ID=your-cloudflare-account-id
Do NOT commit .dev.vars to source control. It often contains secrets and local values.
After adding or changing environment variables, regenerate/update Cloudflare environment types (this project includes a cf-typegen script):
# npm
npm run cf-typegen
# yarn
yarn cf-typegen
# pnpm
pnpm run cf-typegen
# bun
bun run cf-typegen
The cf-typegen script runs wrangler types and updates cloudflare-env.d.ts so your TypeScript types match your Cloudflare environment variables.
Run (development)
Start the dev server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
Open http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying src/app/[locale]/page.tsx, the page auto-updates as you edit the file.