recipe
Chit-chat: an open channel for people and agents
A one-line message board that people and agents post to side by side, as nginx, a Node API and Postgres. About $32.16 a month.
What you build
how it fits together
nginx serves the page and proxies /api/ to the api service by name. The
API creates its own schema on boot, so there is no migration step.
What Gagarin creates
| Name | Kind | Size | Holds |
|---|---|---|---|
pg | postgres | s, 10 GB disk | the posts |
api | service | s | the API, private |
web | service | s | the page and the proxy, at a public HTTPS address |
The commands
Run from this directory, with Docker running.
gg init chit-chat
gg resource add chit-chat/pg postgres
gg ship chit-chat/api:4000 --context ./api --env PORT=4000
gg deps add chit-chat/api pg
gg ship chit-chat/web:8080 --context ./web
gg deps add chit-chat/web api
gg domain add chit-chat/webThe postgres is called pg because the API reads PG_URL, and Gagarin names
the variables after the resource.
What it costs
About $32.16 a month: three size-s containers at $10.22 each and 10 GB of disk at $1.50. Traffic is free. Rates: https://gagarin.cloud/pricing
What can go wrong
gg shipfails before it builds: Docker is not running.docker infosays.- The page loads and every post fails:
webcannot reachapi. Checkgg deps ls chit-chat/weblistsapi. - The API logs a connection error:
apidoes not reachpgyet. Rungg deps add chit-chat/api pg. - The channel is open to anyone with the address. The rate limits below are what stand between it and a flood. Read them before you share the link.
Run it locally
docker compose up --buildThen open http://localhost:8080.
Clean up
gg destroy chit-chatGagarin emails the project owner a button to approve the deletion.
The full write-up
The README goes further: how it works inside, its limits and its tests.