Event Sourcing PoC client
Environment variables
The following environment variable is expected to be set:
ENV
, with value e.g.dev
Running locally
Clone this repo. Note: static files (css/scss/js/img) are stored in the static
dir, but built into the public
dir.
When running for the first time, make sure pnpm
is installed (e.g. using brew install pnpm
or npm install -g pnpm
) and run pnpm install
.
Run:
pnpm run dev
ENV=dev go run main.go
This starts a web server locally on the port specified in the config.
Generating types / functions for GraphQL queries
Make sure that:
- backend/schema.graphql and readmodel/schema.graphql are up to date
- backend/genqlient.graphql and readmodel/genqlient.graphql contain the queries / mutations you want to execute
Then run:
go run github.com/Khan/genqlient backend/genqlient.yaml
go run github.com/Khan/genqlient readmodel/genqlient.yaml