Skip to content

diagrid-labs/catalyst-place

Repository files navigation

Place

Place web frontend

Place is a basic drawing application powered by Diagrid Catalyst that tries to replicate some functionality from the famous r/place event. Still very rough but a minimally usable version is being hosted here.

It is a Go application that:

  • Keeps it's state in a state store
  • Keeps a cooldown timer on a different state store
  • Uses a websocket connection to broadcast changes to the clients
  • Uses pubsub to broadcast changes across the replicas

Setup

diagrid login 
  • List the organization you're onboarded to.
diagrid orgs list
  • Create a catalyst project with managed State store and PubSub
diagrid project create place --deploy-managed-kv --deploy-managed-pubsub
  • Create a catalyst appid
diagrid appid create frontend
  • After a few seconds, you should see both your project and appid in the Ready state.
diagrid project list
diagrid appid list

Creating the canvas component

  • Log into a free managed PostgreSQL provider like Neon or ElephantSQL and create a database. Obtain the connection string and use it to create a component.
diagrid component create canvas --type state.postgresql --metadata connectionString=<connection string>

Running the application

  • Build It
make build
diagrid login 
  • Generate diagrid configuration
diagrid dev scaffold
  • Update the generated dev-place.yaml with the following:
  workDir: .
  command: ["./bin/frontend"]
  • Run it
diagrid dev start
  • Open the browser and navigate to http://localhost:8080

  • Enter your name and start drawing on the canvas pixel by pixel.

Place web frontend

  • Use the Catalyst web dashboard to monitor the application.

Catalyst Call Graph

Catalyst API Logs

More information

Want to know more about the capabilities that Catalyst offers? Read it on our Diagrid website.