A from-scratch atproto PDS implementation in Python (mirrors https://github.com/DavidBuchanan314/millipds)
at main 19 lines 1.1 kB view raw view rendered
1# A guided tour of the millipds codebase 2 3The source is in `src/millipds/`. 4 5The entrypoint for the main `millipds` command is `__main__.py`. CLI arg parsing happens here. 6 7If you choose to launch the server, it calls out to `service.py`, which sets up an `aiohttp` application. 8 9General-purpose routes are implemented right there in `service.py`, but others are handled in: 10 11- `auth_oauth.py` - oauth stuff 12- `atproto_repo.py` - `com.atproto.repo.*` endpoints 13- `atproto_sync.py` - `com.atproto.sync.*` endpoints 14 15`repo_ops.py` implements core repo commit logic - it's quite complex, even though [atmst](https://github.com/DavidBuchanan314/atmst) takes care of the actual MST operations. 16 17`database.py` handles Database Stuff™, using `apsw` as an SQLite driver. There are also SQL queries littered throughout the rest of the codebase (no ORM...) The application is quite tightly coupled to SQLite-specific features (I've lost track of which ones). 18 19`crypto.py` depends on `pyca/cryptography` and provides utilities for basic crypto stuff, including generating "low-S" signatures.