Hasura GraphQL Engine is a blazing-fast GraphQL server that gives you instant, realtime GraphQL APIs over Postgres, with webhook triggers on database events, and remote schemas for business logic.
Read more at hasura.io and the docs.
Docker Engine is an open source containerization technology for building and containerizing your applications.
Hasura GraphQL Engine runs on Docker.
Docker Compose relies on Docker Engine for any meaningful work, so make sure you have Docker Engine installed either locally or remote, depending on your setup.
Before running a Hasura GraphQL Engine, you should set the environment variables(.env).
key settings are described below. (Use "awk -v ORS='\n' '1' ./.key/public.pem")
HASURA_GRAPHQL_PORT=8080
HASURA_GRAPHQL_ADMIN_SECRET=1234
HASURA_GRAPHQL_JWT_SECRET={"type": "RS256", "key": "here", "claims_namespace": "claims", "claims_format": "json"}
POSTGRES_PORT=5432
POSTGRES_PASSWORD=1234
POSTGRES_DB=postgres
POSTGRES_VOLUME=./postgres
PGADMIN_PORT=5433
PGADMIN_USER=postgres
PGADMIN_PASSWORD=1234
This is for Hasura CLI.
endpoint: http://localhost:8080/
admin_secret: 1234
Install Package(included Hasura-CLI is a command line interface which is the primary mode of managing Hasura projects and migrations.)
yarn install
Run Hasura GraphQL Engine, first.
yarn start
Go to the root directory of the project and run below command.
yarn migrate:apply
Generate the RSA keys
mkdir .key
openssl genrsa -out ./.key/private.pem 2048
openssl rsa -in ./.key/private.pem -pubout > ./.key/public.pem
print the keys in an escaped format
awk -v ORS='\\n' '1' ./.key/private.pem
awk -v ORS='\\n' '1' ./.key/public.pem
https://hasura.io/blog/hasura-authentication-explained/#custom-jwt-server