Next.js 13 and Hasura project template.
- Create api/hasura.env , you can use .env.example as a starting point
- Start local hasura instance by running
cd api/ && docker compose up -d
- While in
api/
you can start the Hasura consoleyarn hasura console
- You can access pgadmin4 on http://localhost:5050 login details are in the docker-compose file
When starting from scratch:
- Set the env variable
PG_DATABASE_URL
appropriately. If you copied .env.example, this defaults to the posgres docker container installed with Hasura. Doesn't have to though! - In the Hasura console, click the data tab then connect to existing database
When using the fully configured template:
- Run
yarn hasura metadata apply
to load the latest - Login the the hasura console with
yarn hasura console
- any configuration or database changes will be tracked and can later be applied as migrations or metadata - more information in this doc https://hasura.io/docs/latest/migrations-metadata-seeds/overview/