
InsideJibon
A high-performance, bilingual (EN/BN) EdTech platform re-engineered on Cloudflare Workers edge. Features Durable Objects live classrooms, Workers AI & Vectorize RAG tutoring over video captions, Duolingo-style study streaks, and a zero-egress YouTube streaming pipeline under a $0/mo subscription constraint.
The Problem
Traditional EdTech platforms struggle with high SaaS operational costs—video egress, transcode fees, WebSockets, and AI token pricing—making high-quality digital learning unaffordable for grassroots educators and students in Bangladesh.
Technical Approach
Architected a $0/month subscription EdTech engine on Cloudflare Workers edge using Next.js 16 via OpenNext. Replaced expensive third-party SaaS with Cloudflare native primitives: Durable Objects for real-time classrooms, Workers AI and Vectorize for in-house RAG tutoring, Cloudflare Cache API for surrogate-tag edge caching, and unlisted YouTube streaming for zero-cost video egress.
$0-Cost Zero-Egress Edge Architecture
Indexes lecture video auto-captions in Vectorize and uses BGE embeddings to return exact-second timestamp citations for student questions.
$0-Cost Edge Architecture & Real-Time Classroom Pipeline
Architecture: Next.js edge routing, Durable Objects live presence, Vectorize RAG tutoring, and Neon Postgres.
Key Highlights & Architecture
- Real-time live classrooms powered by Cloudflare Durable Objects managing presence, moderated chat, hand-raising, and server-side attendance
- $0-subscription AI tutor combining Cloudflare Workers AI with Vectorize RAG indexing video auto-captions with exact-second timestamp citations
- Duolingo-grade gamification engine with an immutable XP ledger, daily study streaks with freeze protection, and weekly league cohorts
- Zero-cost video architecture serving unlisted YouTube embeds via youtube-nocookie with debounced playback position resume
- Edge performance hardening with Cloudflare Cache API tag invalidation and a complete SQL projection sweep eliminating SELECT * across all services
- Dedicated read-only parent portal with student grade tracking, attendance monitoring, and automated transactional emails via Cloudflare Email Service
Engineering Challenges
- Bundling custom Durable Objects with OpenNext, requiring a specialized post-build compiler script to export ClassroomRoom cleanly into the worker runtime.
- Building a bilingual RAG retrieval pipeline across Bengali and English queries without exceeding free-tier edge memory and inference budgets.
- Designing immutable Postgres indexes for sliding-window mutation deduplication where timestamptz expressions are only STABLE.
Key Engineering Decisions
- Durable Objects over Managed WebSockets: Colocated state, presence, and chat in isolated edge actors with SQLite persistence, zero server management, and no monthly fees.
- YouTube-First Video Pipeline: Leveraged unlisted embeds and public oEmbed validation over expensive dedicated video storage, eliminating 100% of video bandwidth and transcode costs.
- Explicit SQL Projections: Replaced all unbounded SELECT * queries across 13 services with narrow column projections, cutting edge payload sizes and cold starts significantly.
Trade-Off Analysis & Architectural Rationale
YouTube-First Video Pipeline via oEmbed & nocookie IFrame
Cloudflare Stream or AWS S3 + Transcoding
Completely eliminates video bandwidth, storage, and transcoding expenses to preserve $0/mo invariant.
Delegates player controls and sandboxing to YouTube iframe with client-side position sync.
Cloudflare Durable Objects for Live Classrooms
Managed WebSockets (Pusher / Ably / Socket.io)
Colocates real-time presence, chat moderation, and state synchronization at the edge with zero external SaaS bills.
Requires specialized post-build compilation to package Durable Objects alongside OpenNext.
Workers AI (@cf/baai/bge) + Vectorize for RAG Tutoring
OpenAI Embeddings API + Pinecone Cloud
Native Cloudflare vector database keeps AI retrieval entirely inside the edge network with zero API egress.
Bounded by free-tier daily vector dimension quotas and prompt token windows.
Result & Outcome
Successfully remastered InsideJibon into a production-grade, masterclass platform featuring live classes, AI assistance, habit-forming gamification, and full bilingual parity at zero monthly subscription cost.