Skip to content

Examples ​

The examples/ folder holds small projects that use CodeKasten from the outside, as a customer would: through the GraphQL endpoint, the MCP server or webhooks, with an API key. They share no code with the product.

Project board ​

examples/project-board/ is a web page that lists, filters and creates projects.

The example project board

It is plain HTML, CSS and JavaScript, and a small Node server without dependencies. The server keeps the API key and speaks GraphQL to CodeKasten; the page only ever talks to that server. That is the pattern to copy: the key stays on your server.

browser  ──>  your server (keeps the key)  ──>  CodeKasten /graphql

Running it ​

bash
cd examples/project-board
cp .env.example .env      # put an API key in it
node server.mjs           # http://127.0.0.1:5180

Make the key on a branch that is not protected and that you may change, or the page can read but not create.

What to look at ​

  • queries.mjs: every GraphQL document the page sends, in one place. One request loads a page of projects, their count, and the count per status.
  • server.mjs: the server, about as small as a backend-for-frontend gets.
  • public/: the page.

The page needs nothing from CodeKasten except a type called Project. Point it at another type by changing the documents in queries.mjs.

Every picture on this site was saved by a test that had just seen the feature work.