Skip to content

Instantly share code, notes, and snippets.

@1RB
Created June 2, 2026 16:51
Show Gist options
  • Select an option

  • Save 1RB/1e68d685a22940e7f4e53614114387df to your computer and use it in GitHub Desktop.

Select an option

Save 1RB/1e68d685a22940e7f4e53614114387df to your computer and use it in GitHub Desktop.
B.A.B.Y README preview

B.A.B.Y — Be Able. Be You.

Modern inventory and business management for retail businesses that existing ERPs forgot.

Next.js React TypeScript Rust License


What is B.A.B.Y?

B.A.B.Y is a full-stack open-source ERP built for small and mid-size retail businesses in emerging markets. It replaces spreadsheet-and-paper chaos with real-time inventory tracking, sales, accounting, payroll, and multi-branch operations — all designed to work offline as a PWA on cheap Android tablets and unreliable networks.

Existing tools (Odoo, SAP, Salesforce) assume stable internet, literate workforces, and budgets that don't exist for most SMBs. B.A.B.Y is built from the ground up for the actual conditions these businesses operate in.


Screenshots

Dashboard

Real-time metrics, inventory health, financial health, and quick actions.

Dashboard

Inventory / Items

Full item catalog with SKU tracking, stock levels, filtering by location and status.

Items

Sales

Revenue tracking, order metrics, profit margins, and transaction history.

Sales

Expenses

Business spending tracking by category with breakdowns and recent transactions.

Expenses

Analytics

Data visualizations for revenue trends, sales by location, top products, and payment methods.

Analytics

Login & Authentication

Clean split-screen login with organization branding.

Login Wide Login Narrow


Mobile

Designed for tablet and phone use in retail environments. Collapsible navigation, touch-friendly cards, and responsive layouts throughout.

Dashboard Items Sales
Mobile Dashboard Mobile Items Mobile Sales
Expenses Analytics
Mobile Expenses Mobile Analytics

Architecture

┌─────────────────────────────────────────────────────────────┐
│                    Next.js 16 App Router                      │
│  React 19 · TypeScript 5 · Tailwind · shadcn/ui · Framer  │
├─────────────────────────────────────────────────────────────┤
│  Real-time subscriptions  │  PWA · Offline queue · Push      │
│  via SpacetimeDB WS       │  notifications · Barcode scan    │
├─────────────────────────────────────────────────────────────┤
│              SpacetimeDB Rust Backend (cdylib)              │
│   In-memory + persistence · Reducers · Subscriptions          │
└─────────────────────────────────────────────────────────────┘

Tech Stack

Layer Technology
Framework Next.js 16 (App Router) + Turbopack
Frontend React 19, TypeScript 5, Tailwind CSS
UI shadcn/ui, Radix primitives, Framer Motion
Backend SpacetimeDB (Rust cdylib), real-time WebSocket
Auth JWT-based session auth
DB SpacetimeDB in-memory with persistence
Mobile PWA, offline queueing, barcode/QR scanning
Print Zebra TLP 2844 thermal label integration

Modules

  • Inventory — Multi-location stock tracking with variant-level granularity (size, color, etc.)
  • Sales & POS — Checkout, receipts, returns, customer analytics
  • Purchasing — Purchase orders, supplier management, pricing history
  • Transfers — Inter-branch / inter-warehouse stock transfers with full audit trail
  • Accounting — Chart of accounts, journal entries, reconciliation, financial statements
  • Payroll — Employee management and payroll processing
  • Barcodes & Labels — SKU generation, barcode scanning, thermal label printing
  • Analytics — Real-time dashboard metrics via WebSocket subscriptions
  • Admin — RBAC, branch management, business configuration

Key Features

  • Offline-first PWA — Works without internet; syncs when connection returns
  • Real-time — All data streams live via SpacetimeDB WebSocket subscriptions
  • Multi-location — Track stock per warehouse, branch, and variant
  • Barcode/QR ready — Scan with camera or dedicated scanner; print thermal labels
  • Bulk import — CSV import with column mapping for migrating existing stock
  • Role-based access — Admin, manager, cashier roles with permission gating
  • Keyboard shortcuts — Power-user navigation throughout the app
  • Mobile-optimized — Designed for tablet and phone use in retail environments

Development

# Install dependencies
bun install

# Run dev server
bun run dev

# Type check
bun run typecheck

# Run tests
bun test

Requires a SpacetimeDB module running. See .notes/QUICK_START.md for full setup.


Project Stats

  • 300+ React components
  • 48 custom hooks
  • 210 library modules
  • 40+ App Router routes
  • Rust cdylib backend module

License

MIT — see LICENSE


Contributing

This project is actively maintained and dogfooded by a live retail business. Check open issues or the .notes/ directory for architecture decisions and migration guides.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment