- Base Framework is Next.js (App Router)
- Uses b10cks CMS via
@b10cks/next - Provides a basic content structure to get started
- Live preview & visual editing through the b10cks editor
- Includes Tailwind CSS for styling
- Schema.org structured data via JSON-LD
- TypeScript support
- Configures OxLint and OxFmt with opinionated rules
- Sensible defaults for Zed editor
Make sure you've installed the b10cks CLI:
# Using bun
bun install -g b10cks-cli
# Using npm
npm install -g b10cks-cli
# Using yarn
yarn global add b10cks-cliUse the following command to create a new project based on this boilerplate. Replace <project-name> with the actual name of your project.
# bun
bunx create b10cks/next-boilerplate <project-name>
# npm
npx degit b10cks/next-boilerplate <project-name>Follow these steps to set up b10cks:
- Create a new b10cks account at b10cks.com.
- Create a new space in b10cks.
- Create a new API token in the space settings
- Go to
Configuration > Access Tokensand clickGenerate Token. - Copy the token and put into
.envfile.
- Go to
- Login via the CLI using
b10cks login
# bun
bun install
# npm
npm install
# yarn
yarn installStart the development server on https://localhost:3001 (Next.js generates a
self-signed certificate via --experimental-https):
# bun
bun run dev
# npm
npm run dev
# yarn
yarn devapp/[[...slug]]/page.tsx— catch-all route; fetches content server-side, maps the b10cks meta block onto the Metadata API, and renders the block treeapp/layout.tsx— fetches the site config (_config) for header/footer and wraps the app inB10cksNextProviderfor live previewb10cks/— block components and the registry (components.ts) that maps CMS block names onto them; add new blocks hereproxy.ts— CMS-managed redirects (single lookup per page request viaredirects/lookup)lib/ilum.ts— image URL builder for the b10cks image API, wired intonext/imagethrough a custom loader
Build the application for production:
# bun
bun run build
# npm
npm run build
# yarn
yarn buildLocally preview production build:
# bun
bun run start
# npm
npm run start
# yarn
yarn start