A Course in Thirty-Two Chapters

ERP Engineering: The Real Curriculum

Building and running the system a wholesale apparel brand lives on — the business it must model and the software that models it — taught from absolute zero.

Compiled July 2026 · Written for a beginner building a multi-tenant apparel ERP on Next.js, Postgres (Supabase), and Turborepo

Read this first

What is an ERP? ERP stands for Enterprise Resource Planning, which is a grand name for a simple idea: it is the software a company runs its whole business on. For a wholesale apparel brand that means one system tracking every style and size they sell, how many units sit in the warehouse, which stores ordered what, which orders shipped, and who still owes money. Get any of those numbers wrong and real things break — a store gets promised jackets that do not exist, or an invoice goes out for the wrong amount.

Why half this book is not about code. You cannot model a business you do not understand. An engineer who has never seen a cost sheet will build a costing screen that cannot express landed cost; one who has never been hit with a chargeback will not know that the shipping label is a financial document. So this book teaches the industry as seriously as it teaches the database. Every business chapter ends with a section translating that reality into concrete software requirements — the tables, fields, rules, and reports it demands.

Who this is for. Someone near the very beginning of programming, and new to the apparel trade. You do not need to already know what a database, a server, or an API is — nor what a linesheet, a factor, or an AQL inspection is. Every chapter opens with a plain-language primer covering exactly what it assumes, defines each term the first time it appears, and walks through every piece of code and every calculation line by line. What you do need is patience: this is business software where correctness matters, and the book never waters that down. It ramps the explanation up instead of dumbing the content down.

How it is organised. Part 0 gets you oriented: programming foundations, what an ERP is, and the map of the whole system. Part 1 is the business of fashion wholesale — the money, the calendar, the merchandising, the factories, the retailers, the warehouse, the financing, the regulations. Part 2 is the ten core engineering chapters. Part 3 covers getting the thing adopted, plus the reference material you will keep open in another tab: the complete database schema and the build roadmap, decision log, and glossary.

How to use it. Read Part 0 in order. If you are impatient to build, read Part 1 chapters D, F, and I at minimum before you design any schema — the business model, margin mechanics, and retailer compliance rules shape the data model more than any engineering preference will. When building, the effective order is chapters 1 and 2 first (the ledger and the database shape everything else), then chapter 4's reconciliation pattern, then chapter 5's multi-tenancy, and chapter 6's offline sync last. Chapter 12 lays this out as a phased plan.

The interactive parts. Chapters carry diagrams, runnable playgrounds, and a short quiz. The playgrounds are real code running in your browser — the ledger simulator genuinely recomputes balances, and the floating-point demo genuinely leaks pennies. Use them; they are faster than being told.

One caution. The business, tax, customs, and regulatory material here is an orientation for engineers, not professional advice. Trade rules in particular have moved fast recently. Before you rely on any of it commercially, check it with a qualified accountant, customs broker, and lawyer.