Loading…
Loading…
The one group chat your college batch never outgrows.
A real-time chat system built for college batches. Launched as the founding product at MJCET (Class of '26). WhatsApp's speed with Discord's roles and admin control — in one app neither technical nor non-technical users have to learn twice.
Students already run their social lives across a dozen WhatsApp groups and one messy Discord server. BatchUp merges WhatsApp's speed with Discord's roles and admin control, in one app neither technical nor non-technical users have to learn twice.
Every batch is its own space. Real profiles, no anonymous pile-ons, no follower counts — just your actual people. The system supports direct messages, group conversations with up to 1,000 concurrent users per group, typing indicators, presence tracking, message reactions, replies, edits, deletes, read receipts, and admin-configurable rate limits.
It runs on Cloudflare's edge network across 8 accounts, costs $0/month to operate, and delivers messages in under 100 milliseconds. One-person operation — built, deployed, and operated by a single developer.
The scope at the start was ambitious: a real-time chat system with groups, DMs, roles, presence, reactions, payments, and an admin panel — all running on Cloudflare Workers with Durable Objects for WebSocket hosting. The scope at the end matched it: every feature shipped, the 8-account infrastructure deployed, and the cost bill at zero.
The point of this number isn't the calendar. It's the ratio of ambition to elapsed time. A horizontally-sharded, multi-account real-time system with rate limiting, presence, typing indicators, and a full payment integration — built, tested, and deployed in under a week.
Every feature was built to production standard in 5 days. No stubs, no placeholders, no "we'll add it later."
All messages travel over WebSockets — no polling, no SSE. Every send hits a Durable Object on one of seven shard Workers, saves to co-located SQLite, and broadcasts to every connected client in a single atomic operation. Target: sub-100ms from sender to screen.
Two types: direct messages and groups. Groups support Owner, Admin, and Member roles with configurable rate limits. Every conversation is permanently assigned to one shard via FNV-1a hash — once assigned, it never migrates. No cross-shard state transfer, ever.
Messages edit within a 15-minute window. Deletes are soft — the row stays, all clients stop rendering. Single-level replies jump to the original in O(1) via an index map. Up to 10 reactions per message, broadcast as deltas.
Connection counting means multiple tabs per user work correctly — a user is only offline when every connection drops. Presence broadcasts are diff-based. Typing indicators auto-expire after 10 seconds, throttled to once every 2 seconds per user.
Layer 1: Cloudflare HTTP limits per IP. Layer 2: Durable Object in-memory sliding-window per user per conversation, configurable across 5 tiers. Layer 3: Upstash Redis cross-shard synchronization — engages only when a user has connections on multiple shards simultaneously.
Razorpay integration wired end-to-end: order creation, payment verification, and webhook handling. The primary server handles everything — orders, verification with Razorpay's API, and async webhook confirmation.
A separate Next.js application with full operations visibility: system-wide metrics, conversation management, user management, order tracking, shard health monitoring, and global message search across all shards. Protected by constant-time API key comparison.
Eight Cloudflare accounts. Seven shard workers. One primary. Zero managed services. Every design decision optimizes for cost, latency, and operational simplicity.
Client (Next.js)
│
▼
Account 1 — Primary Worker
Auth · REST API · Payments · Token Issuance · Shard Routing
│
├──▶ Account 2 (Shard 1) ──▶ Durable Objects ──▶ DO SQLite
├──▶ Account 3 (Shard 2) ──▶ Durable Objects ──▶ DO SQLite
├──▶ Account 4 (Shard 3) ──▶ Durable Objects ──▶ DO SQLite
├──▶ Account 5 (Shard 4) ──▶ Durable Objects ──▶ DO SQLite
├──▶ Account 6 (Shard 5) ──▶ Durable Objects ──▶ DO SQLite
├──▶ Account 7 (Shard 6) ──▶ Durable Objects ──▶ DO SQLite
└──▶ Account 8 (Shard 7) ──▶ Durable Objects ──▶ DO SQLite
D1 (Source of Truth) ←── Buffered writes (500ms / 20-write flush)FNV-1a hash of the conversation ID, modulo shard count, plus one. Immutable — a conversation lands on a shard and stays there forever. Zero cross-shard migration.
Client requests a bearer token. Primary server signs an HMAC payload with user identity, role, rate-limit tier, and conversation membership. Shard Worker verifies statelessly — no database lookup — and upgrades. 5-minute TTL, checked only at upgrade.
DO SQLite is the fast path — co-located, zero network hops. D1 is the source of truth — users, sessions, conversations. D1 writes buffer inside the DO with a 500ms or 20-write flush cycle. Messages always save to SQLite immediately.
Each Cloudflare account has a daily Durable Object request budget. Seven shard accounts distribute the load. A circuit breaker on each shard tracks budget exhaustion and refuses new requests before the account is overwhelmed.
When a room has no active connections, the Durable Object goes idle — zero resource consumption. A new user connects, the DO wakes, rebuilds presence, resumes. Idle rooms cost nothing.
TLS 1.3 everywhere. HSTS with preload. AES-256-GCM for OAuth refresh tokens. HMAC-SHA256 one-way session hashing. No end-to-end encryption — server-mediated, same model as Slack or Discord. Documented honestly.
Next.js 16 · React 19 · Tailwind CSS v4 · react-virtuoso
The chat interface uses a virtualized message list that handles thousands of messages without performance degradation. Every optimization is intentional — nothing is premature.
The entire system operates at zero cost on Cloudflare and Upstash free tiers. No managed realtime vendor. No dedicated servers. No database hosting fees.
Workers · D1 · Durable Objects · Upstash Redis — all free tier at current scale
The alumni graph layer is the durability play — a network of your college's people that compounds in value every year instead of resetting at graduation. BatchUp starts at MJCET. The infrastructure is designed to expand to other campuses by deploying additional shards and updating the shard configuration.
Real-time chat for college batches. Built in 5 days. Running at $0/month. Live at batchup.fun.
Built by Alphazord · Shipped in 5 days · Live at batchup.fun · All infrastructure running on Cloudflare free tier