Spend more time building instead of configuring your next project.
This is a slightly opinionated starter kit for developing Next.js apps. It uses the Joy UI library from MUI along with the Apollo stack. All GraphQL are operations are fully typed with GraphQL Codegen and Zeus. The starter kit also includes a fully functional authentication system, localization, and outputs a progressive web app, plus plenty of other goodies for a great developer experience right out of the box.
π Hello there! Follow me @linesofcodedev or visit linesofcode.dev for more cool projects like this one.
To get started clone the repo. Using npx degit
is a great way to get this done quickly as it will remove the .git
folder plus extra files like the LICENSE.md
or this very README.md
file.
npx degit TimMikeladze/next-apollo-joy-starter my-app
cd my-app && git init
yarn && yarn dev
Once cloned just install all dependencies with yarn
and you are ready to go. Happy coding!
β Important note: This project uses yarn for managing dependencies. If you want to use another package manager, remove the
yarn.lock
and control-f for usages ofyarn
in the project and replace them with your package manager of choice.
Remaining simple at its core, this project is packed with useful tools that enhance your experience while working with Next.js. Here is a list of the main features:
- π Next Auth - A complete open source authentication solution for Next.js applications. It is designed from the ground up to support Next.js and Serverless.
- π Apollo client and server - Apollo is a great way to build your GraphQL stack. It comes with a great community and a lot of features out of the box such as caching, query batching, and more.
- π€ Zeus + GraphQL Codegen - Type-safety anywhere GraphQL is used.
- π Joy UI - Joy UI is a library of beautifully designed React UI components built to spark joy in the development process.
- π Dark mode - Switch between light and dark mode with a single click.
- π React Hot Toast - The best toast in town. Smoking hot React notifications.
- π i18next - The easiest way to translate your NextJs apps.
- π Next SEO - The easiest way to add SEO support to your Next.js app.
- π± Next PWA - Zero config PWA plugin for Next.js, with workbox.
- πͺ΅ Axiom logging - Send structured logs directly from your code and query, stream, & analyze. Learn more.
- π Storybook - Build UI components and pages in isolation. It streamlines UI development, testing, and documentation.
- π Apollo Sandbox - A free, in-browser GraphQL IDE for exploring your schema and making queries.
- π§ͺ Jest - A testing framework for JavaScript. Preconfigured to work with TypeScript and JSX.
- π Run tests via Github Actions - CI/CD workflows for your package. Run tests on every commit plus integrate with Github Releases to automate publishing package to NPM and Storybook to Github Pages.
- π Bundle analyzer - Visualize the size of Next.js build output files with an interactive zoomable treemap.
- βοΈ ESLint - A linter for JavaScript. Includes a simple configuration for React projects based on the recommended NextJS ESLint config.
- π¨ Prettier - An opinionated code formatter.
- π« lint-staged β Run linters on git staged files
- πΆ Husky β Running scripts before committing.
- π Commit-it β A CLI tool to help you write stylish commit messages.
- πΌ Release-it - release-it is a command line tool to automatically generate a new GitHub Release and populates it with the changes (commits) made since the last release.
- ποΈ Renovate - Universal dependency update tool that fits into your workflows. Configured to periodically check your dependencies for updates and send automated pull requests.
Start the Next.js development server and watch GraphQL files for code generation.
yarn dev
Need to test your GraphQL queries or explore your schema? Use Apollo Sandbox by visiting http://localhost:3000/api/graphql in your browser.
Working on the UI? Start Storybook to develop components in isolation.
yarn storybook
Run tests when changes are detected.
yarn test:watch
Or simply run all the tests
yarn test
When you are ready to commit simply run the following command to get a well formatted commit message. All staged files will automatically be linted and fixed as well.
yarn commit
Create a semantic version tag and publish to Github Releases. As part of this process a git tag will also be created on the current branch.
Learn more about how to use the release-it
command here.
yarn release
This project can be deployed anywhere where Next.js can run. I suggest using Vercel with the GitHub integration to quickly deploy an app to production.
If you want to build your app for production on your local machine, within a container, etc, simply run the following command:
yarn build
To analyze the page bundles of your Next.js app, run the following command:
yarn build:analyze
This project is configured to be a PWA out of the box, it just needs a few more steps from you to be production ready. Add your image assets and define your manifest files. Start by following the instructions here.
This project is designed to be a starting point for your project. Each of its features has a small footprint and can be easily removed or replaced with your own.
For example you easily replace Joy UI with Tailwind CSS with minimal effort while keeping the rest of the starter-kit intact.
That's awesome! Please feel free to open a PR and add your project to the list below.