SPEC_SYSTEM // BORNOMALA

Bornomala (বর্ণমালা) — Enterprise POS & E-Commerce

<80MB RAM · Offline-First

Offline-first desktop POS suite & unified academic e-commerce ecosystem

Tauri v2RustReact 19Express.jsTypeScriptSQLitePostgreSQLDrizzle ORMBetter AuthFCM

Overview

Bornomala (বর্ণমালা) is a commercial-grade, dual-engine enterprise retail and educational publishing ecosystem engineered for Bornomala Books (bornomala.shop). The platform bridges the gap between physical retail bookstore operations and modern digital commerce through two seamlessly synchronized components:

  1. A Native Desktop POS & ERP Workstation: An offline-first point-of-sale desktop client running in physical bookstores across Bangladesh to handle rapid barcode checkout, inventory tracking, thermal printing, and MFS reconciliation—even during complete internet outages.
  2. A Nationwide Web Storefront & Academic Portal: A high-speed e-commerce platform that allows polytechnic and diploma engineering students nationwide to browse semester-specific syllabi, configure textbook bundles, and order directly to their doorsteps.
flowchart TD
    subgraph StoreFront["🌐 Online Student Experience (bornomala.shop)"]
        WEB["React 19 / Astro Storefront"]
        MFS["UddoktaPay MFS Gateway\n(bKash · Nagad · Rocket)"]
        AUTH["Better Auth (RBAC Session Guard)"]
        WEB --> MFS
        WEB --> AUTH
    end

    subgraph CloudCore["☁️ Central Cloud Backend (api.bornomala.shop)"]
        API["Express 5 + TypeScript Engine"]
        DB[("Neon Serverless PostgreSQL\n(Drizzle ORM)")]
        FCM["Firebase Cloud Messaging (FCM)"]
        API <--> DB
        API --> FCM
    end

    subgraph DesktopPOS["🖥️ Physical Store Counter (Tauri v2 Workstation)"]
        RUST["Tauri v2 Rust Core Layer\n(Print Spooler · Native Hardware)"]
        UI["React 19 POS Interface"]
        SQLITE[("Offline SQLite DB\n(Outbox Queue & WAL Mode)")]
        PYTHON["Python Sidecar\n(Bengali Typography & Bundle Generator)"]
        
        UI <--> RUST
        RUST <--> SQLITE
        RUST <--> PYTHON
    end

    WEB <-->|REST API / HTTPS| API
    FCM -.->|Instant Audio/Visual Push Alert| RUST
    SQLITE -.->|Automatic Outbox Sync on Reconnection| API

🖥️ 1. Native Offline-First Desktop POS (Tauri v2 & Rust)

Bookstore clerks operating in high-density markets face frequent network instability. If a point-of-sale system relies on an active internet connection, counter sales grind to a halt during outages. Bornomala Desktop solves this with a zero-compromise offline-first architecture.

Bornomala Offline Desktop POS Terminal Live Checkout Fig 1: Live demonstration of cashier POS interface: instant barcode item lookup, real-time cart recalculations, student discount application, and ESC/POS thermal printing.

Key Engineering Features:

  • Sub-80MB RAM Footprint: Unlike Electron-based POS systems that consume 500MB–1GB of memory, Bornomala Desktop is compiled with Tauri v2 and Rust, maintaining a featherweight memory footprint under 80MB RAM on standard physical counter terminals.
  • Offline Outbox Replication Queue: When the internet disconnects, clerks continue scanning barcodes, applying student discounts, and printing receipts without delay. Transactions are recorded in local SQLite (sales-outbox.ts). The instant connectivity returns, the background worker replays the queued operations to the central PostgreSQL cloud database.
  • Direct Hardware Spooler: Native Rust commands interface directly with thermal receipt printers (ESC/POS) and USB/Bluetooth barcode scanners with sub-millisecond input response.
  • Bengali Typography Sidecar (make_bundle.py): An isolated Python executable compiled into the desktop bundle formats academic textbook bundles with complex Bengali script (NotoSansBengali.ttf), generating crisp cover labels and receipts.

🔔 2. Desktop ERP Workstation & Push Order Dispatch (FCM)

One of the platform’s core innovations is connecting online customer orders directly to physical counter storekeepers in real time:

Bornomala Desktop ERP Workstation & Push Queue Fig 2: Dual-engine store management workstation handling incoming FCM cloud order notifications, packing workflows, and inventory sync.

  1. A student places an order on bornomala.shop using bKash or Cash on Delivery.
  2. The cloud API immediately dispatches a high-priority push payload via Firebase Cloud Messaging (FCM).
  3. The desktop workstation in the physical bookstore sounds an audible alert and pops up an instant notification in the counter attendant’s order queue.
  4. With a single click (Processing → Packed → Dispatched), the attendant prints the shipping label and packs the books, synchronizing tracking updates back to the student’s dashboard.

🌐 3. Full-Stack E-Commerce Platform (www.bornomala.shop)

The consumer-facing portal is tailored specifically for the academic structure of the Bangladesh Technical Education Board (BTEB):

Bornomala Nationwide Web Storefront Fig 3: High-speed responsive e-commerce storefront at bornomala.shop.

  • 4-Tier Academic Hierarchy: Books and bundles are categorized by Department (Computer, Civil, Electrical, Mechanical, etc.) → Semester (1st to 8th) → Subject → Textbook Edition.
  • Curriculum Combo Packs: Students can purchase all required textbooks for an entire semester with a single click, automatically bundled and discounted.

Polytechnic Engineering Syllabus & Department Shelf Fig 4: Specialized 4-tier BTEB polytechnic curriculum bookshelf and semester combo pack selector.

  • Fintech & Payment Automation: Integrated with UddoktaPay for automated instant checkout via bKash, Nagad, Rocket, and cards, backed by a secondary manual slip verification queue.

Automated bKash & MFS Checkout Gateway Fig 5: Automated UddoktaPay checkout modal supporting bKash, Nagad, Rocket, and domestic bank cards.

  • Security & Access Control: Implements Better Auth with server-side Role-Based Access Control (RBAC), securing customer data and store management endpoints.

📱 4. Mobile-First Student Shopping Experience

Responsive Mobile Storefront & Instant MFS Checkout Fig 6: Mobile-first shopping experience optimized for 60 FPS mobile touch interactions and 1-click bKash checkout.


⚡ 5. Express.js Cloud Backend API (api.bornomala.shop)

The central backend is engineered with Express 5 and TypeScript, providing secure, high-throughput REST endpoints connecting the storefront, desktop POS terminals, and third-party gateways:

  • Express 5 & Node.js 22 LTS: Production deployment orchestrated with PM2 cluster mode behind an Nginx reverse proxy with automated SSL.
  • Type-Safe ORM & Neon PostgreSQL: Utilizes Drizzle ORM with Neon Serverless PostgreSQL for fast transactional consistency, relational queries, and automated database migrations.
  • Payment Webhook & Dispatch Pipeline: Validates UddoktaPay digital payment webhooks and triggers instant Firebase Cloud Messaging (FCM) push events to alert bookstore counter staff.
  • Authentication & RBAC: Enforces strict role-based access control (Store Admin, Counter Clerk, Customer) powered by Better Auth session guards and tamper-proof cookies.

🎬 Desktop Application Walkthrough

[!NOTE]
A dedicated video walkthrough showcasing live barcode scanning, offline-to-online transaction reconciliation, and thermal receipt printing will be embedded here.

╔════════════════════════════════════════════════════════════════════╗
║  ▶ BORNOMALA DESKTOP POS & ERP — INTERACTIVE COUNTER WALKTHROUGH    ║
║  Status: Production Deployment                                    ║
║  Platform: Windows (.msi / .exe) & Web (bornomala.shop)           ║
╚════════════════════════════════════════════════════════════════════╝

📊 Technical Stack & Architectural Metrics

Dimension Implementation
Desktop Core Tauri v2, Rust 2021 Edition, Windows MSI & EXE CI/CD
Desktop Frontend React 19, TypeScript, Tailwind CSS, Lucide Icons
Local Offline Storage SQLite with WAL (Write-Ahead Logging) & Outbox Sync Queue
Cloud Backend API Express 5, TypeScript, Node.js 22 LTS (PM2 Cluster)
Cloud Database Neon Serverless PostgreSQL with Drizzle ORM
Authentication Better Auth v1.7 with Server-Side Session Guards & RBAC
Push Notification Broker Firebase Cloud Messaging (FCM) Web & Desktop Integration
Memory Consumption < 80 MB RAM on desktop counter terminals
Offline Reliability 100% functional sales operations without network access