Nabodigonto — architectural layout and system interface preview
WebEngineering Case Study

Nabodigonto

100,000+ LOC edge-native distributed monorepo and community platform for Nabodigonto Social Welfare Organization. Decomposed into fault-isolated applications (Vite public SPA, React 19 member portal, Expo mobile app), a modular Hono.js API worker on Cloudflare D1 with atomic batch transactions, an isolated Bengali PDF and media engine on R2, and a 4-channel queue notification engine (SMS, email, push).

100k+ LOC Edge-Native Distributed Monorepo & Community Platform
Role & ScopeLead Software Engineer & IT Secretary
Target DomainWeb · Production
Core RuntimeNext.js 16, Cloudflare Workers, Prisma
Operational & Architectural Invariants:
$0/mo baseline operational costGazipur 3G mobile latency resilienceStateless JWT edge verificationOffline public directory availability

The Problem

Nabodigonto Social Welfare Organization previously relied on fragmented paper records, scattered messaging groups, and manual receipt collection to manage hundreds of members, blood donation directories, and student aid. Serving both rural members on flaky mobile 3G/4G and administrative officers required high performance, resilient offline access, and unified communication without incurring monthly cloud subscription costs.

Technical Approach

Architected an edge-native distributed platform structured as a 100k+ LOC Turborepo monorepo: an auth-free public portal (Vite + React 19) with offline cached donor directories, an authenticated portal (React 19 + TanStack Router/Query + Clerk RBAC), a modular Hono API worker across 9 domain modules with atomic Cloudflare D1 batch mutations, a dedicated serverless media engine rendering Bengali Unicode vector PDFs (pdf-lib + fontkit) uploaded to Cloudflare R2, and an asynchronous notification worker consuming Cloudflare Queues for SMS, email, and mobile push delivery.

Interactive Architecture Explorer

100k+ LOC Edge-Native Distributed Monorepo & Pipeline

Hono.js on Cloudflare Workers

services/api — 9 Modular Domains & D1 Batching

● 38ms execution

Modular edge router partitioned into 9 domain modules (members, dues, welfare, donors, notifications, etc.). Executes multi-table mutations atomically via Cloudflare D1 batch statements.

Verified Architectural Guarantees:
  • ✓End-to-end type safety via packages/contracts & Hono RPC
  • ✓D1 batch() transactions prevent race conditions on distributed SQLite
  • ✓Zero long-lived TCP connection pool exhaustion risks

100k+ LOC Distributed Monorepo Architecture & Pipeline

[Step 1]Public Web (Vite + React 19) ──> Zero Auth Bundle · Offline Fallback Snapshot · Public Directory
[Step 2]Member Portal (TanStack Router) ──> Role-Gated Admin (6 Roles) · Dues Hub · Member Verification
[Step 3]Core API (Hono + D1) ──> 9 Domain Modules · Atomic batch() Transactions · Shared Contracts
[Step 4]Media Service (R2 + Fonts) ──> Bengali Font Shaping (fontkit) · PVC Member Cards · Vector PDF Receipts
[Step 5]Notification Worker (Queues) ──> 4 Channels: OneCodeSoft SMS · Resend Email · WebPush · FCM

Architecture: Decoupled public/portal frontends, modular Hono API on D1, dedicated media worker, and 4-channel queue notifications.

Key Highlights & Architecture

  • Appointed as IT Secretary of the organization after designing and deploying this system
  • Fault-isolated monorepo architecture separating public web (Vite SPA), member portal (React 19 + Clerk RBAC), and Expo mobile app
  • Modular Hono.js API worker with 9 domain modules backed by Cloudflare D1 and atomic batch() transactions
  • Serverless Bengali PDF & media engine using pdf-lib and fontkit for custom Bengali typography and digital member ID cards with QR verification
  • 4-channel queue notification engine via Cloudflare Queues dispatching automated SMS (OneCodeSoft), Email (Resend), WebPush, and FCM with retry backoff

Engineering Challenges

  • Rendering complex Bengali Unicode typography and ligatures in serverless vector PDFs within Cloudflare Worker 128MB memory constraints without headless browsers.
  • Eliminating authentication bundle bloat on public informational and emergency blood donor directories to ensure sub-second loads on rural Bangladeshi mobile networks.
  • Guaranteeing multi-statement ACID consistency across membership ledgers on distributed SQLite (Cloudflare D1) without long-running database locks.

Key Engineering Decisions

  • Fault-Isolated Monorepo Architecture: Decoupled public web from authenticated portal and backend workers so auth downtime or heavy admin workloads never impact public availability.
  • Atomic D1 Batch Transactions: Structured multi-table mutations into single-roundtrip atomic batch() statements, preventing race conditions on edge SQLite.
  • Serverless Bengali Media Engine: Offloaded vector PDF rendering with custom TTF font embedding to an isolated media worker backed by Cloudflare R2, protecting API throughput.
  • 4-Channel Queue-Driven Notifications: Decoupled slow external telecom SMS and email APIs using Cloudflare Queues with exponential retry backoff.
Architecture Decision Records (ADRs)

Trade-Off Analysis & Architectural Rationale

✓
Decision Made

Fault-Isolated Monorepo over Single Monolith

✕
Alternative Rejected

Single All-in-One Next.js Application

Why It Won (Technical Rationale)

Eliminates heavy auth bundle overhead from public landing pages and isolates PDF generation CPU load from API routing.

Trade-Off Accepted

Requires monorepo workspace orchestration (pnpm + Turborepo) and shared packages.

✓
Decision Made

Cloudflare D1 with Atomic Batch Statements

✕
Alternative Rejected

Unbounded Direct Edge Writes

Why It Won (Technical Rationale)

Guarantees multi-table consistency across member ledgers and dues updates while maintaining edge colocation.

Trade-Off Accepted

Requires batch statement structure rather than long-running interactive database transactions.

✓
Decision Made

Dedicated Media Worker for Bengali Typography

✕
Alternative Rejected

Headless Chromium / Puppeteer

Why It Won (Technical Rationale)

Puppeteer requires hundreds of MBs and cannot run in V8 isolates; pdf-lib + fontkit delivers in-memory vector PDFs in <40ms under 25MB RAM.

Trade-Off Accepted

Requires manual coordinate layout calculations for vector PDF canvases.

Result & Outcome

Successfully launched into production as the organization's official operational backbone. Appointed IT Secretary by the executive board to oversee system governance, feature rollouts, and technical stewardship.

Technologies & Tools

Next.js 16Cloudflare WorkersPrismaTypeScriptTurborepoTailwind CSS