Awesome
Hasura Typescript Boilerplate
Boilerplate templates
This is project template for Hasura v2.0 that is in beta stage. Use at your risk.
The auto-migration and CLI are v3. You need to download directly from Github releases page
NOTE: These templates are in sample repository. You should checkout which feature you need (JWT, Firebase). master
branch contains clean structure, so there aren't any migration.
- Base Project
- JWT Authentication
- Firebase Authentication
- Extras
- With Remote Schemas: From Hasura 1.2.0, remote schema can be replaced with Action. So
remote-schemas
is remove from main branches
Project Structure
services/auth
: Authentication webhookservices/data
: Hasura GraphQL project with migrationsservices/events
: Event triggersservices/actions
: Hasura actions
Database design and migration
Use Hasura CLI: https://docs.hasura.io/1.0/graphql/manual/hasura-cli/install-hasura-cli.html#install
- Design: go to
services/data
, then run
hasura console --admin-secret [secret] --endpoint [endpoint]
- Migrate:
hasura migrate apply --admin-secret [secret] --endpoint [endpoint]
How to Run
-
Copy
dotenv
file to.env
and edit configuration if necessary -
Use Docker with docker-compose
# start development dockers
make dev
# because docker caches built images, when changing packages, we need to rebuild containers
make dev-build
- For Test/Production environment, use
docker-compose.test.yaml
ordocker-compose.prod.yaml
config file. It requiresgcplogs
driver (read below), or you can remove it if using another logging services
make staging
# or
make prod