๐ Boilerplate and Starter for Next.js, SASS, Prisma ORM, Next-Auth and TypeScript โก๏ธ Made with developer experience first: Next.js, TypeScript, ESLint, Prettier, Husky, Lint-Staged.
Developer experience first:
- ๐ฅ Next.js 12
- ๐ฆ Integrate with next-auth
- ๐ฆ Integrate with prisma
- ๐จ Integrate with sass
- ๐ Type checking TypeScript
- ๐ฆ Strict Mode for TypeScript and React 17
- โ๏ธ Linter with ESLint (default NextJS, NextJS Core Web Vitals and Airbnb configuration)
- ๐ Code Formatter with Prettier
- ๐ฆ Husky for Git Hooks
- ๐ซ Lint-staged for running linters on Git staged files
- ๐ค SEO metadata, JSON-LD and Open Graph tags with Next SEO
- โ๏ธ Bundler Analyzer
- ๐ฑ๏ธ One click deployment with Vercel or Netlify (or manual deployment to any hosting services)
- ๐ฏ Maximize lighthouse score
- ๐ค i18n Locatization next-translate
- ๐ฆ Integrate with cypress
Built-in feature from Next.js:
- โ Minify HTML & CSS
- ๐จ Live reload
- โ Cache busting
- Minimal code
- SEO-friendly
- ๐ Production-ready
- ๐ Serverless-ready
- Node.js, yarn and npm
Run the following command on your local environment:
git clone --depth=1 https://github.com/bbg/nextjs-boilerplate.git my-project-name
cd my-project-name
yarn install
Then, you can run locally in development mode with live reload:
yarn run dev
Open http://localhost:3000 with your favorite browser to see your project.
โโโ README.md # README file
โโโ cypress # Cypress root folder
โโโ docs # Project document folder
โโโ public # Public folder
โโโ locales # Localization Json files are kept in this folder
โโโ src
โ โโโ components # All Components
โ โโโ hooks # React hooks
โ โโโ pages # Next JS pages
โ โโโ scss # SCSS styles folder
โ โโโ functions # All functions are collected here.
| โโโ types # Global types folder.
โโโ db.prisma # Prisma database schema
โโโ tsconfig.json # TypeScript configuration
โโโ i18n.json # Next-Translation configuration
โโโ cypress.json # Cypress configuration
โโโ next.config.js # Next JS configuration
โโโ netlify.toml # Netlify publish configuration
You can see the results locally in production mode with:
$ yarn run build
$ yarn run start
The generated HTML and CSS files are minified (built-in feature from Next js).
You can create an optimized production build with:
yarn run build:prod
Now, your blog is ready to be deployed. All generated files are located at out
folder, which you can deploy with any hosting service.
โโโ dev # NextJS Development Run
โโโ build # NextJS Build
โโโ build:stats # NextJS Bundle Analyze
โโโ build:types # Types check and build
โโโ start # NextJS Production Start
โโโ export # NextJS Static Export
โโโ clean # .next and out file cleaner
โโโ lint # Eslint Check
โโโ lint:fix # Eslint Check and Fix
โโโ forrmat # Prettier Run
โโโ prepare # Huksy Install
โโโ cy:open # Cypress Browser E2E Testing Run
โโโ cy:run # Cypress Headlesss E2E Testing Run
โโโ prisma:gen # Prisma Generator
โโโ prisma:push # Prisma DB Schema Push
โโโ prisma:studio # Prisma Studio DB Client Open
Clone this repository on own GitHub account and deploy to Netlify:
Deploy this Next JS Boilerplate on Vercel in one click:
Preview the example live on StackBlitz:
Everyone is welcome to contribute to this project. Feel free to open an issue if you have question or found a bug.
Licensed under the MIT License, Copyright ยฉ 2020
See LICENSE for more information.