Overview
A single Express application serves a multi-tenant data model and a no-build vanilla-JS SPA. Every business table is tenant-scoped; a super-admin console manages tenant lifecycle; and the core loop runs POS billing → invoice → credit/ledger → inventory adjustment → audit log.
Problem & Context
Small retail shops need fast POS billing, inventory with reorder alerts, credit/ledger tracking for pay-later customers, and staff access control — plus a platform operator who can provision or suspend any shop.
Key Capabilities
- Three-tier RBAC (super-admin / tenant-admin / employee)
- POS billing with cash, UPI, card, and credit/ledger
- Credit/ledger tracking with automatic status advancement
- Inventory with reorder alerts and movement log
- Tenant lifecycle: create, suspend, reinstate, hard-delete
- Platform-wide audit log
Engineering Notes
Per-request DB re-validation
Every authenticated request re-checks user and tenant status from the database, so suspending a tenant takes effect immediately even on valid existing JWTs.
Atomic invoice creation
Invoice insert, line items, stock decrements, inventory log, and auto-payment run in one PostgreSQL transaction, with stock validation inside the transaction.
Invoice status as computed state
Status is derived from the sum of payments rather than written directly, keeping financial state consistent.
Price snapshot in invoice items
Product name and price are snapshotted at sale time so historical invoices survive later edits.
Verified in the Repository
Facts below are verified in the project's source repository (static code audit). They are not runtime or business metrics.
- End-to-end smoke test suite with 30+ assertions covering the full workflow
- Multi-tenant data model with tenant_id on every business table
- bcrypt password hashing, JWT auth, rate-limited login, Helmet headers
Current Status & Limitations
MVP · Beta.
- No CI/CD pipeline or database migration system.
- Documented deployment URLs are not verified as live.
- Plan tiers exist in the schema but feature gating is not implemented.
Tech Stack
Links & Availability
Source repository and demo access are shared during technical discovery.