-
Setup your
.env
file, see.env.sample
for example:PG_DATABASE_URL
: The postgres url to connect to your local postgres db. Replacelocalhost
withhost.docker.internal
if you're running locally.NODE_ENV
: Set todevelopment
if running the frontend locally via http, which will disablesecure
for SIWS cookie.HASURA_GRAPHQL_ADMIN_SECRET
: A password used to access your hasura instance. Can be any string.HASURA_GRAPHQL_JWT_SECRET
: A json object containing your JWT secret's algo and key. see.env.sample
-
Run
docker compose up --build -d
to build and start the services. -
(Optional) Run
cd hasura && hasura console --admin-secret "{{HASURA_GRAPHQL_ADMIN_SECRET}}"
to start a Hasura dev console. Only changes made via your Hasura dev console will update your localhasura
dir with all the relevant Hasura generated files that can later be used to update prod.
- Hasura Console: Hasura console is accessible at
http://localhost:8080
. DO NOT change anything directly from the console. - Hasura Graphql Endpoint: Check Hasura console for the graphql endpoint that the frontend can use to query data.
- SIWS: SIWS service needs to bind browser session with the client, and hence should reduce any proxy, including Hasura Action. Therefore, the frontend should access SIWS service directly at
http://localhost:3031
. - Hasura Dev Console: Check your terminal where you execute
hasura console --admin-secret ...
command. Hasura dev console is typically accessible athttp://localhost9695
.
.
|-- ...
|-- hasura # hasura generated files (e.g. metadata, migrations, config)
|-- services # contains all services. In the future, we will have things like notification service
| |-- actions-service # node JS app that exposes APIs for Hasura actions, mainly to perform data validation and custom business logic
| |-- siws-service # independent SIWS service that in the future can be extracted out of the repo and hosted on serverless functions
|__ ...