Local Quick Start
1. Start Hasura + PostgreSQL + Node.js backend containers
.envfile based on the
docker-compose -f docker-compose.prod.yml up -d
Hasura Console is now running at http://localhost:8080, exposing the GraphQL endpoint at http://localhost:8080/v1/graphql.
2. Apply migrations and metadata
- Install Hasura CLI
hasura-init.sh. It is a small helper script that handles migrations initial setup. After this initial setup, everything related to migrations and metadata will be handled in the
3. Build the frontend
Change the values in the
/frontend/.env file, if needed. Or create
.env.local file to overwrite.
yarn install && yarn build
The client is a simple static application, bootstraped with create-react-app. Locally, for a quick preview, the application can be served with
cd build && serve. Serve must be installed first (
yarn global add serve).
Please read the Making it yours section, for additional customization options.
Running in production
It is recommended to serve the client SPA and the Hasura instance through a server like Nginx, Caddy, etc.
Here is a starting point for Nginx configuration:
Reverse-proxy the Hasura instance:
The client SPA is static, so Nginx can serve it directly:
The client is a single page application, totally decoupled, the only connection with the backend is the Hasura GraphQL endpoint.
cd frontend && yarn install && yarn start
- Rebuild the images with the development setup
docker-compose -f docker-compose.yml build
- Start containers in development mode
docker-compose -f docker-compose.yml up -d
For development purposes, the container is named
docker logs -f backend_dev in order to see console output while developing.
Any changes to code will be applied automatically.