ERP MVP — From Dashboard to Company System
How to evolve the demo dashboard into a real, lean ERP. 5 modules in Lovable Cloud. 4-sprint roadmap.
TL;DR
A dashboard shows data. An ERP creates operations. The difference: dashboard reads, ERP writes. In 4 sprints you go from “eye on the number” to “company system running”.
Why evolve, instead of building from scratch
Typical founder tries to buy a big ERP (TOTVS, Senior, Bling) and:
- Implementation takes 6-12 months
- Customization becomes hostage to the vendor
- 60% of features they paid for never get used
- Team resists because changing is expensive
Another strategy: start from the dashboard (which you already built in lesson m06-build-dashboard) and evolve module by module.
Eye on the number. When something is wrong, someone opens Excel.
Company system. Sales come in, stock decreases, invoice gets issued, billing goes out, collection reminds, accounts reconcile.
ERP MVP stack
| Layer | Tool | Why |
|---|---|---|
| Frontend + agent | Lovable | You describe, it builds |
| Database + Auth | Lovable Cloud | Internal database, auth, realtime — no external setup |
| Automation | n8n | NF-e, billing, email, integrations |
| Security | Aikido | Continuous code + cloud scanning |
| Payments | Stripe (B2B) or Asaas/Cobre Fácil (BR boleto) | Direct API |
| NF-e | NFE.io or Plug Notas | API + SEFAZ |
Total monthly cost (real SMB operation): ~US$ 80-150/month. Compare with TOTVS at R$ 8-15k/month.
5 modules · 4 sprints
Sprint 1 (2 weeks) — Sales
Reuses the existing dashboard + adds writes:
- Customer registration screen (with tax ID validation)
- Order creation screen (with real-time margin calculation)
- Pipeline management screen (draggable Kanban: lead → qualif → proposal → closed)
- Commission auto-calculated per rep
- Discount approvals above X% require manager OK
Tables in Lovable Cloud:
customers (id, legal_name, tax_id, segment, rep_id, credit_limit, status)
orders (id, customer_id, rep_id, date, status, total_value, total_cost)
order_items (id, order_id, sku, qty, unit_price, discount_pct)
opportunities (id, customer_id, rep_id, stage, estimated_value, prob, expected_date)
Critical RLS: rep only sees their customers/orders. Manager sees everything in the region.
Sprint 2 (2 weeks) — Inventory + Purchasing
- Product registration screen (SKU, average cost, supplier, lead time)
- Stock movement (entry by purchase invoice · exit by sale)
- Automatic ABC curve (top 20% SKUs = X% of revenue)
- Reorder point (balance + lead time + turnover)
- Purchase suggestion grouped by supplier
Tables:
products (id, sku, description, category, average_cost, supplier_id, reorder_point)
stock (id, sku, balance, last_cost, last_movement)
stock_movements (id, sku, type, qty, unit_cost, origin, date, user_id)
purchase_orders (id, supplier_id, status, total_value, expected_delivery)
po_items (id, po_id, sku, qty, negotiated_price)
n8n automation: when balance hits reorder point, auto-create draft PO and notify purchasing in Slack.
Sprint 3 (2 weeks) — Finance
Reuses the financial spreadsheet as a starting point. Adds:
- Accounts receivable with automatic aging
- Collection cadence (D-3 reminder · D+1 overdue · D+7 negative listing)
- Semi-automatic bank reconciliation (imports OFX/CSV)
- Projected cash flow 13 weeks (rolling)
- Cost center by expense category
Tables:
accounts_receivable (id, order_id, customer_id, value, due_date, paid_at, status)
accounts_payable (id, supplier_id, category, value, due_date, paid_at, status)
bank_transactions (id, account_id, date, value, type, reconciled_with)
bank_accounts (id, bank, branch, account, current_balance)
n8n automation:
- Boleto generated via Asaas/Cobre Fácil when order invoices
- Optional dynamic PIX
- D-3, D+1, D+7 personalized email
Sprint 4 (1 week) — NF-e + Collections + Permissions
- NF-e issuance via NFE.io or Plug Notas (CFOP/CST based on customer profile)
- XML stored in Lovable Cloud Storage
- Automatic collections via boleto + PIX (Asaas, Cobre Fácil, Mercado Pago)
- Granular per-user permissions (Admin, Manager, Rep, Purchasing, Finance)
- Audit log of who changed what
Tables:
invoices (id, order_id, access_key, sefaz_status, xml_url, total_value)
users (id, email, role, region, active)
permissions (role, resource, actions)
audit_log (id, user_id, action, entity, date, payload_old, payload_new)
The 5 ready modules
┌──────────────────────────────────────────────────────────┐
│ SALES │ INVENTORY │ FINANCE │ NF-e │ AUTH │
├──────────────────────────────────────────────────────────┤
│ Customers │ Products │ AR / AP │ Issue │ Roles │
│ Orders │ Movements │ Aging │ XML │ RLS │
│ Pipeline │ Purchases │ Collection │ Cancel│ Audit │
│ Commission │ ABC Curve │ Cash 13w │ │ │
└──────────────────────────────────────────────────────────┘
The master prompt for Lovable
Paste this to generate the initial skeleton:
Build a lean ERP for Distribuidora Aurora (B2B electrical materials).
Stack: Lovable + Lovable Cloud (internal database) + n8n (automations).
Users: Admin, Manager, Rep, Purchasing, Finance — RLS by role + rep only sees their own customers.
Modules for Sprint 1:
1. Customers (CRUD with tax ID validation + credit limit + segment)
2. Orders (header + items · real-time margin calculation · approval for discount > 8%)
3. Pipeline (Kanban: Lead → Qualif → Proposal → Negotiation → Won/Lost)
4. Commissions (automatic calculation per rep, monthly closing)
Visual: dark mode, OKLCH palette blue + violet + mint, Inter Tight + Inter typography.
Google + email/password login.
Mobile-first with tables that become cards on mobile.
Import initial data via manual spreadsheet upload (will be provided by the user).
Return the running app + public URL + checklist of what's missing for Sprint 2.
Metrics to track evolution
| Sprint | Success metric |
|---|---|
| Sprint 1 | 100% of new orders enter through the system (not Excel) |
| Sprint 2 | System balance matches physical count with error < 2% |
| Sprint 3 | Aging of overdue accounts drops 30% in 60 days |
| Sprint 4 | Invoice issued in < 3 min after billing (vs 15 min manual) |
- Migration is the real pain. Importing historical Excel is 40% of the work. Reserve a full week just for this.
- Human approval before automating 100%. Automatic collection that wrongly negativizes a customer becomes liability. Create a human checkpoint in the first 90 days.
- Backup BEFORE go-live. Lovable Cloud with backup active. Configure manual daily backup to S3 too.
- NF-e is regulatory. Use a provider (NFE.io, Plug Notas) — don't build from scratch. Penalty for wrong NF is high.
- Performance matters early. 50k orders in a non-indexed table chokes. Create indexes on customer_id, rep_id, date from the beginning.
- Don't migrate everything at once. Sprint 1 (sales) entirely · then Sprint 2. Don't try to open all modules together.
Production checklist (before releasing to the team)
- Lovable Cloud with backup enabled
- External daily backup to S3/Backblaze (don’t depend only on Lovable Cloud)
- Aikido scanning code + cloud + container
- Custom domain configured with SSL
- Human approval on irreversible actions (cancel order, negative-list customer)
- Audit log of who changed what
- Team training (minimum 2 sessions of 1h)
- Rollback plan if things go wrong
- Contingency support (you or someone trusted available for 2 weeks post-go-live)
Real total cost
Estimate for SMB with 10-30 active users:
| Item | Monthly |
|---|---|
| Lovable Pro | US$ 25 |
| Lovable Cloud (included in Pro) | US$ 0 |
| n8n Cloud Starter | US$ 20 |
| Aikido (free up to 10 repos) | US$ 0 |
| NFE.io or Plug Notas (~500 NFs/month) | ~$ 20 |
| Asaas (collection, ~$ 0.30/boleto) | variable |
| Custom domain | ~US$ 1 |
| Total | ~US$ 75-110/month + variables |
About $ 120/month to run an SMB ERP, vs $ 1,500-3,000 for a traditional ERP. Difference of 20-25x with more flexibility.
When NOT to follow this path
- Highly regulated industry (pharma, food with traceability)
- Complex tax operation (interstate transfer with tax substitution, ICMS-ST)
- Massive volume (1M+ orders/month)
- Mandatory compliance audit (SOC 2, ISO 27001 from day 1)
For 80% of Brazilian SMBs, the stack here solves it.
Next step
You finished the full technical track. Paths:
- Apply: follow Sprint 1 with your business spreadsheet
- Go deeper: full prompt library with 51 templates
- Contribute: github.com/jvictordevai/openacademy
Tarefa
List the 3 operational pains in your company today that a lean ERP would solve. For each, describe: which ERP module delivers it + metric that will improve + current owner of the manual work.
3 pains named with corresponding module + expected before/after metric + current owner identified.