Skip to content

Simple Nextjs template with my preferred configurations

Notifications You must be signed in to change notification settings

chev0004/Nextjs-Template

Repository files navigation

Next.js Template by chev

A modern Next.js template with TypeScript, Tailwind CSS v4, and a complete developer experience setup.

Features

  • Next.js 16 with React 19
  • TypeScript for type safety
  • Tailwind CSS v4 for styling
  • Biome for fast linting and formatting
  • React Compiler enabled for automatic optimizations
  • Git Hooks (Husky + Commitlint + lint-staged)
    • Pre-commit: Auto-format and lint staged files
    • Commit-msg: Validate conventional commit messages
    • Pre-push: Run full lint and type checks

Quick Start

# Install dependencies
bun install

# Start development server
bun dev

Visit http://localhost:3000 to see your app.

Using as a Template

Clone this repo for a new project, then run init to wipe git history and rename everything:

git clone https://github.com/chev0004/Nextjs-Template.git my-project && cd my-project
bun run init my-project
bun install
bun dev

The init script will: remove existing git history, run git init, create develop branch, set package.json name, update README/layout metadata, and commit everything as "Initial commit".

Available Scripts

  • bun dev - Start development server
  • bun build - Build for production
  • bun start - Start production server
  • bun lint - Run linting checks
  • bun lint:fix - Fix linting issues automatically
  • bun format - Format code
  • bun type-check - Run TypeScript type checking

Biome Configuration

This template includes a comprehensive Biome setup optimized for Next.js:

Formatter:

  • 2-space indentation
  • 80 character line width
  • Single quotes for JavaScript/TypeScript
  • Auto-organize imports

Linter:

  • Next.js domain rules enabled
  • Strict rules for unused imports/variables
  • Next.js-specific rules (no <img>, no <head> in pages, etc.)
  • Tailwind CSS directive support
  • Auto-fix for safe transformations

Overrides:

  • Allows default exports in Next.js app/pages directories
  • Config files and middleware exempt from default export rule

Commit Convention

This template uses Conventional Commits. Examples:

  • feat: add user authentication
  • fix: resolve navigation bug
  • docs: update README
  • refactor: simplify component structure

Project Structure

src/
  └── app/
      ├── layout.tsx
      ├── page.tsx
      ├── globals.css
      ├── loading.tsx
      ├── error.tsx
      └── not-found.tsx

About

Simple Nextjs template with my preferred configurations

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •