How theprismsystem/pluralscape-mono works
Pluralscape is a privacy-focused plurality-management platform. A client sends authenticated REST or tRPC requests to the API; domain routes invoke services that read and write PostgreSQL-backed account, system, identity, fronting, communication, and sharing data. Clients also synchronize encrypted documents offline, while imports map external data through checkpointed persistence. The README documents mobile, encryption, sync, import, realtime, blob storage, and background-job capabilities; several are represented at subsystem level because their implementation was not sampled.
Main entry points: v1.ts REST routes · trpc.ts tRPC routes · services Domain services · index.ts API server
Components 27
API access
- API server
apps/api/src/index.ts - REST routes
apps/api/src/routes/v1.ts - tRPC routes
apps/api/src/routes/trpc.ts
Plurality domains
- Authentication
apps/api/src/routes/auth/index.ts - Accounts and friends
apps/api/src/routes/account/index.ts - System and identity
apps/api/src/routes/systems/index.ts - Fronting and analytics
apps/api/src/routes/fronting-sessions/index.ts - Communication
apps/api/src/routes/messages/index.ts - Privacy and sharing
apps/api/src/routes/buckets/index.ts - Domain services
apps/api/src/services
Client data
- Offline sync engine
packages/sync/src/engine/sync-engine.ts - SQLite sync storage
packages/sync/src/adapters/sqlite-storage-adapter.ts - Web sync storage
apps/mobile/src/platform/drivers/indexeddb-storage-adapter.ts - Blob encryption
packages/crypto/src/blob-pipeline/upload-pipeline.ts - Web key storage
packages/crypto/src/web-key-storage.ts - Import orchestration
packages/import-core/src/import-engine.ts - Simply Plural import
packages/import-sp/src/engine/import-engine.ts - Client query cache
packages/data/src/query-client.ts
Platform operations
- PostgreSQL
apps/api/src/lib/db.ts - Background jobs
packages/queue/src/adapters/bullmq/bullmq-job-worker.ts - API job handlers
apps/api/src/jobs/webhook-deliver.ts - Blob API
apps/api/src/routes/blobs/index.ts - Blob storage
apps/api/src/lib/storage.ts - Realtime notifications
apps/api/src/lib/sse-manager.ts - Valkey
- S3-compatible storage
Other components
- User or client
Connections 35
- User or client → API server: sends requests
- API server → REST routes: dispatches REST
- API server → tRPC routes: dispatches tRPC
- REST routes → Authentication: routes requests
- REST routes → Accounts and friends: routes requests
- REST routes → System and identity: routes requests
- REST routes → Fronting and analytics: routes requests
- REST routes → Communication: routes requests
- REST routes → Privacy and sharing: routes requests
- tRPC routes → Authentication: routes requests
- tRPC routes → Accounts and friends: routes requests
- tRPC routes → System and identity: routes requests
- tRPC routes → Fronting and analytics: routes requests
- tRPC routes → Communication: routes requests
- tRPC routes → Privacy and sharing: routes requests
- Authentication → Domain services: invokes services
- Accounts and friends → Domain services: invokes services
- System and identity → Domain services: invokes services
- Fronting and analytics → Domain services: invokes services
- Communication → Domain services: invokes services
- Privacy and sharing → Domain services: invokes services
- Domain services → PostgreSQL: reads and writes
- User or client → Offline sync engine: uses client
- Offline sync engine → SQLite sync storage: stores encrypted changes
- Offline sync engine → Web sync storage: stores encrypted changes
- User or client → Blob encryption: prepares uploads
- Blob encryption → Web key storage: uses keys
- User or client → Import orchestration: starts import
- Simply Plural import → Import orchestration: shares orchestration
- Import orchestration → PostgreSQL: persists mapped data
- API job handlers → Background jobs: uses job queue
- Blob API → Blob storage: requests blob operations
- Blob storage → S3-compatible storage: stores blobs
- Realtime notifications → Valkey: uses pub-sub
- User or client → Client query cache: uses client data