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
Lightning is an opinionated collection of packages, utilities and a set of rules for your Next.js 14 project.
- Node.js 18+ and npm
- 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
Recommended installation
To create an app using lightning
, run any of the following three commands and answer the command prompt questions:
npm create lightning-app@latest
yarn create lightning-app
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 Lightning on Vercel in one click:
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.
- 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
.
Licensed under the MIT License, Copyright Β© 2023
See LICENSE for more information.
- Rik Vermeulen (@rikvermeulen_)