This is a new project similar to Avalon Nodejs Ver. Since this version uses Hasura as backend, you can deploy the frontend on any edge runtime (eg. Vercel)
The frontend uses GraphQL subscription to get realtime updates from Hasura server so that we can easily synchronize states across multiple browsers
- Hasura
- Hasura cloud or
- Self hosted with PostgreSQL Database
- Node.js 16+
- pnpm
-
Create a Hasura instance, either from Hasura cloud or self hosted
-
Install Hasura CLI
-
Initialize Hasura instance:
-
Change hasura/config.yaml to your hasura endpoint/admin-secret in config.yaml
version: 3 endpoint: Your Hasura Endpoint # eg. https://xxx.hasura.app admin_secret: Your Hasura Admin Secret metadata_directory: metadata actions: kind: synchronous handler_webhook_baseurl: http://localhost:3000
-
Run hasura migration and initialization
cd ./hasura hasura migration apply # apply scheme/db migrations hasura metadata apply # apply hasura metadata hasura seed apply # apply initial data seed
-
Ensure you have configure HASURA_GRAPHQL_UNAUTHORIZED_ROLE environment variable as player in your hasura cloud dashboard or docker runtime
-
-
prepare .env file under workspace root folder for nodejs usage
uri="Your Hasura GraphQL Endpoint" # without protocol, eg: xxx.hasura.app/v1/graphql hasura_admin_secret="Your Hasura Admin Secret"
-
Run dev script
pnpm i pnpm dev
-
Generate GraphQL type
pnpm gen
-
Make sure your environment variables equivalent to .env file is configured in your server runtime
(eg. Config Environment Variables on Vercel Dashboard)
-
Run script
pnpm i pnpm build pnpm start
- Internationalization - Currently support Chinese/English