Project Files

.vscode
public
src
.gitignore
.prettierrc
bun.lock
cloudflare-env.d.ts
eslint.config.mjs
next.config.ts
open-next.config.ts
package.json
postcss.config.mjs
README.md
tsconfig.json
wrangler.jsonc

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)

  1. Create a .dev.vars file 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.

NextTemplate | Théo CREPIN