Skip to content

danangekal/next-typescript-pwa-starter

Repository files navigation

This is a Next.js project bootstrapped with create-next-app.

Demo

You can check demo

Features

  • React 19 - Latest React version with improved performance
  • Next.js 15 - Latest Next.js with Turbopack and React 19 support
  • TypeScript 5.7 - Type-safe development with latest TypeScript
  • Serwist - Modern PWA toolkit (successor to next-pwa)
  • Biome - Fast formatter and linter (replaces ESLint + Prettier)
  • pnpm - Fast, disk space efficient package manager
  • Docker - Container support for deployment
  • Husky - Git hooks for code quality
  • lint-staged - Run linters on staged files

Usage

This project requires Node.js >= 22.0.0 and pnpm >= 9.0.0

Installation

git clone https://github.com/danangekal/next-typescript-pwa-starter.git
pnpm install

Development

pnpm dev              # Start dev server with Turbopack
pnpm dev:legacy       # Start dev server without Turbopack (if needed)

Production

pnpm build
pnpm start

Open http://localhost:3000 with your browser to see the result.

You can start editing the page by modifying pages/index.tsx. The page auto-updates as you edit the file.

API routes can be accessed on http://localhost:3000/api/hello. This endpoint can be edited in pages/api/hello.ts.

The pages/api directory is mapped to /api/*. Files in this directory are treated as API routes instead of React pages.

This project uses next/font to automatically optimize and load Inter, a custom Google Font.

Code Quality

This project uses Biome for linting and formatting:

pnpm lint              # Lint code with Biome
pnpm format            # Format code with Biome
pnpm check             # Lint and format (auto-fix) with Biome
pnpm type-check        # TypeScript type checking
pnpm type-check:watch  # TypeScript type checking in watch mode

Pre-commit hooks automatically run via Husky and lint-staged to ensure code quality.

Docker

Build

docker build -t next-typescript-pwa-starter .

Run

docker run --rm -it -p 3000:3000 next-typescript-pwa-starter

Docker Compose

docker-compose up

Pre-built Images

You can use images available on Docker Hub: next-typescript-pwa-starter

docker pull danangekal/next-typescript-pwa-starter

Learn More

To learn more about Next.js, take a look at the following resources:

You can check out the Next.js GitHub repository - your feedback and contributions are welcome!

Deploy on Vercel

The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.

Check out our Next.js deployment documentation for more details.


Copyright © 2021 by Danang Eko Alfianto