Code Monkey home page Code Monkey logo

nextjs-14-template's Introduction

Next Starter

The aim for this starter is to give you a starting point with everything ready to work and launch to production. Web Vitals with 100% by default. Folder structure ready. Tooling ready. SEO ready. SSR ready.

image

⚡️ Stack

Available Scripts

  • yarn dev Next dev
  • yarn start: Next start
  • yarn build: Next build
  • yarn analyze: Generate bundle-analyzer
  • yarn lint: Audit code quality

Styling Performance

In order to improve performance, Styled Components are generated at build time and served with the document generated by Next's Server Side Rendering.

There is already a font preloaded from Google Fonts, Poppins. Using Google Fonts allows Next.js to CSS inline the font at build time.

All of this is happening at _document.tsx

🏁 Tooling

ESLint

ESLint extends eslint-config-airbnb, eslint-config-next, and some accesibility recomendations from eslint-plugin-jsx-a11y.

There are also some opinionated rules you can change at .eslintrc.js.

Prettier

Prettier will be managed using ESLint. For Code Styling the Prettier config at .prettierrc.js will be used.

Some popular settings are already set.

trailingComma: 'es5',
singleQuote: true,
printWidth: 80,
tabWidth: 2,
useTabs: false,
endOfLine: 'lf'

Absolute imports

Absolute imports working with prefix @/ starting from src folder.

"paths": {
  "@/*": ["src/*"],
}

tsconfig.json

Sorting and grouping imports

Imports will be grouped by dependencies, absolute imports (@/*) and relative imports. Also they will be sorted by insensitive ascending order.

This is done using eslint-plugin-simple-import-sort and sort-keys from .eslintrc.js

Validate staged files

On every commit, the staged files will be validated to pass ESLint config.

This is done using husky and lint-staged

  "husky": {
    "hooks": {
      "pre-commit": "lint-staged"
    }
  },
  "lint-staged": {
    "*.{js,jsx,ts,tsx}": "eslint --cache --fix --cache-location ./node_modules/.cache/.eslintcache"
  },

Indexing

/public/robots.txt file already provided allowing indexing.

nextjs-14-template's People

Contributors

anwarhossainsr avatar restyled-commits avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

nextjs-14-template's Issues

Depricated Head Tag

Why are you using the Head tag over exporting metadata? Do you know something I don't, did i miss something?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.