How chive-pub/chive works
Chive is a decentralized scholarly eprint AppView: researchers publish records to their own PDS, and Chive indexes ATProto firehose events to provide search, review, graph, and discovery features. The README documents this principal workflow and product capabilities; the tree supports the major API, service, storage, and web subsystems, but most runtime wiring was not sampled. Arrows therefore show only documented firehose flow and sampled direct calls or storage access, not presumed links among unsampled handlers and services.
Main entry points: server.ts XRPC and REST API · firehose-consumer.ts Firehose consumer · event-processor.ts Event processor · review-service.ts Review service
Components 21
User experience
- Web application
web/app/(search)/search/page.tsx - XRPC and REST API
src/api/server.ts
ATProto indexing
- Indexer entry
src/indexer.ts - Firehose consumer
src/services/indexing/firehose-consumer.ts - Event processor
src/services/indexing/event-processor.ts
Scholarly services
- Eprint service
src/services/eprint/eprint-service.ts - Review service
src/services/review/review-service.ts - Search service
src/services/search/search-service.ts - Knowledge graph
src/services/knowledge-graph/graph-service.ts - Discovery service
src/services/discovery/discovery-service.ts - Plugin manager
src/plugins/core/plugin-manager.ts
Indexed storage
- PostgreSQL index
src/storage/postgresql/adapter.ts - Elasticsearch
src/storage/elasticsearch/adapter.ts - Neo4j graph
src/storage/neo4j/adapter.ts - Redis
src/storage/redis/structures.ts - Review repository
src/storage/postgresql/reviews-repository.ts - Tag manager
src/storage/neo4j/tag-manager.ts
Identity and plugins
- Authorization
src/auth/authorization/authorization-service.ts
Other components
- Researcher
- User PDS
- ATProto relay
Connections 23
- Researcher → User PDS: publishes records
- User PDS → ATProto relay: streams events
- ATProto relay → Firehose consumer: firehose events
- Indexer entry → Firehose consumer: starts
- Firehose consumer → Event processor: dispatches events
- Event processor → Eprint service: indexes eprints
- Event processor → Review service: indexes reviews
- Review service → Review repository: queries reviews
- Review repository → PostgreSQL index: reads and writes
- Tag manager → Neo4j graph: queries graph
- Authorization → Redis: stores roles
- Web application → XRPC and REST API: API requests
- XRPC and REST API → Authorization: authorizes requests
- XRPC and REST API → Eprint service: serves eprint operations
- XRPC and REST API → Review service: serves review operations
- XRPC and REST API → Search service: serves search
- XRPC and REST API → Knowledge graph: serves graph operations
- XRPC and REST API → Discovery service: serves discovery
- Search service → Elasticsearch: searches index
- Knowledge graph → Neo4j graph: queries graph
- Discovery service → Neo4j graph: uses graph data
- Researcher → Web application: browses and searches
- Plugin manager → Firehose consumer: optional event hooks