Skip to content
proffesergioPublic

About

🛒 BechaKena · বেচাকেনা ### The offline-first POS built for Bangladeshi shops

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

22 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🛒 BechaKena · বেচাকেনা

The offline-first POS built for Bangladeshi shops — now for restaurants too

Sell fast. Track baki. Fire the kitchen. Never lose a sale to load-shedding.

Flutter Dart State: Riverpod DB: Drift/SQLite Platforms Tests Live demo Made in Bangladesh

by neWell Software

Live demo: bkpos.vercel.app/demo — the full POS running in your browser, with demo data that stays on your device. Pick a module, take or skip the tour, then create a browser-local owner name and PIN. Load sample items to try a sale. Setup for every target: HowToSetup.md.

🛒 The offline-first POS built for Bangladeshi shops

Works without internet. Syncs when online. Built for 30M+ shops that lose power/net daily.

Dart Flutter SQLite Offline

Live Demo • Report Bug • Request Feature


😔 Problem

In Bangladesh, 60% small shops lose sales when internet/power goes down. Most POS needs constant internet.

  • ❌ Existing POS: Needs internet, English only, expensive monthly fees
  • ❌ Shop owners lose: 2-3 hours sales daily during load shedding
  • ❌ No Bangla support, no offline billing

✅ Solution - BechaKena

বেচাকেনা - A Dart/Flutter POS that works 100% offline:

  • ✅ Offline billing with SQLite - no internet needed
  • ✅ Auto-sync when internet returns
  • ✅ Bangla + English UI
  • ✅ Barcode, thermal printer support
  • ✅ Daily sales report, stock alert

🏗️ Architecture

[Flutter UI] -> [Dart BLoC] -> [SQLite Offline DB] -> [Sync Service] -> [Backend API when online]
                -> [Printer Service]
                -> [Barcode Scanner]

🚀 How to Run

# Clone
git clone https://github.com/proffesergio/bechakena.git
cd bechakena

# Get dependencies
flutter pub get

# Run on device/emulator
flutter run

# Build APK
flutter build apk --release

🧪 Tech Stack

  • Frontend: Flutter, Dart, BLoC pattern
  • Local DB: SQLite (offline-first), Hive
  • Sync: Background sync worker, REST API
  • Hardware: ESC/POS thermal printer, barcode scanner SDK

📸 Screenshots

Billing Inventory Reports
Offline Bill Stock Management Daily Sales

🗺️ Roadmap - Vibe Coding AI Features

  • AI inventory prediction - "You will run out of rice in 3 days"
  • Voice billing in Bangla - "দুই কেজি চাল"
  • WhatsApp auto receipt
  • Multi-shop owner dashboard

🤝 Contribute

PRs welcome! This is for Bangladeshi shop owners.

📄 License

MIT - Free for local shops.

Made with ❤️ in Dhaka for Bangladeshi shops

💡 Why BechaKena?

Most shops and eateries in Bangladesh still run on a paper khata, a calculator, and memory. The POS software they're offered is foreign, online-only, English-only, and priced like a monthly bill they never agreed to. BechaKena is different:

😩 The old way ✨ With BechaKena
Paper baki khata that fades, tears, and gets "forgotten" 📒 Digital baki khata — every customer's due tracked to the paisa, with payment history
Hand-written totals, arithmetic mistakes 🧾 Branded thermal receipts with your shop's name — printed in seconds
"Internet nei, POS bondho" 🔌 100% offline — every feature works with zero internet, forever
Stock counted by walking the aisles 📦 Self-maintaining inventory — every sale and purchase moves stock automatically
Kitchen orders shouted across a noisy floor 🍽️ Restaurant mode — table tabs, printed kitchen tickets (KOT), settle-the-bill in two taps
English-only software the staff can't read 🇧🇩 বাংলা-first — full Bangla/English toggle, ৳ everywhere, lakh-style number grouping
Monthly subscription bills 💸 One-time license. Own it. The optional Cloud Plan is exactly that — optional

The 5-minute pitch to any shop owner: scan a product, take cash, print a receipt with your shop name on it, and mark ৳50 baki against a customer — all before the tea gets cold, all without internet.


🧭 One app, two businesses

On first launch BechaKena asks which kind of business you run — and reshapes itself to fit. Each module keeps its own isolated database (its own staff, catalog, sales and reports), so a device is never confused about what it's selling.

🏪 Super Shop / Retail 🍽️ Restaurant / Café
  • Barcode-first product grid
  • Cart → cash / bKash / Nagad / card → receipt
  • Baki khata (customer credit)
  • Purchases, suppliers, expiry batches
  • Low-stock & expiry alerts
  • Floor of dining tables with live tabs
  • Dine-in · Takeaway · Delivery orders
  • Add to a running tab that survives restarts
  • Fire a Kitchen Ticket (KOT) — only the new items
  • Settle → same immutable sale engine + receipt

Switching modules is one tap (Settings → Switch module) and never touches the other module's data.


📸 Screenshots

Retail POS — English Retail POS — বাংলা
Retail checkout in English Retail checkout in Bangla
Receipt Reports
Thermal receipt preview Reports dashboard
Restaurant floor Live tour
Restaurant tables and running tabs ▶ 22-second walkthrough — or run it in your browser

🚀 Features

🧾 Point of Sale (retail)

  • Animated product grid with live search — Bangla names, English names, or barcode
  • USB barcode scanner support (keyboard-wedge, no drivers — the kind every shop in BD already has)
  • Fractional quantities for loose goods — sell 250 g of moshla exactly, no float errors ever
  • Per-line and whole-bill discounts, VAT-inclusive pricing (the shelf price is what the customer pays)
  • Split checkout across Cash / bKash / Nagad / Card with automatic change calculation

🍽️ Restaurant service

  • Tables view — see which tables are free, which have a running tab, and the live total on each
  • Running orders — items persist to the tab as they're added, so it survives navigation and power cuts
  • Kitchen tickets (KOT) — fire only the newly-added items to the kitchen printer; re-adds start a fresh ticket
  • Order types — dine-in (by table), takeaway and delivery (by guest name), from one hub
  • Settle finalizes an immutable sale through the exact same engine as retail — one receipt, one truth

📒 Baki Khata (customer credit)

  • Attach any sale to a customer — the shortfall books as due automatically
  • Per-customer running balance, derived from immutable records (it can't silently drift)
  • Receive payments against dues in two taps
  • SMS due-reminder templates + local outbox queue (bn/en)

📦 Inventory that runs itself

  • Stock is derived from movements — sales subtract, purchases add, adjustments correct — per branch
  • Opening stock at product creation; expiry dates on purchase batches
  • Low-stock and expiring-soon alerts on the Inventory tab
  • Supplier purchases with per-line unit cost and expiry

👥 Staff, roles & branches

  • PIN login, fully offline — first run creates the owner; owners/managers add managers and cashiers
  • Capability matrix — a cashier sees only sell + customers; back-office tabs are hidden and deep links are bounced
  • Every sale is attributed to the signed-in staff; Reports shows a sales-by-staff breakdown
  • Multi-branch/outlet — stock, sales and orders are scoped per branch

📊 Reports

  • Today at a glance: transactions, sales total, new dues
  • Date-range sales trend, top products, payment-method split, VAT summary
  • Sales history with receipt reprint; returns/refunds against finalized sales

🔒 Built on hard guarantees

  • 💰 All money is integer paisa — floating-point rounding bugs are structurally impossible
  • 🧾 Finalized sales are immutable — corrections happen via returns/adjustments, so your books are audit-proof
  • 🔄 Every record is sync-ready (UUIDv7 + device id) for the multi-device Cloud Plan
  • 🌐 Every screen ships in বাংলা and English from day one
  • 🔐 Nothing exposed on the network — the POS has no HTTP API, route handler or Edge Function; every data mutation is local and gated by the signed-in role's capability matrix. This local RBAC is an access-control boundary, not a network security boundary

🏗 Architecture

flowchart TB
    subgraph APP["🖥 Flutter App (Windows · Android · iOS)"]
        PICK["Module picker → Super Shop | Restaurant"]
        UI["features/ — pos · tables · products · customers · inventory · reports · settings"]
        CORE["core/ — Money · Qty · Drift DB · printing (receipt + KOT) · backups · SMS · CSV"]
        PICK --> UI --> CORE
        CORE --> DB[("SQLite ×2\nper-module, offline source of truth")]
    end
    DB -. "planned outbox push / cursor pull\n(not implemented)" .-> SB
    subgraph SB["☁️ Supabase (roadmap only)"]
        PG[("Postgres mirror\nRLS by shop")]
        EF["Edge functions (roadmap):\nlicensing · SMS"]
    end
Loading
  • Offline-first is a hard rule — the cloud is additive, never required.
  • Stock never stored as a number: stock = SUM(stock_movements.qtyDelta) per branch — merges conflict-free across devices.
  • Each business module runs in its own SQLite file — physically isolated data, staff and reports.
  • Full architecture and data model: docs/DESIGN.md

Source map — every component

The submission ZIP contains every source and documentation file listed below (generated Dart and build/cache output are excluded and regenerated by the quickstart). Nothing is shipped as a compiled-only part, and there is no hidden server component:

Component Source in the archive What it contains
Flutter POS (the product) lib/, test/, assets/, android/, ios/, linux/, windows/, web/, pubspec.yaml, pubspec.lock All Dart UI/logic, tests, bundled font, and every platform runner. Windows includes the full C++ runner (main.cpp, flutter_window.*, win32_window.*, utils.*, Runner.rc, resource.h, runner.exe.manifest, runner/CMakeLists.txt, resources/app_icon.ico) next to the CMake files.
Marketing + demo host site/ Next.js static export (output: "export"). site/app/ contains only page, layout, robots, sitemap and CSS — no route handlers, no API routes.
Database database/ schema.sql (v9, 21 tables), seed.sql, generation notes.
Build, package, deploy scripts/, tool/, docker/, .github/, docker-compose.yml ZIP packager, schema/seed dumpers, Dockerfile + nginx, CI/release workflows.
Documentation README.md, HowToSetup.md, CLAUDE.md, CHANGELOG.md, AUDIT_RESPONSE.md, docs/ Setup, design, operations, security, dependency evidence, submission notes.
Mobile build notes mobile/README.md Points to the single Flutter project at the root; the source is not duplicated.

No separate admin app or API exists in this submission. Owner/manager back-office features (staff, products, purchases, reports, settings) are screens inside the same Flutter binary and are role-gated. The Cloud Plan (Supabase/Edge Functions) is roadmap-only: no backend source, migrations or secrets for it ship here.

Layer Technology
UI / App Flutter 3.47 (one codebase → Windows, Android, iOS)
State Riverpod 3
Routing go_router (capability-guarded routes)
Local database Drift (SQLite) — 21 tables, schema v9, per-module files
Cloud (optional, roadmap) Supabase — Postgres, Auth, Edge Functions; no backend source ships
Receipts & tickets ESC/POS thermal 58/80 mm — LAN today; USB/Bluetooth transports built-in (plugin-enabled) + shop-logo raster header + kitchen tickets
Localization Flutter ARB — bn + en (252 keys, full parity)

🏁 Getting Started

International shop settings and replenishment

On a new installation, create the owner, then open Settings before adding products to choose the module's accounting currency, tax label and business tax ID. Supported currencies: BDT, USD, EUR, GBP, AED, SAR, INR, CAD, AUD, SGD, MYR and PKR. All use exactly two decimals. Checkout, entry parsing, receipts, reprints, reports and reminder previews use the saved currency. Language selection (English/Bengali) persists on the device.

Currency changes are locked once products, running-order lines or financial records exist, including deleted records. This protects historical amounts; there is no currency conversion, foreign exchange, zero/three-decimal currency support, or certification of local tax rules. The browser demo starts with BDT sample data. Keep an actual shop's catalog blank until its currency is chosen.

Inventory → Replenishment planner uses the active outlet's last 28 days of sales, derived stock, minimum level and selectable lead/cover days to suggest order quantities. Piece units round upward. Plans can be exported as CSV; they do not place orders or change stock. With no sales history, the minimum stock level supplies the target. Promotions, seasonality, returns and supplier availability are not forecast by this advisory calculation.

Prerequisites

  • Flutter SDK ≥ 3.47.7 (stable)
  • Windows: Visual Studio with Desktop development with C++
  • Linux (dev): sudo apt-get install clang cmake ninja-build pkg-config libgtk-3-dev
  • Android: Android Studio / SDK
  • Optional: sqlite3 CLI (3.35+) to create the review/demo database from database/*.sql

Build & run

The copy-paste clean-machine sequence (restore → codegen → SQLite fixture → run) is in HowToSetup.md.

git clone <repo-url> bechakena && cd bechakena
flutter pub get
dart run build_runner build   # generate Drift/Riverpod code
flutter gen-l10n                                           # generate localizations

flutter run -d windows      # shipping desktop target
flutter run -d linux        # development on Linux
flutter build apk           # Android release

📦 Building installable apps for clients

To produce an artifact a shop owner can install and run — a Windows installer, a sideloadable Android APK, a Linux package, or an iOS build — see the full per-platform packaging guide: docs/BUILD.md.

Fastest path: push a v* git tag and GitHub Actions builds the Windows zip + Android APK and attaches them to a Release automatically.

git tag v1.0.3 && git push origin v1.0.3    # → Windows .zip + Android .apk on the Releases page

Run the test suite

flutter analyze   # must stay clean
flutter test      # money math, stock, sales, baki, orders/KOT, permissions, widgets, schema/seed scripts

📚 Documentation

Guide What's inside
HowToSetup.md Step-by-step install (VPS, Docker, Windows, Android), database setup, first admin login, branding
database/README.md The shipped schema.sql / seed.sql and how they stay correct
docs/BUILD.md Building installable apps per platform
docs/OPERATIONS.md Day-to-day operations, printing, the optional Cloud Plan
docs/DESIGN.md Architecture, data model, feature spec
CHANGELOG.md Version history
.env.example Every configuration variable, with placeholders and comments
docs/VIBE96.md Marketplace submission notes: description, category, archive layout
docs/RESUBMISSION.md Version 1.0.3 reviewer checklist, audit #1051 evidence, listing images, validation and publication steps
docs/SECURITY.md Local-only RBAC (R5 scope), threat model, dependency audit evidence
docs/dependency-audit/ Raw npm audit, flutter pub outdated and OSV scan output for R6
LICENSE-NOTE.md Licence terms for the software and its bundled third-party components

📖 Admin Guide

First-time setup

  1. Launch BechaKena — first you pick a module (Super Shop or Restaurant). This choice is remembered and opens that module's own database.
  2. A quick feature tour runs once, then you create the owner account (name + PIN). Everything is offline; no internet or sign-up.
  3. Go to Settings → ভাষা/Language and choose বাংলা or English.
  4. Load a catalog:
    • Restaurant ships a demo menu automatically on first open.
    • Retail: tap Load demo on the empty POS, or Settings → Load sample products, or add your own via Products → Add product.

Selling — retail

Task How
Add item to bill Scan barcode · tap product card · type in search and press Enter
Change quantity Use the ➕ / ➖ steppers on the invoice line
Take payment Pay → split across Cash / bKash / Nagad / Card → change is calculated → Confirm sale
Print receipt The receipt preview opens after every sale — hit Print (ESC/POS printer, set up in Settings)
Sell on baki In the Pay dialog, pick the customer — any shortfall is booked as their due
Unlisted item ➕ icon on the invoice panel → name, price, quantity

Serving — restaurant

Task How
Open a tab Tables tab → tap a free table (or Orders → New takeaway/delivery)
Add items Tap menu cards — each item persists to the tab immediately
Fire the kitchen Send to kitchen prints a KOT of only the new items; a badge shows how many are unsent
Manual/off-menu item ➕ on the order panel → name, price, quantity
Settle the bill Settle → split tender (cash/bKash/Nagad/card) → finalizes an immutable sale + receipt, frees the table
Cancel 🗑 on the order — cancels the tab with no sale side effects

Staff, roles & branches

  • Settings → Staff & PINs: owners and managers add staff (manager/cashier) each with their own PIN.
  • Roles are a capability matrix — cashiers can sell and manage customers; managers add back-office; owners can do everything.
  • Log out returns to the PIN screen — the next person signs in with their own PIN.
  • Multi-branch: add and switch outlets in Settings; stock and sales are tracked per branch.

Inventory alerts

  • The Inventory tab lists products at or below their low-stock level and purchase batches expiring within 14 days (already-expired flagged in red).
  • Set a product's low-stock level when adding it; expiry dates come from purchase entries.

Purchases & stock corrections

  • Purchases tab → New purchase: pick the supplier (or add one inline), enter lines with quantity, unit cost, and optional expiry — stock restocks automatically.
  • To correct stock (shrinkage, count fixes), tap any product → Adjust stock with a signed change and a reason. Every correction is a permanent movement record.

Printer setup

  1. Settings → Printer: pick the connection — LAN / USB / Bluetooth.
    • LAN (recommended, works everywhere): enter the printer's IP (RAW/JetDirect, port 9100).
    • USB / Bluetooth: tap Select device (needs the native plugin enabled — see docs/OPERATIONS.md §6).
  2. Choose 58 mm or 80 mm paper, Save, then hit Test print to verify.
  3. Add a shop logo in Settings → Shop profile → Choose logo — rasterised and printed atop every receipt. Shop name, address, phone and footer print on every invoice.
  4. Amounts print as Tk — universal across cheap thermal printers.

Data & backup

  • Each module's data lives in its own SQLite file under the app's data directory (bechakena_<module>.db).
  • Settings → Backup now writes a clean snapshot into your Downloads/Documents folder — copy it to a pen drive.
  • Settings → Restore from backup picks a snapshot; it applies the next time the app starts (into that module only).
  • Settings → Clear local data wipes this module back to a fresh install — back up first; applies on next launch.
  • Sales can never be edited after finalization. Mistakes are corrected with returns/adjustments — this is what makes the numbers trustworthy.

Full day-to-day operations guide — demo data, clearing local data, logo/invoice setup, and the optional Cloud Plan (Supabase sync + SMS gateway): docs/OPERATIONS.md.

License & Cloud Plan (roadmap)

  • One-time license per shop, verified fully offline (signed key bound to the machine).
  • The planned Cloud Plan would add encrypted cloud backup, multi-device sync, and remote owner access. These features are not implemented in this release.
  • Submission scope: the Cloud Plan is roadmap-only today. No cloud backend, Edge Functions or server secrets ship in this repository — the local POS is complete and wholly functional offline, and this archive contains no API surface to deploy or protect. Backend code, when it exists, is server-side and out of scope for this submission.

Full licence terms for the software and its bundled components: LICENSE-NOTE.md.


🧑‍💻 Development

BechaKena is built test-driven: the money engine, stock derivation, invoice numbering, sale finalization, running orders/KOT, and the permission matrix all had failing tests before they had implementations.

lib/
├── app/          # module picker gate, router (capability-guarded), theme, brand
├── core/         # Money (integer paisa) · Qty (milli-units) · format (৳, lakh, বাংলা digits)
│   └── db/       # Drift schema (21 tables), DAOs, sale finalization, orders/KOT, per-module open
├── features/     # feature-first: pos · tables · products · customers · inventory · reports · auth · settings
└── l10n/         # app_en.arb + app_bn.arb — every string, both languages

Hard rules (enforced by tests — see CLAUDE.md):

  1. No feature may require network.
  2. Money is integer paisa; quantities are integer milli-units. No doubles. Ever.
  3. Stock is always derived, never stored.
  4. Finalized sales are immutable.
  5. Every user-facing string exists in both bn and en.

🗺 Roadmap

  • Money/Qty engine, ৳ formatting, invoice numbering
  • Drift schema + derived stock + atomic sale finalization
  • Retail POS: grid, search, cart, split cash & baki checkout
  • Products, Customers (baki khata), reports, বাংলা/English
  • ESC/POS receipt printing over LAN + receipt preview + test print
  • Purchases UI with supplier & expiry tracking
  • Manual items, stock adjustments, backup/restore
  • Analytics dashboard: sales trend, top products, payment split (date ranges)
  • Staff PINs & role-based capability matrix, offline login gate, staff-wise sales
  • Low-stock & expiring-soon inventory alerts
  • Sale returns/refunds + sales history (reprint receipts)
  • CSV product import/export
  • SMS due-reminder templates + local outbox queue (bn/en)
  • Shop-logo raster header on receipts + per-module clear-local-data reset
  • USB/Bluetooth printer transports (plugin-enabled) alongside LAN
  • Restaurant module: dining tables, running tabs, KOT kitchen tickets, takeaway/delivery, settle
  • Multi-branch foundation: per-branch stock, sales & orders
  • Bangla bitmap text on receipt body
  • Cloud Plan: SMS gateway dispatch, encrypted backup, multi-device sync
  • Ed25519 offline licensing + activation

📣 Would you buy this? (a note to the community)

We're gauging whether an offline-first POS like this is genuinely sellable to local shops and restaurants in Bangladesh. Here's the short pitch we're floating on Reddit — copy/adapt it if you want to help us test the waters:

Title: Built an offline-first POS + restaurant billing app for Bangladeshi shops — would owners actually pay for this?

I've been building BechaKena (বেচাকেনা — "buying & selling"), a POS that runs 100% offline on a cheap Windows PC, Android tablet or phone. No monthly fee — one-time license, and it keeps working during load-shedding / no internet.

It does two things out of one app:

  • Retail super shops — barcode billing, baki khata (digital customer credit), auto inventory, bKash/Nagad/card split payments, thermal receipts with the shop's own name.
  • Restaurants/cafés — table tabs, kitchen tickets (KOT) printed to the kitchen, takeaway/delivery orders, settle-the-bill.

Everything is বাংলা-first (full Bangla/English toggle, ৳, lakh-style numbers), works with the cheap USB barcode scanners and thermal printers shops already own, and the books are tamper-proof (finalized sales can't be edited — only refunded).

My real question for shop/restaurant owners (and anyone who's sold software here): is there a real market for a one-time-price, offline, Bangla POS, or has everyone already moved to the subscription cloud apps? What would you actually pay for a lifetime license — ৳2k? ৳5k? more? And what's the one feature that would make it a no-brainer?

Happy to share a demo build. Not selling anything in this post — genuinely trying to learn whether this is worth taking to market. 🙏

Good places to post & ask: r/bangladesh · r/dhaka · r/smallbusiness · r/software · r/flutterdev (as a build-in-public/tech angle) · local Facebook groups for dokandars and restaurant owners.


BechaKena · বেচাকেনা — made with ❤️ by neWell Software for the shops & kitchens of Bangladesh 🇧🇩

One-time price. Yours forever. Online optional.

About

🛒 BechaKena · বেচাকেনা ### The offline-first POS built for Bangladeshi shops

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages