This is my very own NextJS starter, suitable for my own purposes. Feel free to use it if it suits yours too :)
At the moment it includes:
It also...
- Has a minimal template
- Uses lint-staged to run prettier on pre-commit
- Runs headless Cypress on precommit (keep your tests minimum or move this to your CI/CD pipeline!)
- Has the source code under
/src
(as it should be)
Everything else is (or should be) pretty much standard. For now at least.
npx create-next-app [name] --use-npm --example "https://github.com/carlosgarciamar/nextjs-starter"
Or clone it and run npm install
...
Then npm run dev
.
- Conventional Commits
JestReact testing library
A few good integration tests are in my opinion more valuable for UI development and easy to maintain than loads of unit tests with 1000% coverage. For this reason I have discarded Jest and RTL. Feel free to include them if you need to test specific units in a more targeted approach.
In src
we have pages
and theme
to keep everything quite in the lines of NextJS. Feel free to create components
for reusable components, hooks
for your custom hooks and anything else you might feel that you will need.