next-kickstart icon indicating copy to clipboard operation
next-kickstart copied to clipboard

Next.js 14 kickstarter. Zero setup & edge ready. Take what you need: ESLint, Prettier, Tailwind, tRPC, WebSockets, Drizzle, Lucia Auth, Vitest, Testing Library, Playwright, PWA, Docker, CI, Bun

next-kickstart

Feature packed Next.js boilerplate. Zero setup. Edge ready.

Some features depend on environment variables (indicated in features list with ๐Ÿ’ก) and so require enabling. They are disabled by default so that the app runs without any setup. They can be enabled by uncommenting all lines under where @enable {feature} appears.

๐Ÿ“š Features

View the repository branches for other feature sets (e.g. Bun)

Core

  • ๐Ÿ—๏ธ TypeScript - Configured to maximize type safety
  • โš™๏ธ T3 Env - Environment variable validation
  • ๐ŸŒ tRPC - Create end-to-end type-safe APIs that work in both client and server components
  • โšก๐Ÿ’ก WebSockets - Real-time communication (using Pusher, but can be swapped out for alternatives)
    • ๐Ÿ”— integrates with tRPC for end-to-end type-safe events
  • ๐Ÿ’ฝ๐Ÿ’ก Drizzle - ORM with maximal type safety
  • ๐Ÿ”’๐Ÿ’ก Lucia Auth - Flexible and secure authentication
    • ๐Ÿ”—๐Ÿ’ก integrates with Drizzle to store auth data

Development

  • ๐Ÿ“ ESLint - Consistent code standards
  • โœจ Prettier - Consistent code styling
  • ๐ŸŽจ Tailwind CSS - Utility-first CSS framework
  • ๐Ÿงฉ shadcn/ui - Components built with Radix UI and Tailwind CSS
  • ๐Ÿ“ MDX - Use markdown with components
  • ๐Ÿ“ Absolute imports - Easier and cleaner module imports
  • ๐Ÿ’ป VS Code configurations - Configurations for easy debugging

Testing

  • ๐Ÿงช Vitest - Flexible testing framework
  • ๐Ÿ™ React Testing Library - Maintainable component testing
    • ๐Ÿ”— integrates with Vitest as your testing framework
  • ๐ŸŽญ Playwright - End-to-end testing against multiple environments

Deployment

  • ๐Ÿ“Š Bundle analyzer - Analyze bundle sizes in each environment with pnpm run build:analyze
  • ๐Ÿ“ฆ๐Ÿ’ก next-pwa - Make your website as a progressive web app (PWA)
  • ๐Ÿณ Docker - (local and production) Docker-compose and Dockerfiles for running anywhere
  • ๐Ÿ”„ GitHub Actions - Robust CI/CD

๐ŸŒฑ Getting started

๐Ÿš€ Option 1: Clone and deploy with Vercel

Vercel

๐Ÿ“‹ Option 2: Clone and run locally

  1. Fork this repository (uncheck 'Copy the main branch only` if you are interested in other branches / feature sets)
  2. Clone your new repository
  3. Install dependencies and run the development server
  • with pnpm

    pnpm install
    pnpm run dev
    
  • or with Docker

    docker-compose --file docker/dev/docker-compose.yml up
    

โš™๏ธ Configuration

Docker

  • .dockerignore
  • docker/ - Dockerfile and docker-compose.yml for development and production

Drizzle

๐Ÿ’ก (requires enabling)

  • src/db/
  • src/lib/db.ts
  • drizzle.config.ts

ESLint

  • .eslintrc.json

GitHub Actions

  • .github/workflows/ci.yml - type-checking and linting (hence these errors are ignored in next.config.mjs)

Lucia Auth

๐Ÿ’ก (requires enabling)

  • src/app/api/auth
  • src/app/auth
  • src/components/auth.tsx
  • src/db/schemas/auth.ts) store auth data in database
  • src/lib/auth.ts
  • types/lucia.d.ts

Examples

  • src/app/examples/profile/page.tsx

MDX

  • mdx-components.tsx

next-pwa

  • public/icon-512x512.png
  • public/manifest.json
  • next.config.mjs

Playwright

  • e2e/
  • playwright.config.ts

Prettier

  • .eslintrc.json
  • .prettierignore
  • .prettierrc.json

React Testing Library

  • src/app/page.test.tsx
  • testing/setup.ts

shadcn/ui

  • src/components/providers/theme-provider.tsx
  • src/components/ui/
  • src/components/theme-toggle.tsx
  • components.json

T3 Env

  • src/env.mjs - configure environment variables
  • next.config.mjs - environment variables are validated at build-time

Tailwind CSS

  • src/styles/globals.css
  • tailwind.config.js

tRPC

  • src/app/api/trpc/[trpc]/route.ts
  • src/components/providers/trpc-provider.tsx
  • src/trpc/

Examples

  • src/app/examples/client-component/page.tsx - use in a client component
  • src/app/examples/server-component/page.tsx - use in a server component

TypeScript

  • tsconfig.json - all modifications from create-next-app are explained with comments
  • types/reset.d.ts - using ts-reset to increase type-safety

Vitest

  • testing/setup.ts
  • vitest.config.ts

VS Code

  • .vscode/extensions.json - recommended workspace extensions
  • .vscode/launch.json - debug configurations
  • .vscode/settings.json - use project TypeScript version

WebSockets with Pusher

๐Ÿ’ก (requires enabling)

  • src/hooks/useEvent.ts
  • src/lib/events.ts
  • src/trpc/methods.ts

Examples

  • src/app/examples/websockets/page.tsx