RomanStakhiv / cs-landing-starter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

Created by JoΓ£o Pedro with the help of many wonderful contributors.

πŸ”΄οΈ Important! Node.js version should be more than 17.5.0 or equal

Features

  • ⚑️ Next.js 12
  • βš›οΈ React 18
  • β›‘ TypeScript
  • πŸ“ ESLint β€” To find and fix problems in your code
  • πŸ’– Prettier β€” Code Formatter for consistent style
  • 🐢 Husky β€” For running scripts before committing
  • πŸš“ Commitlint β€” To make sure your commit messages follow the convention
  • πŸ–Œ Renovate β€” To keep your dependencies up to date
  • 🚫 lint-staged β€” Run ESLint and Prettier against staged Git files
  • πŸ‘· PR Workflow β€” Run Type Check & Linters on Pull Requests
  • βš™οΈ EditorConfig - Consistent coding styles across editors and IDEs
  • πŸ—‚ Path Mapping β€” Import components or images using the @ prefix

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

  • Node.js >= 12.22.0
  • pnpm 7

Directory Structure

  • .github β€” GitHub configuration including the CI workflow.
  • .husky β€” Husky configuration and hooks.
  • public β€” Static assets such as robots.txt, images, and favicon.
  • src β€” Application source code, including pages, components, styles.

Scripts

  • pnpm dev β€” Starts the application in development mode at http://localhost:3000.
  • pnpm build β€” Creates an optimized production build of your application.
  • pnpm start β€” Starts the application in production mode.
  • pnpm type-check β€” Validate code using TypeScript compiler.
  • pnpm lint β€” Runs ESLint for all files in the src directory.
  • pnpm format β€” Runs Prettier for all files in the src directory.

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.

License

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

About

License:MIT License


Languages

Language:HTML 98.0%Language:TypeScript 1.1%Language:JavaScript 0.7%Language:Shell 0.1%Language:SCSS 0.0%