Module 1 · Fabric Mill · complete

The roll register, yarn book and LC file — in one system a mill can trust.

Pakistan's fabric mills in Faisalabad, Gujranwala and Karachi still run on Excel registers, paper stock books and WhatsApp. Textile ERP replaces them with a multi-tenant system where the numbers can't drift.

Read the code

No sign-up. The demo runs a seeded Faisalabad mill entirely in your browser.

Mill Pulse · this morning

  • LC MCB-LC-26-0829 cleared 10 days ago but not warehoused

    demurrage risk

  • Lot FSD-W-2305 untouched for 120 days

    PKR 4.9 Lac on the rack

  • Loom L-12: only 20% A-grade

    5 shifts, 30 days

  • 30/1 Cotton: about 5 days of cover left

    148 kg/day burn

What Module 1 covers

The first of seven planned modules — from raw yarn to finished export. Each capability below is live in the demo.

Lots & rolls

Digital roll register. Bulk-register a truck of 24 rolls in one step, issue partial rolls to cutting or dyeing — over-issue is impossible, even with two supervisors clicking at once.

Yarn stock ledger

Every kilo in or out is an append-only entry with a running balance. Stock can't be typed over — only posted. Negative stock is rejected by the database itself.

Weaving & knitting

Shift-by-shift loom and machine logs with picks, ends, gauge and grade. Logging a shift draws its yarn from the ledger atomically — all or nothing.

LC imports

Track an LC from opening to port clearance to warehouse. Landed cost per meter is computed server-side and locked once the imported lot is valued.

Roll traceability

Scan a roll's QR label to see its chain of custody: supplier or LC, the looms and operators that wove it, and every issue to the floor.

Mill Pulse

Seven deterministic rules — dead stock, yarn runway, port demurrage risk, loom quality drift — each alert showing the exact numbers that fired it. No AI guesswork.

Built like it will hold real money

Tenant isolation in PostgreSQL

Row-Level Security with FORCE on every table. A query with no WHERE clause still can't see another mill's rows — proven by a test that runs raw SQL.

RBAC on every endpoint

Owner, manager, operator, accountant. The API enforces it; the UI only mirrors it. Switch roles in the demo and watch buttons — and permissions — change.

Invariants, not conventions

Row locks on stock movements, a strict ledger sequence, CHECK constraints, forward-only LC status. 42 backend tests, including a mutation-checked concurrency race.

Spec-first, open source

Built against a written spec (SPEC-ERP.md) with CI on every push. FastAPI · SQLAlchemy 2 async · Next.js 15 · TypeScript strict.

Roadmap

  1. Module 1

    Fabric Mill

    Complete

  2. Module 2

    CMT order lifecycle & auto-billing

    Specced

  3. Modules 3–5

    BOM inventory, party ledgers, financials

    Specced

  4. SaaS

    Billing: Stripe, JazzCash, EasyPaisa, Meezan

    Specced