A clean and ready-to-go Next.js starter template with TypeScript, ESLint, Prettier, testing tools, and a few essential libraries pre-installed — so you can focus on building your app instead of configuring tools from scratch.
This template comes pre-configured with:
- ⚡️ Next.js — React framework with SSR and file-based routing
- ⚛️ React — for building UI
- 🧠 TypeScript — static typing
- 🎨 Tailwind CSS — utility-first CSS framework
- 🧹 ESLint — linting setup with custom rules
- ✨ Prettier — code formatting
- 🧪 Vitest — unit testing
- 🧫 Testing Library — testing React components
- 🧭 Playwright — end-to-end testing
- 🪝 Lefthook — Git hooks runner
- 🔎 Path aliases — use "~/..." instead of relative paths
- ✅ PR workflow — lint, type check, and tests before merging
You can create a new Next.js app using this template with the following command:
# pnpm
pnpm create next-app -e https://github.com/joaogabriel-sg/next-templateAfter finishing the installation, navigate to the project directory and run the setup script:
cd my-next-app
pnpm setup:projectTo start the Next.js development server, run:
pnpm devThe app will be available at http://localhost:5173 by default.
pnpm setup:project— install deps and enable git hookspnpm dev— start development serverpnpm build— create production buildpnpm start— start production serverpnpm lint— run ESLintpnpm format— run Prettierpnpm format:check— check Prettier formattingpnpm typeCheck— run TypeScript checkspnpm test:unit— run unit tests (Vitest)pnpm test:unit:watch— watch modepnpm test:unit:coverage— run unit tests with coveragepnpm test:unit:coverage:watch— watch mode + coveragepnpm test:e2e— run Playwright e2e testspnpm test:e2e:ui— run e2e tests with UIpnpm test:e2e:report— show test coverage reportpreinstall— prevent installing with npm or yarn, use pnpm instead
To improve DX and avoid long relative imports like ../../../components, this project uses a path alias:
import { Button } from "~/components/ui/Button";The alias is configured in:
tsconfig.json— for TypeScript configurationnext.config.js— for Next.js configuration
This project is licensed under the MIT License - see the LICENSE file for more information.