Giter Site home page Giter Site logo

p10racing's Introduction

ThankYouNext ๐Ÿ–ค

This Next.js starter template is meant to be easy to use, fun to work with and very performant. It was bootstrapped with create-next-app and has the following features, among others:

Table of contents

1. General

It's all pretty straightforward and comes with features I would expect from a modern Jamstack website. I also added a few measures to ensure good code hygiene. Therefore, besides TypeScript and React strict mode, this template includes a Git hook that executes yarn lint && yarn tsc before the commit.

2. Styling

Tailwind CSS is hotly and controversially discussed in the developer scene, which is why it caught my interest. However, you should have basic knowledge of CSS to be able to use it easily and quickly. For this I can highly recommend Learn CSS! I personally write less CSS code and can implement things faster with Tailwind CSS, but if you don't like it, you can always switch to classic CSS, respectively SASS.

3. Performance

If you like the component-based approach of React but want to build fast, simple static websites, there's an interesting feature in Next.js:

export const config = {
  unstable_runtimeJS: false,
}

This code snippet must be used on the respective page in the pages folder to disable client-side JavaScript. Disadvantage: Features like React Hooks or next/image won't work then!

This template also uses Preact, which has the same features but a smaller file size than React. If you prefer to use React, remove the following line of code in next.config.js:

const withPreact = require('next-plugin-preact')

Next, the withPreact wrapper must be removed from module.exports:

// With Preact:
module.exports = withPreact({
  reactStrictMode: true,
  async headers() {
    return [
      {
        source: '/(.*)',
        headers: securityHeaders,
      },
    ]
  },
})

// Without Preact:
module.exports = {
  reactStrictMode: true,
  async headers() {
    return [
      {
        source: '/(.*)',
        headers: securityHeaders,
      },
    ]
  },
}

4. Security

I have added a few security headers according to the Next.js documentation. Content-Security-Policy is a bit tricky to configure, which is why I didn't add it so you can adjust it to your liking.

5. SEO

The Meta component contains all the content needed for great SEO results. It has predefined props which you can configure anyway you want.

p10racing's People

Contributors

matheuslemke avatar

Watchers

 avatar  avatar

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.