TypeScript · Lesson 97 of 120
Project: The Plan
An orders library.
Let's build a real project. A small orders library for Northwind Bikes. It validates new orders, checks stock, stores orders, cancels them, sends events, and builds reports. All fully typed.

- An orders library
- Validate, store, cancel
- Fully typed
The files
Types dot TS holds the domain types. Catalog holds products and stock. Schema validates input. Store, result, and events are reusable building blocks. Service and cancel hold the business rules. Reports and the CLI sit on top.
- types.ts: the domain
- catalog.ts: products, stock
- schema.ts: validation
- store, result, events: building blocks
- service, cancel: rules
- reports, cli: on top
The build
We start with the types. Then validation. Then storage and the rules. Then events, reports, and async stock. And finally, tests and a command line tool.
- Types
- Validation
- Store + rules
- Events + reports
- Tests + CLI

Summary
We'll build a typed orders library, file by file. Next, the domain types.
Key takeaways- Orders library
- Types first
- Then rules
Next up: Project: Types — the domain