# 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.

Source: https://github.com/gagarin-cloud/recipes/tree/main/chit-chat
Costs about $32.16 a month. Checked 2026-10-22.

## Paste this into your coding agent

```
Deploy the chit-chat recipe from https://github.com/gagarin-cloud/recipes to Gagarin Cloud. Follow https://gagarin.cloud/recipes/chit-chat
```

## What you build

- `web` (service, nginx, :8080, public address) → `api`
- `api` (service, node, :4000, private) → `pg`
- `pg` (Postgres, 10 GB disk)

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/web
```

The 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 ship` fails before it builds: Docker is not running. `docker info` says.
- The page loads and every post fails: `web` cannot reach `api`. Check
  `gg deps ls chit-chat/web` lists `api`.
- The API logs a connection error: `api` does not reach `pg` yet. Run
  `gg 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 --build
```

Then open http://localhost:8080.

## Clean up

```
gg destroy chit-chat
```

Gagarin emails the project owner a button to approve the deletion.

## The full write-up

The [README](https://github.com/gagarin-cloud/recipes/blob/main/chit-chat/README.md) goes further: how it works inside, its limits and its tests.
