InsideJibon — architectural layout and system interface preview
WebEngineering Case Study

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.

Edge Compute & Real-Time EdTech
Role & ScopeFull-Stack Developer
Target DomainWeb · Production
Core RuntimeNext.js 16, Cloudflare Workers, Durable Objects
Operational & Architectural Invariants:
Strict $0/mo subscription invariantZero cloud egress budgetSub-second edge global deliveryNo GPU server hosting

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.

Interactive Architecture Explorer

$0-Cost Zero-Egress Edge Architecture

Workers AI + Vectorize RAGCosine Sim 0.89

Indexes lecture video auto-captions in Vectorize and uses BGE embeddings to return exact-second timestamp citations for student questions.

Test Semantic Caption Retrieval:

$0-Cost Edge Architecture & Real-Time Classroom Pipeline

[Step 1]Edge Gateway ─────────> Cloudflare Workers (Next.js 16 via OpenNext) + Cache API
[Step 2]Live Classroom Room ──> Cloudflare Durable Object (WebSockets, Presence, Chat, SQLite)
[Step 3]AI Tutor Pipeline ──> Vectorize (lessons_v1) + Workers AI (@cf/m2m100 & bge)
[Step 4]Relational Database ──> Neon Serverless Postgres via Drizzle ORM (Explicit Projections)
[Step 5]Video Streaming ──> YouTube Unlisted CDN (youtube-nocookie) + Position Sync

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.
Architecture Decision Records (ADRs)

Trade-Off Analysis & Architectural Rationale

✓
Decision Made

YouTube-First Video Pipeline via oEmbed & nocookie IFrame

✕
Alternative Rejected

Cloudflare Stream or AWS S3 + Transcoding

Why It Won (Technical Rationale)

Completely eliminates video bandwidth, storage, and transcoding expenses to preserve $0/mo invariant.

Trade-Off Accepted

Delegates player controls and sandboxing to YouTube iframe with client-side position sync.

✓
Decision Made

Cloudflare Durable Objects for Live Classrooms

✕
Alternative Rejected

Managed WebSockets (Pusher / Ably / Socket.io)

Why It Won (Technical Rationale)

Colocates real-time presence, chat moderation, and state synchronization at the edge with zero external SaaS bills.

Trade-Off Accepted

Requires specialized post-build compilation to package Durable Objects alongside OpenNext.

✓
Decision Made

Workers AI (@cf/baai/bge) + Vectorize for RAG Tutoring

✕
Alternative Rejected

OpenAI Embeddings API + Pinecone Cloud

Why It Won (Technical Rationale)

Native Cloudflare vector database keeps AI retrieval entirely inside the edge network with zero API egress.

Trade-Off Accepted

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.

Technologies & Tools

Next.js 16Cloudflare WorkersDurable ObjectsWorkers AIVectorizeDrizzle ORMNeon PostgresClerk AuthTailwind CSS