MeowMeowBeenz on the Atmosphere
Files
README.md

MeowMeowBeenz #

Check it out at https://meowmeowbeenz.net! #

A working implementation of the social network from Community S5E8 ("App Development and Condiments"), built on the AT Protocol.

Everyone gets a number from 1 to 5. The number is a weighted average of every rating you've received: highly-rated raters' votes count more, like in the show. A 5 is royalty. A 1 is an outcast. Your ratings live in your own PDS — this site is just an appview that indexes them.

Architecture #

Two binaries, one Postgres database:

  • cmd/server — web app. Atproto OAuth login, profile pages, rating submission. When a user submits a rating it does com.atproto.repo.createRecord against their PDS using their OAuth session. Old ratings from the same user→subject pair are deleted first so each pair has at most one live record on the network at a time.

  • cmd/ingest — jetstream consumer. Subscribes to the public Bluesky jetstream filtered to net.meowmeowbeenz.rating commits and indexes every create/update/delete into Postgres. This is what builds the appview's view of "who has been rated what" across the entire network.

The two binaries share internal/db. They don't talk to each other — the server writes to the network, the ingester reads it back.

┌──────────┐ OAuth+create   ┌─────────┐                 ┌────────────┐
│  server  │────────────────▶│  user's │ ──> firehose ──▶│  jetstream │
└──────────┘                 │   PDS   │                 └─────┬──────┘
     ▲                       └─────────┘                       │
     │                                                         │
     │ reads aggregates                                        ▼
     │                                                  ┌──────────┐
     └──────────────────────────────────────────────────│  ingest  │
                          Postgres ◀────────────────────│ (this)   │
                                                        └──────────┘

The lexicon #

lexicons/net/meowmeowbeenz/rating.json — a single record type:

{
  "$type":     "net.meowmeowbeenz.rating",
  "subject":   "did:plc:abc...",   // who you're rating
  "value":     5,                   // 1..5
  "createdAt": "2026-05-05T17:30:00Z"
}

Anyone implementing a competing appview just needs to consume the same NSID off the firehose.

Local development #

You'll need:

  • Go 1.26+
  • Postgres (any recent version)
# 1. database (just create it; the server runs migrations on startup)
createdb meowmeowbeenz

# 2. env
cp .env.example .env
# edit .env — at minimum set DATABASE_URL and SESSION_SECRET
#   SESSION_SECRET=$(openssl rand -hex 32)
# leave CLIENT_HOSTNAME blank for localhost dev mode

# 3. dependencies
go mod download

# 4. run the web app on :8080 — applies pending migrations, then serves
go run ./cmd/server

# 5. (in another terminal) start indexing the firehose
go run ./cmd/ingest

Schema migrations live in migrations/*.sql and are applied automatically on cmd/server startup. Versions are tracked in a schema_migrations table and a Postgres advisory lock prevents two boots from racing. Add a new migration by dropping a NNNN_description.sql file in that directory — the next server start will pick it up.

Visit http://127.0.0.1:8080 and log in with any Bluesky handle. In localhost dev mode the OAuth client metadata is synthesised — you don't need a public hostname.

Configuration #

All configuration is via environment variables. .env.example lists the ones the server and ingester read.

Var Default Notes
DATABASE_URL required Postgres DSN.
SESSION_SECRET required 32 bytes, hex. openssl rand -hex 32.
BIND :8080 Listen address.
CLIENT_HOSTNAME empty Public hostname (e.g. meow.example.com). Empty = localhost dev mode.
CLIENT_SECRET_KEY empty P-256 private multibase. Enables confidential-client OAuth mode.
CLIENT_SECRET_KEY_ID primary Key ID for JWKS.
JETSTREAM_URL wss://jetstream2.us-east.bsky.network/subscribe Override to point at your own jetstream.
BSKY_APPVIEW_URL empty Bluesky AppView base URL; empty uses the public default.

Deploying with Docker #

The deploy/ directory has a multi-target Dockerfile, a docker-compose file, and lifecycle scripts that wrap a tarball-based deploy. The compose file builds both binaries from one source tree and brings up postgres + server + ingest.

One-time host setup:

# Pick any directory on the host to hold config + tarballs.
mkdir -p /srv/meowmeowbeenz
cd /srv/meowmeowbeenz

# Drop config files at the host level — they persist across deploys.
cp /path/to/repo/deploy/.env.example .env
$EDITOR .env                              # set POSTGRES_PASSWORD, SESSION_SECRET, CLIENT_HOSTNAME, etc.
cp /path/to/repo/deploy/docker-compose.yml .

# Copy the lifecycle scripts somewhere on PATH (or just leave them here).
cp /path/to/repo/deploy/up_appview.sh    .
cp /path/to/repo/deploy/down_appview.sh  .
chmod +x up_appview.sh down_appview.sh

Each deploy:

# locally — produces meowmeowbeenz-<sha>.tar.gz
./deploy/make_tarball.sh

# ship it (replace destination with your host + deploy dir)
scp meowmeowbeenz-*.tar.gz user@host:/srv/meowmeowbeenz/

# on the server
cd /srv/meowmeowbeenz
./up_appview.sh                           # extracts, builds, brings up, waits for health

up_appview.sh and down_appview.sh read MEOW_DEPLOY_DIR from the environment to locate the host's .env, docker-compose.yml, and repo/ directory. If unset, they default to the current working directory — so running them from inside the deploy directory works without configuration.

The up script extracts the tarball into repo/, symlinks .env and docker-compose.yml into repo/deploy/, runs docker compose build --pull and up -d --force-recreate, and blocks until the server service reports healthy on /healthz (which actually pings Postgres). It prints a deploy receipt with the image SHA and container ID so you know exactly what landed.

down_appview.sh brings the stack down and wipes repo/, leaving the named meow-pgdata volume alone. To wipe data too, run docker compose down -v explicitly first — -v is dangerous enough to be deliberate.

Networking. By default the server publishes its port at 127.0.0.1:8359 on the host so a reverse proxy (Caddy, nginx, etc.) on the same machine can forward to it. Override SERVER_HOST_BIND in .env to expose elsewhere (e.g. 0.0.0.0:8359 for direct exposure, or a specific interface IP).

If you prefer to attach the server container to an existing reverse-proxy docker network instead of host-port mapping, drop a docker-compose.override.yml next to docker-compose.yml:

services:
  server:
    networks: [internal, proxy]
    ports: !reset []
networks:
  proxy:
    external: true
    name: your-proxy-network

The proxy can then reach the container at meow-server:8359.

What's missing / "v2" ideas #

  • Visualise score distribution / time-series of someone's score.
  • A feed generator (app.bsky.feed.generator) that filters Bluesky posts by author rating tier. "Posts from 5s only."
  • "Gulag" mode: when your score drops below some threshold you get rate-limited from rating others. This is from the episode and honestly fits perfectly.

Credits #

License #

MIT — see LICENSE.