Event Sourcing PoC Sandbox

Sandbox to demonstrate the Event Sourcing Proof of Concept.

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.


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:

  • write/schema.graphql and read/schema.graphql are up to date
  • write/genqlient.graphql and read/genqlient.graphql contain the queries / mutations you want to execute

Then run:

go run github.com/Khan/genqlient write/genqlient.yaml
go run github.com/Khan/genqlient read/genqlient.yaml