Workflow Desktop Strategy 2

The core architecture

What you’re building (industry standard)

  • NestJS (TypeScript) = backend (the “brain”)
  • PostgreSQL = database (the “source of truth”)
  • API = REST (or GraphQL later)
  • Web Admin (Next.js/React) = required for office/admin users
  • Flutter mobile = later for technicians (optional but high value)

Flutter doesn’t replace the backend — it connects to it.

Non-negotiable SaaS foundation (build first)

These are the pieces that make it sellable and safe:

  1. Multi-tenant (each customer company is isolated)
  2. Auth + Roles (RBAC)
    • Owner, Admin, Dispatcher, Technician, Accountant
  3. Audit log (who changed what, when)
  4. Billing (Stripe subscriptions + trial)
  5. Settings (company profile, tax settings, invoice templates)

Product modules (your app features)

You’ll have these major modules:

Operations

  • Work Orders (office-created + optional customer request = Pending)
  • Scheduling (availability + assignment)
  • Time Entries (separate Time tab; pay periods)
  • Customers
  • Employees/Technicians

Sales

  • Estimates (optional early)
  • Invoices
  • Payments
  • Credits/Refunds (later)

Inventory + Purchasing

  • Items
  • Stock Movements
  • Vendors
  • Purchase Orders
  • Receiving
  • Reorder points

Accounting (to be a QB alternative)

  • Chart of Accounts
  • General Ledger (double-entry)
  • AR/AP
  • Sales Tax
  • Bank Accounts + Reconciliation
  • Financial Statements (P&L, Balance Sheet, Cash Flow)

The build sequence (so you can actually ship)

To be “standalone like QB” you still need to phase it.

Phase 1: Sellable MVP (Ops + Invoicing + Basic reports)

✅ Work Orders + Scheduling
✅ Time tab
✅ Invoices + Payments
✅ Items + Inventory movements + Purchase Orders
✅ Job costing (labor + materials)
✅ Basic P&L (operational)

This gets you paying customers fast.

Phase 2: True accounting core

✅ Chart of Accounts
✅ Double-entry ledger
✅ AR/AP properly (not just “lists”)
✅ Bank accounts + reconciliation
✅ P&L + Balance Sheet + Cash Flow

At this point, customers can realistically stop using QB or other alternatives for core accounting.

Phase 3: Power features

  • Bank feeds (Plaid or another company)
  • Automation rules
  • Advanced reporting
  • Multi-location warehouses
  • Payroll (optional/add-on)

Key data model (high level)

This mirrors our Excel blueprint and scales cleanly:

Tenant & Users

  • tenants (each customer company is isolated)
  • users
  • roles
  • user_roles
  • audit_logs

Operations

  • customers
  • employees
  • work_orders
  • work_order_services
  • work_order_materials
  • time_entries

Sales

  • invoices
  • invoice_lines
  • payments

Inventory / Purchasing

  • vendors
  • items
  • inventory_movements
  • purchase_orders
  • purchase_order_lines

Accounting (ledger)

  • chart_of_accounts
  • journal_entries
  • journal_lines
  • tax_rates
  • bank_accounts
  • bank_transactions
  • reconciliations

How “standalone accounting” ties to our operations

This is what transforms your system into a standalone accounting solution:

  • Creating an Invoice automatically creates journal entries:
    • Debit AR / Cash
    • Credit Revenue
    • Credit Sales Tax Payable (if applicable)
  • Selling inventory automatically books COGS:
    • Debit COGS
    • Credit Inventory Asset
  • Receiving a Purchase Order can book inventory value:
    • Debit Inventory Asset
    • Credit AP (if billed) or Cash (if paid)

This is what QB does under the hood.