Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
React, Apollo, Next.js, GraphQL, Node.js, TypeScript high-performance boilerplate with React hooks and automatic static type generation.
Next React GraphQL Apollo Hooks is a high-performance boilerplate for building Next.js websites with React, Apollo Client, and a GraphQL server, including automatic static type generation via GraphQL Code Generator. It is maintained by Atheros Intelligence and used as the foundation for their production projects and educational content on GraphQL Mastery.
This template is a starter kit that combines Next.js, React, GraphQL (Apollo Server), Apollo Client, React Apollo Hooks, Node.js, TypeScript, GraphQL Code Generator, and Jest. It takes a fresh clone of a repository and produces a working full-stack setup with a GraphQL API endpoint at /graphql and type-safe React components, ready for further development. The project is not meant to be a complete solution but an introduction to building high-performance websites with these technologies.
CUSTOM_ENV to load the appropriate .env file from a secrets folder, keeping environment-specific settings separate.package-lock.json so you can run npm audit to check for dependency vulnerabilities./graphql and define resolvers with Apollo Server, then have TypeScript types generated automatically from the schema..env files in the secrets folder and use npm audit to maintain dependency security.Clone the repository with git clone [email protected]:atherosai/next-react-graphql-apollo-hooks.git, then install dependencies using npm ci (recommended to preserve the locked package-lock.json). For environment setup, create files like /secrets/production-staging.env containing variables such as NODE_ENV, CUSTOM_ENV, PORT, API_URL, and HOST; the dotenv library loads the correct file based on the two environment variables.
The package.json specifies an engines field that requires Node.js version 10 or newer and npm version 6 or newer. The author recommends using the latest Node.js LTS version, even though older versions should work.
Use npm ci instead of npm install to preserve the secure dependencies recorded in package-lock.json. This ensures a clean and reproducible installation.
Environment variables are managed with dotenv. The combination of NODE_ENV (development or production) and CUSTOM_ENV (such as local, staging, or production) determines which .env file in the /secrets directory is loaded. For example, NODE_ENV=development CUSTOM_ENV=local loads /secrets/development-local.env.
Yes, the repository includes package-lock.json, so you can run npm audit to identify and fix vulnerable dependencies.
