DEV Community

Cover image for Next.js starter template
Michaล‚ Skolak
Michaล‚ Skolak

Posted on

Next.js starter template

Hi,
I created a starter template for next.js, it also contains typescript, tailwind, shadcn/ui. I have already written about it here, but I have added some new functionalities such as: Next-auth, Prisma, React-hook-form, T3-env.
Therefore, I would like to ask for feedback and any missing functionalities.
If you liked the project, I will appreciate if you leave a star. ๐ŸŒŸ
https://github.com/Skolaczk/next-starter

Overview

A Next.js starter template, packed with features like TypeScript, Tailwind CSS, Next-auth, Eslint, testing tools and more. Jumpstart your project with efficiency and style.

๐ŸŽ‰ Features

  • ๐Ÿš€ Next.js 14 (App router)
  • โš›๏ธ React 18
  • ๐Ÿ“˜ Typescript
  • ๐ŸŽจ TailwindCSS - Class sorting, merging and linting
  • ๐Ÿ› ๏ธ Shadcn/ui - Customizable UI components
  • ๐Ÿ”’ Next-auth - Easy authentication library for Next.js (GitHub provider)
  • ๐Ÿ›ก๏ธ Prisma - ORM for node.js
  • ๐Ÿ“‹ React-hook-form - Manage your forms easy and efficient
  • ๐Ÿ” Zod - Schema validation library
  • ๐Ÿงช Jest & React Testing Library - Configured for unit testing
  • ๐ŸŽญ Playwright - Configured for e2e testing
  • ๐Ÿ“ˆ Absolute Import & Path Alias - Import components using @/ prefix
  • ๐Ÿ’… Prettier - Code formatter
  • ๐Ÿงน Eslint - Code linting tool
  • ๐Ÿถ Husky & Lint Staged - Run scripts on your staged files before they are committed
  • ๐Ÿ”น Icons - From Lucide
  • ๐ŸŒ‘ Dark mode - With next-themes
  • ๐Ÿ—บ๏ธ Sitemap & robots.txt - With next-sitemap
  • ๐Ÿ“ Commitlint - Lint your git commits
  • ๐Ÿค– Github actions - Lint your code on PR
  • โš™๏ธ T3-env - Manage your environment variables
  • ๐Ÿ’ฏ Perfect Lighthouse score

๐Ÿš€ Deployment

Easily deploy your Next.js app with Vercel by clicking the button below:

Deploy with Vercel

๐ŸŽฏ Getting started

1. Clone this template in one of three ways

  1. Using this repository as template

use-this-template-button

  1. Using create-next-app
   npx create-next-app -e https://github.com/Skolaczk/next-starter my-project-name
Enter fullscreen mode Exit fullscreen mode
  1. Using git clone
   git clone https://github.com/Skolaczk/next-starter my-project-name
Enter fullscreen mode Exit fullscreen mode

2. Install dependencies

npm install
Enter fullscreen mode Exit fullscreen mode

3. Set up environment variables

Create .env file and set env variables from .env.example file.

4. Prepare husky

It is required if you want husky to work

npm run prepare
Enter fullscreen mode Exit fullscreen mode

5. Run the dev server

You can start the server using this command:

npm run dev
Enter fullscreen mode Exit fullscreen mode

and open http://localhost:3000/ to see this app.

โš™๏ธ Scripts overview

The following scripts are available in the package.json:

  • dev: Run development server
  • build: Build the app
  • start: Run production server
  • preview: Run build and start commands together
  • lint: Lint the code using Eslint
  • lint:fix: Fix linting errors
  • format:check: Checks the code for proper formatting
  • format:write: Fix formatting issues
  • typecheck: Type-check TypeScript without emitting files
  • test: Run unit tests
  • test:watch: Run unit tests in watch mode
  • e2e: Run end-to-end tests
  • e2e:ui: Run end-to-end tests with UI
  • postbuild: Generate sitemap
  • prepare: Install Husky for managing Git hooks

๐Ÿค Contribution

To contribute, please follow these steps:

  1. Fork the repository.
  2. Create a new branch.
  3. Make your changes, and commit them.
  4. Push your changes to the forked repository.
  5. Create a pull request.

โค๏ธ Support

If you liked the project, I will appreciate if you leave a star. ๐ŸŒŸ๐Ÿ˜Š

Made by Michaล‚ Skolak

Top comments (0)