/lightning

Lightning โšก๏ธ Boilerplate and starter for Nextjs 14, Tailwind CSS 3.3 and TypeScript ๐Ÿš€ Made with developer experience ๐Ÿ“š

Primary LanguageTypeScriptMIT LicenseMIT

header

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:

Deploy with Vercel

๐Ÿ—‚ 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

  1. Fork this repository;
  2. Create your branch: git checkout -b my-awesome-contribution;
  3. Commit your changes: git commit -m 'feat: Add some awesome contribution';
  4. Push to the branch: git push origin my-awesome-contribution.

๐Ÿ“‹ License

Licensed under the MIT License, Copyright ยฉ 2023

See LICENSE for more information.

๐Ÿ‘ค Author