Skip to content

kalkiboru111/hive

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

35 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🐝 Hive β€” WhatsApp Bot Framework for Reality Network

Build and run WhatsApp bots on decentralized infrastructure. No cloud. No monthly fees. Your device, your bot, your business.

What is Hive?

Hive is a framework that lets anyone create a WhatsApp-based business β€” ordering systems, customer service, booking, vouchers β€” and host it on their own device via Reality Network. Zero cloud costs. Works on a laptop or phone.

βœ… Full Reality Network integration validated February 6, 2026 β€” See test results

Quick Start

For Builders (Non-Technical)

πŸ‘‰ Start here: FOR_BUILDERS.md

Use the interactive wizard:

./hive wizard my-business
# Answer 4 questions, your config is ready
./hive run my-business/
# Scan QR, bot is live

For Developers

# Use a template
./hive init --template food-delivery my-bot

# Or start from scratch
./hive init my-bot

# Edit your config
nano my-bot/config.yaml

# Run it
./hive run my-bot/

See all templates:

./hive templates

Templates

Hive includes 8 pre-built templates for common businesses:

  • food-delivery β€” Restaurants, street food, home kitchens
  • salon-booking β€” Hair salons, barbers, spas
  • event-tickets β€” Concerts, workshops, classes
  • tutoring β€” Private lessons, test prep
  • voucher-store β€” Gift cards, loyalty programs
  • community-store β€” Co-ops, farmer's markets
  • customer-support β€” Help desk, ticket system
  • real-estate β€” Property listings, viewings

See all templates:

./hive templates

Use a template:

./hive init --template food-delivery my-restaurant

Each template includes pre-filled menu items, messages, and settings β€” just customize and go.

Features

  • Config-driven β€” define your bot in YAML, no coding required
  • Menu & ordering β€” built-in support for product catalogs and order flows
  • Vouchers β€” create and redeem voucher codes
  • M-Pesa payments πŸ‡°πŸ‡ͺ β€” STK Push, webhooks, admin notifications, reconciliation, B2C refunds (guide | advanced)
  • Admin notifications β€” owner gets order alerts via WhatsApp
  • Web dashboard β€” manage menu, orders, and analytics from a browser
  • Decentralized hosting β€” runs on Reality Network, powered by your community
  • Single binary β€” no Docker, no npm, no JVM. Just download and run.

Architecture

Your Device (laptop/phone)
β”œβ”€β”€ WhatsApp Connection (whatsapp-rust)
β”œβ”€β”€ Bot Engine (message routing, conversation state)
β”œβ”€β”€ Plugin System (YAML config + handlers)
β”œβ”€β”€ Web Dashboard (local admin panel)
β”œβ”€β”€ SQLite (sessions, orders, menu)
└── Reality Network Node (rApp integration)

Reality Network Integration

Hive automatically submits state snapshots to Reality Network's L0 layer as a state channel. Every order, voucher redemption, and status change is captured and submitted on-chain.

βœ… Integration Test Results (February 6, 2026)

Test Cluster:

  • 3-node L0 + 3-node L1 consensus cluster
  • Isolated test network (localhost:7000)

Full End-to-End Flow:

WhatsApp Message β†’ Hive Bot β†’ Order Created β†’ State Changed
β†’ Snapshot Captured β†’ MessagePack Serialization β†’ L0 Submission
β†’ Accepted by Cluster β†’ Ordinal Incremented

Logs from Live Test:

[2026-02-06T12:16:30Z INFO hive::bot] πŸ“¨ Message from 14152657184@s.whatsapp.net: 3
[2026-02-06T12:16:30Z INFO hive::network::service] πŸ“Έ Capturing state: 1 orders, 0 delivered
[2026-02-06T12:16:30Z INFO hive::network::client] Submitting state channel snapshot to http://localhost:7000/state-channels/NET4nFnmFxhdtG9kSR9LXxff35cgTHv6hW8pvzPx/snapshot
[2026-02-06T12:16:30Z INFO hive::network::client] βœ… State channel snapshot accepted by L0
[2026-02-06T12:16:30Z INFO hive::network::service] βœ… Snapshot submitted to Reality Network

[2026-02-06T12:16:51Z INFO hive::handlers::order] πŸ“¦ New order #2 from 14152657184@s.whatsapp.net β€” USD13.00
[2026-02-06T12:16:51Z INFO hive::network::service] πŸ“Έ Capturing state: 2 orders, 0 delivered
[2026-02-06T12:16:51Z INFO hive::network::client] βœ… State channel snapshot accepted by L0
[2026-02-06T12:16:51Z INFO hive::network::service] βœ… Snapshot submitted to Reality Network

Network Response:

  • 3 snapshots submitted
  • All accepted by L0 consensus layer
  • Ordinal progression: 12 β†’ 30 (18 snapshots processed)
  • Node identity: NET4nFnmFxhdtG9kSR9LXxff35cgTHv6hW8pvzPx

Database Verification:

$ sqlite3 data/hive.db "SELECT id, customer_phone, total, status FROM orders;"
2|14152657184@s.whatsapp.net|13.0|confirmed
1|+254700111222|27.0|pending

How It Works

  1. Identity Generation: Hive creates a secp256k1 keypair on first run (data/identity.json)
  2. State Capture: Every message/order triggers snapshot generation
  3. Serialization: State is encoded using MessagePack
  4. Signing: Snapshot is cryptographically signed
  5. Submission: HTTP POST to L0 node /state-channels/{address}/snapshot
  6. Consensus: L0 cluster validates and incorporates into global snapshot
  7. Finality: Snapshot ordinal increments, state is on-chain

See: docs/REALITY_INTEGRATION.md for technical details.

Documentation

Development

# Build from source
cargo build --release

# Run tests
cargo test

# Build with Reality Network support (default)
cargo build --release --features network

Roadmap

Phase 1: Launch (Q1 2026) βœ…

  • WhatsApp integration (QR pairing)
  • Menu & ordering system
  • Voucher system
  • Web dashboard
  • Multi-language support (7 languages)
  • Reality Network integration
  • MessagePack state serialization
  • 8 business templates

Target: 10,000 businesses in 6 months
Focus: Africa (Kenya, Nigeria, South Africa)
Profile: Solo entrepreneurs, <100 orders/day
Value: $0/month, 5-min setup, on-chain proof

Phase 2: SME Features (Q2-Q3 2026)

  • Enhanced analytics & reporting (export CSV, daily summaries)
  • SMS fallback (Twilio integration, pay-per-use)
  • Payment gateway integrations (M-Pesa)
  • M-Pesa support (Kenya) β€” STK Push integration
  • Backup/failover service (Reality nodes offer for $NET)
  • Voice message support
  • Delivery tracking integration
  • Multi-device dashboard improvements

Target: Extend "works well" range to 500 orders/day
When: First 100 businesses hit scale constraints

Phase 3: Business API Bridge (Q4 2026+)

  • WhatsApp Business API support (premium tier)
  • Multi-agent routing (support teams)
  • Template messages (pre-approved broadcasts)
  • Queue management (ticket assignment)
  • Shift handoff (24/7 operations)
  • Enterprise analytics

Target: SMEs doing $10k+/month revenue
When: 10+ customers request (and can afford $49/month tier)

Scaling Considerations

See SCALING_ANALYSIS.md for detailed breakdown of where current model works (70-80% of SMEs) and where Business API is needed (multi-agent teams, 24/7 operations).

Contributing

See CONTRIBUTING.md

License

MIT β€” see LICENSE

Credits

Built on top of:

Support


Reality Network Ventures β€” First portfolio proof-of-concept
Target: African entrepreneurs, zero cloud costs, 5-minute setup

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors