Skip to content

narze/thank-u-nextjs

Repository files navigation

Thank u, Next.js

codecov

Bootstrap a developer-friendly (?) NextJS app configured with:

This template is built from examples/with-tailwindcss-emotion & examples/with-typescript-eslint-jest then added some more sensible packages.

Development Workflow

This boilerplate is carefully built to make TDD workflow in frontend development possible, as you can see a bunch of testing libraries included.

Test-first

Before adding features (components, pages, etc.) you add tests in at least one level:

  • Unit Tests : Jest
  • Integration / e2e Tests : Cypress
  • UI Tests : Storybook

You can add pending tests if the feature is difficult or cannot figure out yet how to test (eg. authentication with Firebase, which is hard to mock) But make sure that you cleanup pending tests quickly before it goes out of control and leaves you with low test coverage.

[rant] You (and your team) will be thankful for the tests later when you decide to refactor or add/switch dependencies, like updating dependencies, switching to Preact, adopting Recoil, trying out the next Next.js, and so on. Well tested codebase will save you from Javascript Fatigue no matter how large or small your project is. [/rant]

Static Analysis

Husky will lint & format the code before commit & push, so the code will be cleaner & easier for review (But please don't add any type everywhere)

CI

Github Actions will run all the tests. See configuration

Projects built with this template

Deploy your own

Deploy the example using Vercel:

Deploy with Vercel

How to use

Using create-next-app

Execute create-next-app with npm or Yarn to bootstrap the example:

npx create-next-app --example https://github.com/narze/thank-u-nextjs my-app
# or
yarn create next-app --example https://github.com/narze/thank-u-nextjs my-app

Deploy it to the cloud with Vercel (Documentation).