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:
- Multi-tenant (each customer company is isolated)
- Auth + Roles (RBAC)
- Owner, Admin, Dispatcher, Technician, Accountant
- Audit log (who changed what, when)
- Billing (Stripe subscriptions + trial)
- 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)usersrolesuser_rolesaudit_logs
Operations
customersemployeeswork_orderswork_order_serviceswork_order_materialstime_entries
Sales
invoicesinvoice_linespayments
Inventory / Purchasing
vendorsitemsinventory_movementspurchase_orderspurchase_order_lines
Accounting (ledger)
chart_of_accountsjournal_entriesjournal_linestax_ratesbank_accountsbank_transactionsreconciliations
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.