RizTech Academy logo
RizTech Academy

TypeScript Foundation

JavaScript with a type system that catches your mistakes before your users do.

JavaScript will happily let you call a function with the wrong arguments, misspell a property, and pass a string where a number belongs. It tells you at runtime, in production, in front of a user.

TypeScript is JavaScript with a type checker attached. You write nearly the same code, and an entire category of bug becomes impossible to ship.

This course is thorough. It covers not only the types you use every day but the advanced type system TypeScript is actually chosen for — mapped and conditional types, infer, template literals — taught with the judgement of when they earn their place and when they make a codebase unreadable. It also covers the asynchronous code most real TypeScript is, which too many courses skip.

You finish able to work confidently in any TypeScript codebase — which, increasingly, is all of them. It is also a hard prerequisite for the Full-Stack Web Development course, where both halves of the stack are written in it.

Who this is for

  • JavaScript developers who keep hitting avoidable runtime errors
  • Anyone heading into React, Next.js, Node or NestJS work
  • Developers joining a team whose codebase is already TypeScript
  • Anyone taking the Full-Stack Web Development course, where this is required

What you need first

  • Comfortable JavaScript: functions, objects, arrays, promises and modules.
  • Our JavaScript Complete Foundation course covers everything assumed here.

Tools you will use

TypeScript 5Node.jsVS CodetsxESLint

By the end you can

  • Read and write typed JavaScript without fighting the compiler
  • Model data with interfaces, type aliases and unions
  • Use generics to write reusable code that keeps its types
  • Narrow types properly instead of reaching for any
  • Configure tsconfig deliberately rather than copying somebody else's
  • Add TypeScript to an existing JavaScript project one file at a time
  • Type an API response you do not control
  • Use the advanced type system — mapped and conditional types, infer, template literals — where it genuinely helps
  • Type asynchronous code: promises, async/await and the concurrency operators
  • Model your domain so illegal states cannot be represented
  • Write, harden and test a typed library end to end
  • Judge when a precise type is worth the effort and when it is not
Reference code

Stuck? Compare your work

weather-client — the typed weather client the capstone builds end to end: given a latitude and longitude it returns a fully-typed Weather value from the live Open-Meteo API, validating untrusted JSON at the boundary and modelling every failure as a typed Result. It exercises the whole course — discriminated unions, narrowing, generics, unknown and type guards, async, dependency injection, and type-level tests — and is verified (tsc clean, 8 runtime tests, a live API call).

It is there for when you are stuck, not to start from. Type the code yourself first — copying it will teach you very little.

View on GitHub
Syllabus

14 modules, 68 lessons

Work through these in order. Each lesson is short enough to finish in one sitting and ends with something to build, not a quiz.

  1. 1

    Why TypeScript

    The problem it solves, shown with the bugs it prevents.

    1. The bugs TypeScript exists to prevent20 min
    2. How type checking works, and what it cannot do20 min
    3. What TypeScript is not: runtime, performance and other myths15 min
    4. Setting up a TypeScript project from scratch25 min
  2. 2

    The Basic Types

    Everything you will use in your first week.

    1. string, number, boolean and the rest20 min
    2. Arrays and tuples20 min
    3. Enums, and why a union of literals is usually better20 min
    4. any, unknown and never25 min
    5. Inference: when to annotate and when to stop25 min
    6. Literal types and as const20 min
  3. 3

    Objects, Interfaces and Type Aliases

    Describing the shape of your data.

    1. Typing objects20 min
    2. Interfaces25 min
    3. Type aliases, and interface versus type25 min
    4. Optional and readonly properties20 min
    5. Nested and recursive structures25 min
  4. 4

    Functions

    Parameters, return types, and the overloads you rarely actually need.

    1. Typing parameters and return values20 min
    2. Optional, default and rest parameters20 min
    3. Function types and callbacks25 min
    4. Overloads, and why you usually want a union instead25 min
  5. 5

    Unions and Narrowing

    The part of TypeScript that makes it genuinely powerful rather than merely annoying.

    1. Union types25 min
    2. Narrowing with typeof, in and truthiness30 min
    3. Discriminated unions, the best pattern in the language30 min
    4. Writing your own type guards25 min
    5. Exhaustiveness checking with never25 min
  6. 6

    Generics

    Reusable code that does not throw its types away.

    1. Why generics exist, starting from duplication25 min
    2. Generic functions30 min
    3. Constraining a generic with extends30 min
    4. Generic interfaces and classes25 min
    5. Built-in utility types: Partial, Pick, Omit and Record30 min
  7. 7

    The Type System in Depth

    The type-level features TypeScript is actually chosen for — and the judgement to use them where they help, not to show off.

    1. keyof, typeof and indexed access types30 min
    2. Mapped types: transforming every property35 min
    3. Conditional types35 min
    4. Extracting types with infer30 min
    5. Template literal types30 min
    6. Building your own utility types, and when to stop35 min
  8. 8

    Asynchronous TypeScript

    Typing the asynchronous code that most real TypeScript is — promises, async/await, and the concurrency operators.

    1. Typing promises: Promise<T> and what it guarantees25 min
    2. async/await, and the types it infers for you30 min
    3. Running work concurrently: all, allSettled, race and any30 min
    4. Typing callbacks, event emitters and streams30 min
    5. Errors in async code, and unknown in catch25 min
  9. 9

    Data Structures, Typed

    Typing the collections you use every day, and keeping them immutable — with the costs that decide which to reach for.

    1. Arrays, tuples, Map, Set and Record — and what each costs30 min
    2. readonly, ReadonlyArray, as const and deep immutability25 min
    3. Typing iterables, iterators and generators30 min
  10. 10

    Classes, Modules and Decorators

    The object-oriented side, including the decorators NestJS is built on.

    1. Classes and access modifiers25 min
    2. Abstract classes and implementing interfaces25 min
    3. Modules, imports and exports20 min
    4. Decorators: what they are, ahead of NestJS30 min
  11. 11

    Writing TypeScript Worth Reading

    The difference between code that compiles and code worth hiring: unknown over any, honest types, error handling and review.

    1. unknown over any, and never lying to the compiler25 min
    2. Avoiding as and !, and what to do instead25 min
    3. Making illegal states unrepresentable30 min
    4. Typed errors and the Result pattern30 min
    5. Reading TypeScript like a reviewer25 min
  12. 12

    Design Patterns in TypeScript

    Which patterns the type system dissolves, which few earn their place, and when a pattern is over-engineering.

    1. What a pattern is, and how types change the calculus25 min
    2. Discriminated unions instead of class hierarchies30 min
    3. Factory and builder with types and generics30 min
    4. Dependency injection and decorators, the one that earns its place30 min
    5. When a pattern is the wrong answer20 min
  13. 13

    TypeScript in Real Projects

    Config, declaration files, third-party libraries, and code that was not written in TypeScript.

    1. tsconfig explained, option by option30 min
    2. Strict mode, and why to turn it on from day one25 min
    3. Declaration files: .d.ts, ambient types and module augmentation30 min
    4. Types for third-party libraries and DefinitelyTyped25 min
    5. Adding TypeScript to an existing JavaScript project30 min
    6. Typing API responses you do not control30 min
  14. 14

    Capstone: A Typed Library and Client

    Design, build, harden and test a real typed TypeScript package end to end — the shape of the work you will be handed.

    1. The brief: a typed weather API client20 min
    2. Designing the types and the public API40 min
    3. Building the client with generics and narrowing45 min
    4. Hardening it with advanced types and strictness40 min
    5. Testing typed code, including the types themselves40 min

Learning this with a mentor is faster

Going through a course like this one is how you qualify for our six-month internship, for selected students, mostly from Pune. Clear the interview and you build real-world projects with my mentorship.