yapyap
v0.0.9
Published
YapYap is a decentralized, peer-to-peer messenger node and CLI library built with Node.js + TypeScript. It prioritizes reliable end-to-end encrypted delivery, offline/store-and-forward support, deduplication, and ACK-driven reliability inside a small-foot
Downloads
816
Maintainers
Readme
YapYap Messenger
YapYap is a decentralized, peer-to-peer messenger node and CLI library built with Node.js + TypeScript. It prioritizes reliable end-to-end encrypted delivery, offline/store-and-forward support, deduplication, and ACK-driven reliability inside a small-footprint CLI package (no UI) so other applications can embed YapYap as a dependency or run it as an executable.
Key features
- Central
YapYapNode/MessageRouterstack for message enqueue → transmit → receive → acknowledge → retry flows (seedocs/MESSAGE_FLOW.md). - Built on libp2p (TCP/WebSocket yamux transport, bootstrap + DHT discovery, autonat/relay fallbacks) with Noise XX/IK and Ed25519 for E2EE.
- SQLite-backed persistence using
better-sqlite3(message_queue,processed_messages, replica tables) plus LRU dedup caches and replica-aware retries. - CLI (
yapyapbinary) that shipsinit,start,send,status,peers, and HTTP API endpoints for automated control.
Getting started
Quick install (recommended)
curl -fsSL https://viliamvolosv.github.io/yapyap/install.sh | bashOr use the installer with specific options:
# Install via npm (default)
curl -fsSL https://viliamvolosv.github.io/yapyap/install.sh | bash -s -- --no-onboard
# Install from GitHub source
curl -fsSL https://viliamvolosv.github.io/yapyap/install.sh | bash -s -- --method github --no-onboardManual install
- Install Node.js 22.12+ and clone the repository: https://github.com/viliamvolosv/yapyap
- Run
npm installto populate dependencies. - Build the project with
npm run build:all(createsdist/index.jsanddist/cli.js). - Start the node locally via
npm run devor run the CLI:node dist/cli.js start
Requirements: Node.js ≥22.12.0
Development workflows
- Tests:
npm test(uses Node.js native test runner withtsx). Test files use.test.tssuffix. - Lint/format/typecheck:
npm run lint,npm run format,npm run check,npm run typecheck(Biome + TypeScript). - Integration suites:
bash tests/integration/docker/run-basic-suite.sh(default scenarios) orbash tests/integration/docker/run.shfor custom scenarios using Docker Compose. - Build:
npm run build:all- Fast builds with esbuild (~10ms)
Documentation & roadmap
- Quick install: Use the installer script: https://viliamvolosv.github.io/yapyap/install.sh
- AGENT skill: Get started quickly with
curl -s https://viliamvolosv.github.io/yapyap/skill.md | bash - GitHub: https://github.com/viliamvolosv/yapyap (issues and contributions)
Contributing
- Keep TypeScript strict (
noImplicitAny, noany, narrowunknownbefore use). Prefer interfaces for public APIs andimport typewhen only types are needed. - Use Node.js native APIs (
node:*imports). The project usesbetter-sqlite3for SQLite,wsfor WebSocket, andesbuildfor bundling. - Test files use Node's built-in test runner (
node:test) withassertfor assertions. - Investigate lint warnings about unused parameters—either refactor or remove them rather than ignoring.
Publishing & release notes
- Build artifacts land in
dist/for theyapyapCLI and library exports (package.jsonpoints todist/index.js/cli.js). - Dependencies managed via
package-lock.jsonand npm. - Docker images use
node:22-alpinebase (seetests/integration/docker/Dockerfile.*). - The repository is MIT licensed (see
LICENSE). - See CHANGELOG.md for detailed release notes.
For deeper dives, consult the individual docs referenced above before contributing significant changes.
