0. Two-line summary
FactoryTracking is a strong shop-floor visibility pilot but incomplete as a sellable garment ERP/SaaS (no hard billing, no real WhatsApp, no GST, no POs, not production-hardened). FactoriQ already has Buy / Demand / Risk IQ, WhatsApp Cloud, inventory depth, and GST invoice patterns — those should be ported into Fabric IQ on top of a rebuilt MES.
1. Who feels the gap (personas)
| Persona | Two-line pain today | What “complete” looks like |
|---|---|---|
| Factory owner | Cannot see buying + floor + billing in one place; trial software feels demo-ish. | One login: buy fabric → make garments → invoice brand → pay ₹5k SaaS. |
| Production manager | Knows batch stages but not capacity plan or WhatsApp alerts. | Line targets, bottleneck alerts on phone, delay risk. |
| Cutting / stitching operator | Uses web UI; QR works; no chat commands. | Scan + move on phone; WhatsApp status optional. |
| Store / purchase | Reorder is manual wa.me draft; no PO document. | Buy IQ draft PO + vendor score + WhatsApp to mill. |
| Brand / buyer | Thin portal; status via phone calls. | Portal + WhatsApp “batch ready” + GST invoice PDF. |
| You (SaaS operator) | No reliable deploy, soft gate, secrets in git. | xyz.fabriciq.ai, Razorpay hard gate, clean ops. |
2. FactoryTracking — gap catalogue
2.1 Production-readiness (must-fix for any paid customer)
| Gap | Two-line explanation | Severity |
|---|---|---|
Monolith app.py | ~7.4k lines / 103 routes — hard to test, review, or scale a team on. | High |
| SQLite default | Fine for demo; weak for concurrent floor phones + SaaS multi-tenant write load. | High |
| Postgres path untested | db.py + SQL file exist; comments admit no real PG validation. | High |
| Secrets tracked in git | .env with API keys was committed; rotate before any public demo. | Critical |
| Broken deploy artifacts | render .yaml, requirements .txt (spaces); Actions YAMLs not under .github/workflows/. | High |
| Almost no automated tests | test_db.py is a dump script, not a suite. | High |
| Soft subscription gate | Expired trial still uses full MES — you cannot sell honestly. | Critical |
| No confirmed live deploy | Templates only; treat as local reference. | High |
2.2 Shop-floor / MES gaps
| Gap | Two-line explanation | Severity |
|---|---|---|
| Fixed six stages only (practically) | Pipeline is configurable in factory_stages but product assumes garment six; no job-work / subcontractor stage model. | Medium |
| No capacity / line scheduling | Daily targets + delay ML ≠ load balancing across lines/machines. | Medium |
| No piece-rate / attendance | Wage calculation for operators not in scope of current code. | Medium (later) |
| No machine maintenance | Downtime / PM not tracked. | Low for MVP |
| Cutting room CAD / marker | No marker efficiency, lay planning, or fabric yield %. | Medium |
| Multi-plant | One company_id ≠ multi-factory hierarchy. | Medium (later) |
2.3 Materials / buying gaps
| Gap | Two-line explanation | Severity |
|---|---|---|
| No formal Purchase Order | Suppliers + message drafts only — mills expect PO numbers. | High |
| No MRP explosion | BOM + reserve list ≠ full material requirements across open orders. | High |
| No fabric roll / shade / lot / width / GSM | Apparel fabric waste and shade continuity are invisible. | High for fabric-heavy plants |
| WhatsApp not automated | wa.me opens chat; does not send via Meta Cloud or track replies. | High |
whatsapp_settings.html orphan | Template references Twilio flags that are not wired in app.py. | Medium |
2.4 Commercial / finance gaps
| Gap | Two-line explanation | Severity |
|---|---|---|
| No GST tax invoice / IRN / e-way | Factory→buyer invoicing still happens outside the app. | High for “ERP” claim |
| No challan / packing list legal docs depth | Packing sheets exist; not full India compliance pack. | Medium |
| Costing shallow | Stage labor rates + material unit cost only. | Medium |
| Buyer portal thin | List + stage view; no claims, tech packs, approvals. | Medium |
| SaaS invoices to you as vendor | No GST invoice from Fabric IQ Pvt Ltd to the factory for ₹5k. | Medium (Phase 4) |
2.5 Product / UX gaps
| Gap | Two-line explanation | Severity |
|---|---|---|
| Flask/Jinja UI | Functional, not “beautiful screens” marketing bar. | High for positioning |
| No native mobile app | Responsive web + camera QR only. | Medium (PWA OK for MVP) |
| No subdomain tenancy | Single host; company via session only. | High for SaaS packaging |
| AI models version skew | Pickles may warn against current sklearn — risk of bad predictions. | Medium |
3. FactoriQ — what we can add (module by module)
Two-line summary
FactoriQ is a general manufacturing ops + AI layer (not garment-native). Reuse its patterns and modules for Buy/Demand/Risk, WhatsApp, inventory depth, and GST; do not expect garment cut-sew MES from it — that comes from FactoryTracking.
3.1 Buy IQ
Two-line: Turns “we need fabric/trims” into scored vendor choice and issueable POs, with email/WhatsApp channels. Where: FactoriQ FE /dashboard/requisitions, /dashboard/orders; BE purchase-order + auto-issue services; AI vendor_selection. Maturity: Strongest IQ module (production-leaning). Fabric IQ use: Fabric/yarn/trim buying with MOQ, lead time, mill score. Add garment fields: GSM, width, composition, shade card, mill name.
3.2 Inventory intelligence (ops, not a named “Inventory IQ”)
Two-line: Locations, transfers, soft reservations, GRN in / delivery out, low-stock notifications — deeper than FT’s single ledger. Where: /dashboard/inventory, locations, transfers, receipts. Fabric IQ use: Store rooms + floor buffers; later roll barcodes. Still missing even in FactoriQ: fabric roll/shade/width ontology — new work.
3.3 Demand IQ
Two-line: Forecast / reorder / safety stock from history; feeds planning. Where: /dashboard/iq/demand, BE iq-modules + MRP hooks. Maturity: Partial (heuristics/LLM; docs call MRP weakest). Fabric IQ use: Seasonal fabric demand + trim reorder from consumption + order book.
3.4 Risk IQ
Two-line: Supplier risk signals from internal OTD/quality; external scan largely stub. Where: /dashboard/iq/risk. Maturity: Partial / demo. Fabric IQ use: Mill reliability from your own late deliveries & defect rates first.
3.5 WhatsApp (critical for India garment)
Two-line: FactoriQ has Meta Cloud API + Baileys (WhatsApp Web) + alert templates + inbound webhooks; FT only has deeplinks. Capabilities to port:
| Capability | Two-line | Fabric IQ target phase |
|---|---|---|
| Outbound Cloud text | Send approved template/alert to supervisor or mill. | Phase 1 |
| Alert templates | low_stock, po_approval, shop_floor_update, daily_brief. | Phase 1–2 |
| Inbound floor commands | Text like BATCH-123 move stitching / WO progress (Baileys or Cloud). | Phase 2 |
| Vendor quote threads | RFQ/negotiation over WhatsApp. | Phase 2 |
| Invoice ping | Send invoice summary link to buyer. | Phase 3 |
Prerequisite: Meta Business verification + template approval — start week 1 of build.
3.6 Customer invoicing + GST (India)
Two-line: FactoriQ sell-side has AR invoices, GSTIN fields, e-invoice IRN and e-way (mock or live NIC). Fabric IQ use: After DISPATCH, generate tax invoice PDF + optional IRN; e-way for shipments. Maturity: Partial/demoable — plan mock first, live NIC when factory has creds.
3.7 InvoiceIQ (vendor bills)
Two-line: Extract vendor invoices, 3-way match, anomaly flags. Fabric IQ use: Mill fabric invoices against PO + GRN. Phase: 2–3 optional.
3.8 Other FactoriQ IQ (selective)
| Module | Two-line | Priority |
|---|---|---|
| IntakeIQ | NL → requisition lines (WhatsApp/email fabric asks). | Nice Phase 2 |
| SupplierIQ / TenderIQ / ContractIQ | Qualify mills, tenders, contract renewals. | Phase 3+ |
| Tally connector | Accounting stays in Tally; push vouchers. | Phase 4 |
| Firebase multi-tenant auth | Proven tenancy; optional if email/password MVP. | Optional |
3.9 What FactoriQ does not give you
- Garment stage MES (CUTTING→DISPATCH move/receive/QR) — rebuild from FT
- Self-serve SaaS billing +
xyz.fabriciq.aisubdomains — build new - Piece-rate payroll, CAD/marker, full GL — out of Fabric IQ v1
4. Combined “value loops” we should sell
4.1 Make loop (from FT — already exists)
Buy order → create batch → QR → move/receive → QC defects → pack → dispatch → reports.
4.2 Buy loop (from FactoriQ — to add)
Low stock / Demand IQ → requisition → Buy IQ vendor score → PO → WhatsApp to mill → GRN → inventory.
4.3 Talk loop (WhatsApp — to add)
Stage move → template to supervisor group; buyer gets “Ready”; mill gets PO; floor can reply status.
4.4 Money loop (GST + SaaS — to add)
Dispatch → GST invoice to brand; factory pays Razorpay ₹5k/mo → hard access to xyz.fabriciq.ai.
flowchart LR
subgraph make [Make today]
B[Batch] --> M["Move and receive"]
M --> D[Dispatch]
end
subgraph buy [Buy port]
R[Requisition] --> PO[PO]
PO --> GRN["GRN stock"]
end
subgraph talk [WhatsApp]
WA[Alerts]
end
subgraph money [Billing]
GST["GST invoice"]
SaaS[Razorpay] --> Access["Hard gate"]
end
GRN --> B
M --> WA
PO --> WA
D --> WA
D --> GST
5. Prioritized backlog for Fabric IQ (gap → feature)
| Priority | Feature | Closes which gap | Source |
|---|---|---|---|
| P0 | Postgres + modular API + tests | Prod readiness | New |
| P0 | Hard subscription gate + Razorpay | Soft billing | New (+ FT ideas) |
| P0 | Rebuild MES stages/QR/move/receive | Core product | FT domain |
| P0 | Subdomain tenancy | SaaS packaging | New |
| P1 | WhatsApp outbound alerts | Ops automation | FactoriQ |
| P1 | Inventory ledger + BOM (hardened) | Materials | FT + FQ |
| P1 | Beautiful Next.js UI | Positioning | New UI |
| P2 | Buy IQ + formal POs | Buying gap | FactoriQ |
| P2 | Fabric item fields / rolls start | Fabric domain | New |
| P2 | WhatsApp inbound floor/vendor | Ops automation | FactoriQ |
| P3 | Demand IQ + Risk IQ | Intelligence story | FactoriQ |
| P3 | GST AR invoices | Finance gap | FactoriQ |
| P3 | Buyer portal polish | Brand experience | FT + new |
| P4 | Yearly plan UX, SaaS GST to customer, Tally, PWA | Scale | New / FQ |
6. Explicit non-goals (v1–v3)
Do not block Fabric IQ launch on: full payroll, CRM, IoT OEE, CAD/marker suite, multi-country tax beyond India GST, autonomous no-touch negotiation at enterprise depth, or migrating every FactoriQ marketing “Plan/Make/Move/Grow” label.
7. Two-line takeaway
Close P0 production + MES + billing first so a factory can pay and run cut→dispatch; then add WhatsApp + Buy IQ, then Demand/Risk + GST. That sequence turns FactoryTracking’s demo into Fabric IQ without boiling the ocean.
Next: 03 Fabric IQ plan — architecture, subscription E2E, shop-floor E2E target, timeline.