Lightning
Boilerplate and building blocks for your Next project
Get started with lightning by running npm create lightning-app@latest
Introduction ยท Tech Stack + Features ยท One-click Deploy ยท Author
๐ Introduction
Lightning is an opinionated collection of packages, utilities and a set of rules for your Next.js 14 project.
Requirements
- Node.js 18+ and npm
๐ Features
- Next.js 14
- Type checking TypeScript
- Integrate with Tailwind CSS
- Strict Mode for TypeScript and React 18
- Linter with ESLint (default NextJS, NextJS Core Web Vitals, Tailwind CSS and Airbnb configuration)
- Code Formatter with Prettier
- Husky for Git Hooks
- Lint-staged for running linters on Git staged files
- Run tests on pull request with GitHub Actions
- Absolute Imports using
@
prefix - VSCode configuration: Debug, Settings, Tasks and extension for PostCSS, ESLint, Prettier, TypeScript
- Fonts with Next/font for optimizing custom fonts and remove external network requests
๐จ๐ปโ๐ป Getting started
Recommended installation
To create an app using lightning
, run any of the following three commands and answer the command prompt questions:
npm
npm create lightning-app@latest
yarn
yarn create lightning-app
pnpm
pnpm create lightning-app@latest
Default installation
Or run the following command on your local environment:
git clone --depth=1 https://github.com/rikvermeulen/lightning.git project-name
cd project-name
npm install
Copy .env.example
to .env.local
and update the variables.
cp .env.example .env.local
Then, you can run locally in development mode:
npm run dev
Open http://localhost:3000 with your favorite browser to see your project.
โโโ .husky # Husky configuration
โโโ .vscode # VSCode configuration
โโโ src # Project folder
โ โโโ app # App base
โ โ โโโ api # Api router
โ โโโ components # Default components
โ โโโ lib # Lib folder
โ โโโ styles # Styles folder
โ โโโ types # Types folder
โ โโโ env.mjs # type-safe env
โ โโโ middleware.ts # Middleware file
โโโ public # Public assets folder
โ โโโ favicons # Favicons folder
โโโ tailwind.config.cjs # Tailwind CSS configuration
โโโ next.config.mjs # Next configuration
โโโ tailwind.config.cjs # Tailwind CSS configuration
โโโ prettierrc.cjs # Prettier configuration
โโโ README.md # README file
โโโ .eslintrc.cjs # Eslint config
โโโ tsconfig.json # TypeScript configuration
๐ Deploy
Deploy Lightning on Vercel in one click:
๐ VSCode information (optional)
For VSCode users, you can have a better integration with VSCode by installing the suggested extension in .vscode/extension.json
. The starter code comes up with Settings for a seamless integration with VSCode. The Debug configuration is also provided for frontend and backend debugging experience.
With the plugins installed on your VSCode, ESLint and Prettier can automatically fix the code and show you the errors. Same goes for testing, you can install VSCode Jest extension to automatically run your tests and it also show the code coverage in context.
๐ค Contributing
- Fork this repository;
- Create your branch:
git checkout -b my-awesome-contribution
; - Commit your changes:
git commit -m 'feat: Add some awesome contribution'
; - Push to the branch:
git push origin my-awesome-contribution
.
๐ License
Licensed under the MIT License, Copyright ยฉ 2023
See LICENSE for more information.
๐ค Author
- Rik Vermeulen (@rikvermeulen_)