OneBill Platform

Complete Feature Showcase

A multi-tenant billing & inventory SaaS built for small retail/shop owners. Hierarchical roles (Super Admin → Admin → Owner → Worker) with modular permissions and subscription-gated features.

FastAPI + MongoDB · React + Vite + TypeScript + Ant Design · JWT · RBAC · Per-tenant module grants

📌 User Types at a Glance

#RoleOne-Line Purpose
1Super AdminPlatform owner — manages admins, transfers owners, controls platform policies. Has every module.
2AdminReseller/operator — creates owners, manages their module access, subscriptions and alerts.
3OwnerShop/business tenant — runs the shop with a full back-office (sales, inventory, reports…).
4WorkerCashier/salesperson — uses a subset of the owner's modules; can never exceed owner grants.
5Public / GuestVisitor — can register, log in, or reset password only.

👑 Super Admin Features

Platform-level superuser

Bootstrap-created only · Has every system, business and admin module.

🔐 Authentication & Account

  • Log in to the platform with bootstrap credentials.
  • Forced first-run change-password flow.
  • Manage personal profile, sessions, and password.

👥 Admin Management

👤 Create Admin
Provision new admins with email + welcome email.
📋 List Admins
See all admin accounts in the system.
🚫 Deactivate Admin
Suspend an admin account without deletion.
🔑 Reset Admin Password
Issue a temporary password via secure delivery.
🔄 Transfer Owners
Reassign tenant accounts between admins.
📜 Admin Activity Log
Audit trail of all admin actions.

🗺️ Tracking & Oversight

  • Track Map — visual hierarchy: Super Admins → Admins → Owners → Workers.
  • View all admins, all owners (with assigned admin), and all workers (with assigned owner).
  • Owner / admin relationship graph for accountability.

⚙️ Platform Settings

  • Default modules enabled for new owners.
  • Platform branding / configuration.
  • Global toggles and defaults (/super-admin/settings).

🧩 Admin Module Grants

  • Grant / revoke admin-only modules to plain admins.
  • owner_stats — detailed statistics drawer.
  • alerts — send and manage alerts to owners.
  • Plain admins only see owners they have been granted access to.

🔒 Permissions

  • All system modules (auth, profile, subscription, sessions, dashboard).
  • All business modules (full business bypass).
  • All admin modules.

🛠️ Admin Features

Created by a Super Admin

Operates as a reseller/onboarding operator. Business bypass active; admin modules need Super Admin grant.

🧑‍💼 Owner (Tenant) Onboarding

🆕 Create New Owner
Provision a new tenant with name, email, shop name, place, phone.
/owners/new
✉️ Welcome Email
Auto-generates a temporary password and emails it.
🔐 Force Password Change
must_change_password flag on first login.

🧩 Manage Owner Module Access

  • Enable / disable modules for any owner they manage.
  • Toggle business modules: products, inventory, sales, customers, expenses, bank, reports, stores, suppliers, staff, alerts, batches.
  • Audit log of all grant changes.
/admin/owners/modules

📊 Owner Statistics

  • Detailed owner stats per owner.
  • Sales totals, expenses, profit.
  • Product count, customer count, worker count.
  • Active sessions and subscription status.
/admin/owners/{owner_id}/stats require_module("owner_stats")

🔔 Alerts Management

  • Send alerts/notifications to their owners (requires alerts module).
  • Configure alert rules and view history.
  • Stock and business alerts dispatched via SMTP / WhatsApp.

💳 Subscription Management

  • Grant subscription to an owner (plan, start, end date).
  • Renew subscription for an owner.
  • View subscription status: active · expired · grace.
  • Invoices, plan tier, expiry date, grace window.

📜 Activity & Tracking

  • Personal admin activity log.
  • View list of owners they created and manage.
  • View track map (admins → owners → workers).

🔒 Permissions (Default)

  • All system modules + all business modules (business bypass).
  • Does not automatically have admin modules — must be granted by Super Admin.

🏪 Owner Features

The primary tenant

Runs the shop. Configurable feature set via module_grants. Has PrintSettings, Subscription, and full back-office access.
🏠 Dashboard
Daily/weekly/monthly sales, top products, low stock, recent activity.
/
📦 Products
Catalog, pricing, GST, HSN, images, barcodes.
/products
🔖 Barcodes
Generate and scan with device camera.
/barcodes
📊 Inventory
Stock levels, adjustments, low-stock alerts.
/inventory
🛒 Sales / POS
POS checkout, atomic stock reservation, sales history.
/shop · /cart · /sales
👥 Customers
Directory, ledger, loyalty, reminders.
/customers
💸 Expenses
Categorized tracking by date, store, category.
expenses
🏦 Bank
Accounts, deposits, withdrawals, transfers.
/bank
🏬 Stores
Multi-outlet management with per-store inventory.
/stores
🚚 Suppliers
Supplier directory linked to products.
suppliers
👨‍💼 Staff
Create workers, set attendance, manage access.
/staff
🧩 Worker Modules
Per-worker module grants (intersected with owner).
/workers/modules
🔔 Alerts
Stock and business alerts via in-app/email/WhatsApp.
/alerts
📦 Batches
Batch/expiry tracking, expiry alerts, recall support.
/batches
📈 Reports
Sales, P&L, inventory, staff, stores comparison.
/reports
💳 Subscription
Plan, status, expiry, grace, invoices.
/subscription
👤 Profile
Personal info, password, print settings (58mm/80mm).
/profile
📱 Sessions
List and revoke active devices.
/sessions
🧮 Calculator
Built-in calculator utility.
/calculator

🖨️ Print Settings (58mm / 80mm)

  • Header note, footer note, thank-you message on receipt.
  • Paper size: 58mm or 80mm.
  • Settings inherited by all workers (used at receipt printing).

🛡️ Security & Recovery

  • Forced change-password-required flow on first login.
  • Password reset via tokenized email link.
  • Active session monitoring and revocation.

🔒 Permissions

  • All system modules (always): auth, profile, subscription, sessions, dashboard.
  • Business modules per module_grants (default = LAUNCH_CATALOG_KEYS for fresh accounts).

🧑‍💻 Worker Features

Created by an Owner

Scope is automatically narrowed: effective = worker.grants ∩ owner.grants
🏠 Dashboard
Scoped view of shop dashboard and daily sales.
/
🛒 POS / Sales
Browse products, cart, checkout, sales history.
/shop · /cart · /sales
👥 Customers
Lookup and create customers at checkout.
/customers
📦 Products
Browse catalog and lookup by barcode scan.
/products
📦 Batches
View batches during sales.
/batches
🧮 Calculator
In-app calculator.
/calculator
👤 Profile
View/update info, change password, view subscription.
/profile

🚫 What Workers Cannot Access

/inventory · /barcodes · /stores · /bank · /staff · /reports · /workers/modules · /admin/* · /super-admin/*. Any module not granted to them shows a friendly Module not available page.

🌐 Public / Guest Features

Unauthenticated users

See only essential auth flows.

🔐 Authentication

🔑 Login
Email + password.
/login
📝 Register
Self-signup where enabled.
/register
🔁 Reset Password
Via emailed token.
/reset-password
🔄 Change Password Required
Forced on first login.
/change-password-required

🛡️ Security Layers Seen by Guest

  • Login rate limiting (slowapi per-IP).
  • Account lockout after failed attempts.
  • CSRF protection (double-submit cookie pattern).
  • CSP enforced; security headers applied.

🔒 Cross-Cutting System Features

These run across the platform regardless of role.

🔐 Authentication & Security
JWT, server-side sessions, refresh, bcrypt, account lockout.
🏗️ Multi-Tenancy
All tenant data carries owner_id; strict isolation.
🧩 Permissions Engine
RBAC + per-tenant grants + dependency graph + audit log.
💳 Subscription Gating
Plan tiers, active/expired/grace, renewals.
📁 Secure Uploads
HMAC-signed expiring URLs, Pillow validation, per-owner quota.
🖨️ Barcode & Print
Generate (jsbarcode) + scan (@zxing/browser) + 58/80mm templates.
📣 Notifications
In-app + email + WhatsApp, encrypted credentials.
🧾 Auditing
Admin activity log, grant changes, session tracking.
🚀 Performance
Async Motor, lazy pages, bundle compression, React Query.
🧪 Testing
pytest, Playwright e2e, Vitest, React Testing Library.
🐳 Deployment
Dockerfile, run scripts, deploy.md guide.

📋 Module Catalog (Reference)

Authoritative module list lives in backend/app/models/module.py.

System Modules (always on, FR-003)

auth
Login, sessions, JWT, refresh, lockout.
profile
Profile, password change, print settings.
subscription
Plan/billing, status.
sessions
Active devices, revoke.
dashboard
Home overview.

Business Modules (per-tenant toggleable, FR-002)

products
Catalog, pricing, GST, HSN, images, barcode.
sales
POS, sales history, atomic stock reservation.
inventory
Stock levels, adjustments, summaries.
customers
Directory, ledger, loyalty, reminders.
expenses
Expense tracking.
bank
Bank accounts and transactions.
reports
Sales, P&L, inventory, staff, stores.
stores
Multi-outlet management.
suppliers
Supplier directory.
staff
Worker management and attendance.
alerts
Stock & business alerts.
batches
Batch / expiry tracking.

Admin Modules (superadmin-grantable to plain admins)

owner_stats
Detailed statistics drawer.
alerts
Admin-side alert management.

🎬 Demo Flow Suggestions

A typical demo could walk through:

  1. Public → Register / Login as a new user.
  2. Super Admin → Bootstrap, create Admin, review Track Map.
  3. Admin → Create Owner (tenant), grant modules, send welcome alert, renew subscription.
  4. Owner → Add products, configure print settings, add workers, set per-worker modules, perform a sale, view reports.
  5. Worker → Login, scan barcode, complete a sale, view own sales history.
  6. Owner → View worker activity in reports, run P&L, manage inventory alerts.