jpedroschmitz / typescript-nextjs-starter

Non-opinionated TypeScript starter for Next.js. All the tools you need to build your next project ⚡️
https://next-ts.joaopedro.dev
MIT License
1.2k stars 141 forks source link
hacktoberfest nextjs react starter typescript

Next.js TypeScript Starter


Non-opinionated TypeScript starter for Next.js
Highly scalable foundation with the best DX. All the tools you need to build your next project.


PRs welcome! License Follow @jpedroschmitz
Created by João Pedro with the help of many wonderful contributors.


Features

Quick Start

The best way to start with this template is using Create Next App.

# yarn
yarn create next-app -e https://github.com/jpedroschmitz/typescript-nextjs-starter
# npm
npx create-next-app -e https://github.com/jpedroschmitz/typescript-nextjs-starter
# pnpm
pnpm create next-app -e https://github.com/jpedroschmitz/typescript-nextjs-starter

Development

To start the project locally, run:

pnpm dev

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

Testimonials

“This starter is by far the best TypeScript starter for Next.js. Feature packed but un-opinionated at the same time!”
— Arafat Zahan

“I can really recommend the Next.js Typescript Starter repo as a solid foundation for your future Next.js projects.”
— Corfitz

“Brilliant work!”
— Soham Dasgupta

Showcase

List of websites that started off with Next.js TypeScript Starter:

Documentation

Requirements

Directory Structure

Scripts

Path Mapping

TypeScript are pre-configured with custom path mappings. To import components or files, use the @ prefix.

import { Button } from '@/components/Button';
// To import images or other files from the public folder
import avatar from '@/public/avatar.png';

Switch to Yarn/npm

This starter uses pnpm by default, but this choice is yours. If you'd like to switch to Yarn/npm, delete the pnpm-lock.yaml file, install the dependencies with Yarn/npm, change the CI workflow, and Husky Git hooks to use Yarn/npm commands.

Note: If you use Yarn, make sure to follow these steps from the Husky documentation so that Git hooks do not fail with Yarn on Windows.

License

This project is licensed under the MIT License - see the LICENSE.md file for more information.