Hasura Next.js Boilerplate is a boilerplate for building applications using Hasura and Next.js. This boilerplate consists of the following:
Overview
This boilerplate is built using the following technologies:
It supports GraphQL Query, Mutation and Subscription out of the box.
Requirements
Packages
- Frontend: Next.js application
This application is the primary user-facing application. Once it’s up and running (see Development section), it’s available on http://localhost:3000.
- Backend: Dockerized Hasura application
Hasura is an open source engine that connects to our databases & micro-services and auto-generates a production-ready GraphQL backend. It’s very easy to get Hasura up and running on our local system. All the migrations are set up in the migrations directory.
Installation
- Clone the application.
git clone https://github.com/ghoshnirmalya/nextjs-hasura-boilerplate
- Run the bootstrap script by running the following command from the root of your project:
yarn bootstrap
Create a Google OAuth Client from https://console.developers.google.com/apis/credentials/oauthclient and copy the credentials to
GOOGLE_CLIENT_ID
andGOOGLE_CLIENT_SECRET
in your.env
file inside thefrontend
directory.Run both the applications by running the following command from the root of your project:
yarn dev
We need to start Docker and then run the above command. The Hasura server will be up and running on http://localhost:8080/v1/graphql.