···11+# Lewis' BS PDS Sandbox
22+33+When I'm actually done then yeah let's make this into a proper official-looking repo perhaps under an official-looking account or something.
44+55+This project implements a Personal Data Server (PDS) implementation for the AT Protocol.
66+77+Uses PostgreSQL instead of SQLite, S3-compatible blob storage, and aims to be a complete drop-in replacement for Bluesky's reference PDS implementation.
88+99+In fact I aim to also implement a plugin system soon, so that we can add things onto our own PDSes on top of the default BS.
1010+1111+I'm also taking ideas on what other PDSes lack, such as an on-PDS webpage that users can access to manage their records and preferences.
1212+1313+:3
1414+1515+# Running locally
1616+1717+The reader will need rust installed locally.
1818+1919+I personally run the postgres db, and an S3-compatible object store with podman compose up db objsto -d.
2020+2121+Run the PDS directly:
2222+2323+ just run
2424+2525+Configuration is via environment variables:
2626+2727+ DATABASE_URL postgres connection string
2828+ S3_BUCKET blob storage bucket name
2929+ S3_ENDPOINT S3 endpoint URL (for MinIO etc)
3030+ AWS_ACCESS_KEY_ID S3 credentials
3131+ AWS_SECRET_ACCESS_KEY
3232+ AWS_REGION
3333+ PDS_HOSTNAME public hostname of this PDS
3434+ APPVIEW_URL appview to proxy unimplemented endpoints to
3535+ RELAYS comma-separated list of relay WebSocket URLs
3636+3737+Optional email stuff:
3838+3939+ MAIL_FROM_ADDRESS sender address (enables email notifications)
4040+ MAIL_FROM_NAME sender name (default: BSPDS)
4141+ SENDMAIL_PATH path to sendmail binary
4242+4343+Development
4444+4545+ just shows available commands
4646+ just test run tests (spins up postgres and minio via testcontainers)
4747+ just lint clippy + fmt check
4848+ just db-reset drop and recreate local database
4949+5050+The test suite uses testcontainers so you don't need to set up anything manually for running tests.
5151+5252+## What's implemented
5353+5454+Most of the com.atproto.* namespace is done. Server endpoints, repo operations, sync, identity, admin, moderation. The firehose websocket works. OAuth is not done yet.
5555+5656+See TODO.md for the full breakdown of what's done and what's left.
5757+5858+Structure
5959+6060+ src/
6161+ main.rs server entrypoint
6262+ lib.rs router setup
6363+ state.rs app state (db pool, stores)
6464+ api/ XRPC handlers organized by namespace
6565+ auth/ JWT handling
6666+ repo/ postgres block store
6767+ storage/ S3 blob storage
6868+ sync/ firehose, relay clients
6969+ notifications/ email service
7070+ tests/ integration tests
7171+ migrations/ sqlx migrations
7272+7373+License
7474+7575+idk