Project Structure
The repository is a pnpm +
Cargo monorepo. Builds are orchestrated by Turbo, so
each package declares its own build, test, and lint tasks and the root
scripts fan out across them.
Top level
| Path | Contents |
|---|---|
apps/ | End-user applications. |
packages/ | Libraries and SDKs — the protocol core and its language bindings. |
services/ | Server-side processes. |
protos/ | Protobuf definitions for the Polycentric Protocol. The Rust and TypeScript types are generated from these. |
docs/ | This documentation site (Docusaurus). |
Apps
| App | Description |
|---|---|
apps/harbor | The Harbor client — one Expo/React Native codebase for web, Android, and iOS. |
Packages
| Package | Description |
|---|---|
packages/rs-core | The Rust protocol core: event signing and validation, queries, sync, and the local store. Everything else is a binding over this. |
packages/rs-common | Shared Rust code — protocol models and the generated protobuf types — used by rs-core and the services. |
packages/rs-core-uniffi-web | rs-core compiled to WASM with uniffi-bindgen-react-native bindings, for the web build. |
packages/react-native | React Native SDK. Wraps rs-core through uniffi (native) or the WASM build (web). |
packages/js-core | Core JavaScript library holding the protocol logic and generated protobuf types. |
packages/js-browser | Browser SDK, storing data in SQLite WASM. |
packages/js-node | Node.js SDK, storing data in sqlite3. |
packages/js-storage-sqlite | Shared SQLite storage layer (Drizzle ORM) behind the JS SDKs. |
packages/js-storage-postgres | PostgreSQL storage layer, used by the Node.js SDK. |
Services
| Service | Description |
|---|---|
services/server | The Polycentric server: ingests events, serves feeds, search, and blobs. See Running a Server. |
services/moderation | Labels content pushed to FUTO-run servers and publishes a labelling feed other servers can poll. |
services/push-notifications | Consumes the server's notifications Kafka topic, delivers Expo push notifications, and serves the gRPC NotificationService clients register device tokens with. |
services/scraper | Fetches link metadata for link previews. |
services/verifier-bot | Verifies platform claims. See Verifiers. |
services/common | Shared Rust crates for the services — dotenv, kafka, object-store, and telemetry. |
Generated code
Two kinds of generated artifacts are worth knowing about, because stale copies cause confusing build failures:
- Protobuf types are generated from
protos/at build time (prostandtonicfor Rust,protobuf-tsfor TypeScript). - uniffi bindings expose
rs-coreto TypeScript. The React Native bindings are committed underpackages/react-native/src/generated/; the web bindings are built intopackages/rs-core-uniffi-web/dist/. Regenerate them withpnpm ubrn:clean && pnpm build— see Clearing stale build caches.