Course Overview
A step-by-step course that teaches you Duck Gen from the ground up. No prior knowledge required.
Welcome to the Duck Gen Course
This course takes you from zero to production-ready type safety. Each chapter builds on the previous one, so follow them in order.
By the end, you will be able to:
- Understand why type-safe API contracts matter.
- Set up a NestJS project with Duck Gen from scratch.
- Generate typed route maps and message registries automatically.
- Consume generated types with Duck Query on the client.
- Add i18n support using typed message keys.
- Run Duck Gen in CI/CD pipelines for continuous type safety.
Who is this for?
This course is designed for developers who:
- Are new to Duck Gen and want a structured learning path.
- Have basic TypeScript knowledge but no experience with code generation.
- Want to understand the "why" before the "how".
You should be comfortable with TypeScript and have a basic understanding of REST APIs. Experience with NestJS is helpful but not required. Each chapter explains what you need to know as you go.
Course chapters
| Chapter | Title | What you will learn |
|---|---|---|
| 1 | The Problem | Why manual type syncing breaks and how Duck Gen fixes it. |
| 2 | Project Setup | Create a NestJS project and install Duck Gen. |
| 3 | Your First Controller | Build a simple controller and understand decorators. |
| 4 | Generating Types | Run Duck Gen for the first time and explore the output. |
| 5 | Using Generated Types | Import and use RouteReq, RouteRes, and ApiRoutes on the client. |
| 6 | Message Keys | Add typed i18n message registries with @duckgen tags. |
| 7 | Duck Query Client | Set up Duck Query for type-safe HTTP requests. |
| 8 | Real World Patterns | Error handling, interceptors, CI/CD, and production tips. |
How long does it take?
Each chapter takes about 10-15 minutes to read and follow along. The full course can be completed in a single sitting or spread across multiple sessions.
If you already know what Duck Gen does and just want the reference docs, skip to the Duck Gen overview or Configuration.