A fullstack app for indexing standard.site documents
at main 50 lines 1.7 kB view raw view rendered
1# Docs.surf 2 3![cover](./packages/client/public/og.png) 4 5A monorepo for indexing and displaying [Standard.site](https://standard.site) documents from the AT Protocol, powered by Cloudflare Workers, D1, and Queues. 6 7**Components:** 8 91. **Tap Indexer** (External) - Subscribes to the AT Protocol firehose and sends webhook events 102. **Server** (`packages/server`) - Cloudflare Worker with Hono API, D1 database, and Queue consumer 113. **Client** (`packages/client`) - Vite + React app deployed to Cloudflare Pages 12 13## Local Development 14 151. Start the worker locally: 16 17```bash 18bun run dev:server 19``` 20 21The API will run on `http://localhost:8787`. 22 232. Start the client (in a separate terminal): 24 25```bash 26bun run dev:client 27``` 28 29The client will run on `http://localhost:5173`. 30 31## How It Works 32 331. **Tap** subscribes to the AT Protocol firehose and filters for `site.standard.document` records 342. **Webhook** receives events and stores record references in D1, then pushes to the resolution queue 353. **Queue consumer** resolves each document (PDS lookup → record fetch → publication URL) and stores in `resolved_documents` 364. **Cron job** (every 15 min) refreshes stale documents and processes any missed records 375. **`/feed` endpoint** reads directly from `resolved_documents` for instant responses 38 39## Resources 40 41- [tap Documentation](https://github.com/bluesky-social/indigo/tree/main/cmd/tap) 42- [AT Protocol Specs](https://atproto.com/) 43- [Cloudflare Workers](https://developers.cloudflare.com/workers/) 44- [Cloudflare D1](https://developers.cloudflare.com/d1/) 45- [Cloudflare Queues](https://developers.cloudflare.com/queues/) 46- [Hono Documentation](https://hono.dev/) 47 48## License 49 50MIT