Decentralized eprints on ATProto
Documentation • Live Demo • Discussions • Bluesky
Chive is a scholarly eprint platform where researchers own their work. It is built on AT Protocol, so all user content lives in user-controlled Personal Data Servers (PDSes), not on Chive's servers.
Key principle: If Chive's entire database disappears tomorrow, you lose nothing. Your eprints, reviews, and endorsements remain in your PDS, accessible via any ATProto-compatible AppView.
- Decentralized ownership: Your research stays in your PDS under your control
- Open peer review: Transparent review process with threaded discussions
- Knowledge graph: Community-curated field taxonomy with Wikipedia-style moderation
- Faceted search: Find papers by field, author, methodology, time period, and more
- Citation tracking: Follow how research builds on prior work
- ATProto native: Portable identity, cryptographic verification, federated architecture
Chive operates as an AppView in the AT Protocol ecosystem:
User → User's PDS (creates record) → Relay (firehose) → Chive AppView (indexes)
- Users publish eprints to their own PDSes
- Chive indexes content from the ATProto firehose
- All search and discovery happens through Chive
- Users can switch AppViews without losing data
| Layer | Technology |
|---|---|
| Runtime | Node.js 22+, TypeScript 5.9+ |
| API | Hono (XRPC + REST) |
| Databases | PostgreSQL 16+, Elasticsearch 8+, Neo4j 5+, Redis 7+ |
| Frontend | Next.js 15, React 19, Radix UI, Tailwind CSS |
| Testing | Vitest, Playwright, k6 |
| Infrastructure | Kubernetes, Docker, OpenTelemetry |
- Node.js 22+
- pnpm 8+
- Docker and Docker Compose (for databases)
# Clone the repository
git clone https://github.com/chive-pub/chive.git
cd chive
# Install dependencies
pnpm install
# Start the development database stack
./scripts/start-test-stack.sh
# Initialize databases
pnpm db:init
# Start the development server
pnpm devThe API runs at http://localhost:3001 and the web app at http://localhost:3000.
# Run all tests
pnpm test
# Unit tests only
pnpm test:unit
# End-to-end tests
pnpm test:e2e
# ATProto compliance tests
pnpm test:compliance
# With coverage
pnpm test:coveragechive/
├── src/ # Backend source code
│ ├── api/ # Hono XRPC + REST handlers
│ ├── atproto/ # ATProto client, firehose consumer
│ ├── auth/ # Authentication, OAuth, zero-trust
│ ├── plugins/ # Plugin system and builtins
│ ├── services/ # Business logic
│ └── storage/ # Database adapters
├── web/ # Next.js frontend
│ ├── app/ # App router pages
│ ├── components/ # React components (140+)
│ └── lib/ # Hooks, API client, utilities
├── docs/ # Docusaurus documentation
├── tests/ # Test suites
│ ├── unit/ # Vitest unit tests
│ ├── integration/ # Integration tests
│ ├── e2e/ # Playwright E2E tests
│ └── compliance/ # ATProto compliance tests
├── lexicons/ # ATProto lexicon schemas (pub.chive.*)
├── scripts/ # Development and admin scripts
├── docker/ # Docker configurations
└── k8s/ # Kubernetes manifests
Chive follows strict ATProto compliance rules:
| Rule | Description |
|---|---|
| Read only | Chive reads from the firehose, never writes to user PDSes |
| BlobRefs only | Store CID pointers to blobs, never blob data |
| Rebuildable indexes | All indexes can be reconstructed from the firehose |
| PDS tracking | Track source PDS for staleness detection |
Run pnpm test:compliance to verify compliance.
- TypeScript with strict mode
- ESLint + Prettier for formatting
- TSDoc for documentation (not JSDoc)
- Active voice preferred
After modifying backend endpoints:
# Start dev server
pnpm dev
# Regenerate frontend types
pnpm openapi:generate
# Verify types compile
pnpm typecheck# Create a new migration
pnpm db:migrate:create migration_name
# Run migrations
pnpm db:migrate:up
# Rollback migrations
pnpm db:migrate:downChive uses a hybrid plugin architecture with dependency injection (TSyringe) and event hooks (EventEmitter2).
Plugins run in isolated sandboxes with declared permissions. Built-in plugins include:
- GitHub integration
- ORCID linking
- DOI registration
- Wikidata field import
See docs.chive.pub for plugin development details.
We welcome contributions! Please read our Contributing Guide before submitting PRs.
- Fork the repository
- Create a feature branch (
git checkout -b feature/your-feature) - Make your changes
- Run tests (
pnpm test) - Submit a pull request
Chive implements Zero Trust Architecture (NIST SP 800-207):
- Every request authenticated and authorized
- Mutual TLS for inter-service communication
- DID-based cryptographic identity
- Audit logging with tamper detection
Report security vulnerabilities to admin@chive.pub. See SECURITY.md.
MIT License. See LICENSE for details.
Chive was architected and implemented with the help of Claude Code.