AI Hints
Home›TypeScript Tutorial›Project: Types and Validation
TypeScript · Lesson 97 of 120

Project: The Plan

An orders library.

⏱ 2 min read▶ Video at 1:15:54🎓 Free
Watch this lesson in the TypeScript courseWatch on YouTube ↗Full TypeScript course

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.

Project: The Plan
From the video: Project: The Plan
  • 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.

  1. types.ts: the domain
  2. catalog.ts: products, stock
  3. schema.ts: validation
  4. store, result, events: building blocks
  5. service, cancel: rules
  6. 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.

  1. Types
  2. Validation
  3. Store + rules
  4. Events + reports
  5. Tests + CLI
The build
From the video: The build

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