Sleep & Do Business — B2B Distribution OS MVP

What this is

A runnable responsive web/PWA prototype implementing the first operational layer of the two-district B2B direct-distribution model.

It demonstrates: - Owner control tower - Orders and controlled status progression - Customers - Products - Suppliers - Payment verification - Exception queue - Controlled new-order validation - Supplier/direct-dispatch lifecycle simulation - PWA manifest/service worker for installability on compatible mobile browsers

Run

No build tools are required for the demo.

Option A: - Open index.html directly in a browser for most UI functions.

Option B (recommended for PWA/service worker): - Serve this folder from a local web server, e.g. Python: python -m http.server 8080 - Open http://localhost:8080

Important

This is an MVP/prototype, not a production banking/accounting system. It uses browser localStorage for demo data. Production must replace this with a secure backend, authentication, RBAC, database constraints, server-side rules, audit logs, payment/bank/accounting integrations, encrypted secrets, backups, monitoring and formal UAT.

Production architecture

Recommended: - Web Admin: React/Next.js or equivalent - Mobile: React Native/Expo or Flutter - Backend: Node/NestJS or Java/Spring - Database: PostgreSQL - Cache/queue: Redis - Object storage: S3-compatible - Auth: OAuth2/OIDC + MFA - Payments/accounting/bank: secure APIs/open-banking/bank integration subject to provider support - Notifications: WhatsApp/SMS/email provider - Cloud: AWS/Azure/GCP - Observability: centralized logs, metrics and alerts

Core state machine

DRAFT → QUOTED → CUSTOMER_CONFIRMED → PAYMENT/CREDIT_CHECK → APPROVED → SUPPLIER_SELECTED → PO_CREATED → PO_ACCEPTED → READY_TO_DISPATCH → DISPATCHED → IN_TRANSIT → OUT_FOR_DELIVERY → DELIVERED → COMPLETED → COMMISSION_ELIGIBLE → CLOSED

Exceptions: PAYMENT_EXCEPTION, CREDIT_HOLD, PRICE_EXCEPTION, SUPPLIER_REJECTED, PO_DELAYED, DISPATCH_DELAYED, DELIVERY_FAILED, QUALITY_HOLD, RETURN.

No exception may remain without owner + deadline + next action + escalation.