Statusphere, but in atcute and SvelteKit
atproto svelte sveltekit drizzle atcute typescript
at trunk 73 lines 1.9 kB view raw view rendered
1# statusphere 2 3a reimplementation of Bluesky's 4[Statusphere example app](https://github.com/bluesky-social/statusphere-example-app), using 5[atcute](https://github.com/mary-ext/atcute) and [SvelteKit](https://svelte.dev). 6 7![screenshot of the web interface](screenshot.png) 8 9## setup 10 111. install dependencies: 12 13 ```sh 14 pnpm install 15 ``` 16 172. set up the environment variables: 18 19 ```sh 20 pnpm env:setup 21 ``` 22 23 this copies the `.env.example` file to `.env` with the following values filled in: 24 - `COOKIE_SECRET` - random secret for signing cookies 25 - `OAUTH_PRIVATE_KEY_JWK` - ES256 keypair for OAuth 26 273. start a [Tap](https://github.com/bluesky-social/indigo/tree/main/cmd/tap) instance: 28 29 ```sh 30 docker run -p 2480:2480 \ 31 -v ./data:/data \ 32 -e TAP_DATABASE_URL=sqlite:///data/tap.db \ 33 -e TAP_SIGNAL_COLLECTION=xyz.statusphere.status \ 34 -e TAP_COLLECTION_FILTERS=xyz.statusphere.status,app.bsky.actor.profile \ 35 ghcr.io/bluesky-social/indigo/tap:latest 36 ``` 37 38 Tap handles subscribing to the atproto firehose, backfilling repos, and filtering events. we set 39 it up such that it'd backfill all repos that have posted a status, and only emits events for 40 status and profile records. 41 42 then configure the Tap connection: 43 44 ```sh 45 TAP_URL=http://localhost:2480 46 47 # if configured with a password 48 TAP_ADMIN_PASSWORD= 49 ``` 50 514. set up a tunnel: 52 53 confidential OAuth clients requires a publicly accessible URL. for local development, you'll need 54 to tunnel your local server using a service like [ngrok](https://ngrok.com/) or 55 [cloudflared](https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/downloads/). 56 57 once running, set the tunnel URL as your public URL in `.env`: 58 59 ```sh 60 OAUTH_PUBLIC_URL=https://your-tunnel-url.example.com 61 ``` 62 635. migrate the database: 64 65 ```sh 66 pnpm db:migrate 67 ``` 68 696. run it! 70 71 ```sh 72 pnpm dev 73 ```