# oop-expert-with-typescript: a pattern catalogue you can read in one sitting

> This repository is a TypeScript textbook that covers the pillars of object-oriented programming, the five SOLID principles and twenty-three design patterns, with runnable class examples and a generated website. It is broad rather than deep, it ships without a licence file, and its tooling expects Bun.

**jafari-dev/oop-expert-with-typescript** — A complete guide for learning object oriented programming pillars, SOLID principles and design patterns with TypeScript!

- Repository: https://github.com/jafari-dev/oop-expert-with-typescript
- Website: http://jafari.dev/oop-expert-with-typescript/
- Stars: 636 · Forks: 124
- Language: HTML
- License: not declared
- Published: 2026-10-21 · Updated: 2026-10-21 · Language: en
- Canonical page: https://hysenlabs.com/projects/jafari-dev-oop-expert-with-typescript

## A textbook that builds its own README and site

This is not a library you depend on. The repository is described in its README as a complete guide and tutorial for the principles and techniques of object-oriented programming, meant to serve as a reference for anyone interested in programming and software development, with simple and practical examples in every section.

The structure is more interesting than that description suggests. Alongside README.md there is a Documentations/ directory, an Examples/ directory that the repository listing splits into Examples/DP/ and Examples/SOLID/, a website/ directory, a build/ directory, and two TypeScript scripts at the root: script.ts and html-generator.ts. The package.json scripts section makes the pipeline explicit. The readme script runs bun ./script.ts and then bun ./html-generator.ts, and the site script runs bun ./html-generator.ts on its own. Linting goes through bunx biome check, with a biome.json at the root and @biomejs/biome in the devDependencies.

So the README you read on GitHub is a build artefact. The prose, the code blocks and the table of contents are assembled by a script and rendered to HTML with marked, highlight.js and marked-gfm-heading-id, which are the runtime dependencies. The primary language of the repository is HTML because of that rendering step, not because of the examples.

The audience is a developer who wants a single reference they can scroll. The home page for the guide is jafari.dev/oop-expert-with-typescript/, and the README's table of contents is built from anchor links with a back-to-top marker on every section.

## Six pillars, five principles, twenty-three patterns

The table of contents defines the scope precisely, and it is worth knowing before you read anything.

The fundamentals section has seven entries: what object-oriented programming is, class, objects, abstraction, encapsulation, inheritance and polymorphism. The README states that OOP is a paradigm based on objects that contain data in the form of fields and code in the form of methods, and it names those six as the pillars.

The SOLID section follows with a section on what the acronym means and then one entry per letter: Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation and Dependency Inversion. Each is anchored and numbered in the table of contents, which means each has its own page on the generated site.

The design patterns section is the bulk of the catalogue, and it is organised the standard way. Five creational patterns: Abstract Factory, Builder, Factory Method or Virtual Constructor, Prototype or Clone, and Singleton. Seven structural: Adapter or Wrapper, Bridge, Composite or Object Tree, Decorator or Wrapper, Facade, Flyweight or Cache, and Proxy. Eleven behavioural: Chain of Responsibility, Command or Action or Transaction, Interpreter, Iterator, Mediator or Intermediary or Controller, Memento or Snapshot, Observer or Event-Subscriber or Listener, State, Strategy, Template Method and Visitor.

One detail in those names is worth pausing on. Several patterns are listed with their alternative names, which tells you the guide expects you to have met the vocabulary in more than one place, which is realistic for a reference.

## The examples are complete classes, not pseudocode

The TypeScript samples are runnable rather than schematic, and the class example sets the standard for the rest of the guide.

The Task class shows encapsulation done the way TypeScript supports it directly, with private fields for id, title, description, dueDate and completed, and a constructor that takes a single object describing the task:

```typescript
class Task {
  // Properties
  private id: number;
  private title: string;
  private description: string;
  private dueDate: Date;
  private completed: boolean;

  // Constructor
  constructor(taskInfo: {
    id: number;
    title: string;
    description: string;
    dueDate: Date;
  }) {
```

The state-changing methods then sit behind public visibility, which is the point the section is making:

```typescript
  // Method to mark the task as completed
  public complete() {
    this.completed = true;
  }

  // Method to mark the task as incomplete
  public incomplete() {
    this.completed = false;
  }
}
```

The abstraction section uses a Car class for the same idea, and the prose explains the framing in plain terms: you drive a car without knowing every detail of how the engine works or how the transmission shifts gears, so abstraction lets a class expose steering, accelerating and braking while hiding the internals.

```typescript
class Car {
  private brand: string;
  private model: string;
  private speed: number;

  constructor(brand: string, model: string) {
    this.brand = brand;
    this.model = model;
    this.speed = 0;
  }

  public accelerate(): void {
    this.speed += 10;
  }
```

The TypeScript peer dependency is declared as ^5.0.0, so the syntax assumes a current compiler.

## Rebuilding the guide locally with Bun

Because the README and the site are generated, you can rebuild them. The tooling is Bun, not Node, and the lockfile is bun.lockb.

With Bun installed, the readme script regenerates the README and then the site:

```bash
bun ./script.ts && bun ./html-generator.ts
```

The site script on its own regenerates the site only:

```bash
bun ./html-generator.ts
```

And the lint check runs through Biome:

```bash
bunx biome check
```

There is no test script in package.json. The scripts section contains exactly three entries, readme, site and lint, so unlike the pattern catalogue itself, this project has no automated verification of its examples. The build/ directory at the root and the website/ directory are where the generated output lands, and the Documentations/ directory holds the prose that script.ts assembles.

The runtime dependencies explain the rendering choices. marked parses the Markdown, highlight.js provides the syntax highlighting for the code blocks, marked-highlight wires the two together, and marked-gfm-heading-id generates the anchor identifiers that the table of contents links to.

For a reader there is nothing to run, of course. You open the site or read the README. For a contributor the pipeline is the thing to understand, and it is worth noting that it is a build step in a repository whose subject matter is a set of written patterns.

## Where the guide stops and what it leaves out

Two gaps deserve naming.

The first is licensing. The repository metadata reports the licence as unknown, and the top-level listing contains no LICENSE file. For a guide you read, that is a non-issue. For a guide whose examples you paste into a commercial codebase, it is not: without a licence file there is no stated permission to reuse the snippets, and no stated terms either. Anything you take from the Documentations/ or Examples/ trees needs to be checked before it goes into a product.

The second is the absence of a critical layer. Every pattern entry explains what the pattern is and shows how to write it in TypeScript. Nothing in the structure argues against a pattern, describes the cost it introduces, or says when a plain function would be better. A catalogue of twenty-three patterns with no warnings tends to produce the opposite of its intent, since a reader with the vocabulary will start recognising shapes in their own code. The SOLID section has the same shape, stating the principles and illustrating them rather than evaluating them.

There is also no versioning. The repository has no GitHub releases, and the last push was on 2026-09-24, so the content can change under you without a tag telling you that it did. The package.json version of 1.0.0 is not tied to any published release, and the package name is oop-expert-with-typescript with main pointing at script.ts, which suggests the package exists to run the generator rather than to be consumed as a dependency.

## A browsable catalogue versus a book that argues

The realistic comparison is against a printed book or a structured course on design patterns, and the difference is in what each gives you.

A book on the subject does two things this repository does not. It spends pages on the argument for a pattern, including the situations where it misfires, and it presents a coherent position across patterns rather than twenty-three separate treatments. Its examples are usually in one language throughout and are edited to be read in order.

What this repository gives you instead is speed of lookup and a language you already use. The table of contents links straight to the entry for Liskov Substitution or the Observer pattern, every section ends with a back-to-top link, and the code is TypeScript that a developer can paste into a scratch file and run immediately. The generated site means the same content is readable on a phone during a commute or on a second monitor while working. The Examples/DP/ and Examples/SOLID/ directories let you see the pattern code separated from the SOLID code, and Documentations/ holds the prose separately again.

The trade is straightforward. Use this repository to check what a pattern is called and to see one clean TypeScript implementation. Use a book to decide whether to use it. Given the absence of a licence file, the practical rule is to read it as a reference and write your own examples before any of this code reaches a repository with a licence attached to it.

## Conclusion

oop-expert-with-typescript fits a developer who wants one browsable reference for the SOLID principles and the classic GoF catalogue with TypeScript snippets they can paste into a scratch file. It is the wrong source for a team that needs argued guidance on when a pattern is the wrong choice, for anyone who must reuse the examples under a clear licence, since the repository has no licence file and GitHub reports the licence as unknown, and for a project that cannot add Bun to its toolchain. Before adopting the code, confirm the licensing position yourself and read the pattern entries in Documentations/ rather than only the summary table in README.md, and note that the newest commit was on 2026-09-24 with no tagged releases.

## FAQ

### How do I build the oop-expert-with-typescript site locally?

The package.json scripts are readme, which runs bun ./script.ts and bun ./html-generator.ts, and site, which runs bun ./html-generator.ts alone. Linting runs through bunx biome check, and the lockfile is bun.lockb, so the expected toolchain is Bun.

### Which design patterns does the guide cover?

The table of contents lists five creational patterns, seven structural patterns and eleven behavioural patterns, 23 in total, including Abstract Factory, Builder, Singleton, Adapter, Decorator, Proxy, Observer, Strategy, State and Visitor.

### Can I use the code examples from oop-expert-with-typescript in my own project?

Check the licensing position first. The repository has no LICENSE file in its top-level entries and the licence is reported as unknown, so there is no stated permission for reuse. The README describes the repository as a reference guide for reading.

### Does the guide contain tests for its examples?

No. The package.json scripts section contains readme, site and lint only, with no test command, and the repository listing shows no test directory. The examples are meant to be read and run by hand.

## Sources

- [Issues](https://github.com/jafari-dev/oop-expert-with-typescript/issues)
- [jafari-dev/oop-expert-with-typescript on GitHub](https://github.com/jafari-dev/oop-expert-with-typescript)
- [Project website](http://jafari.dev/oop-expert-with-typescript/)
- [README](https://github.com/jafari-dev/oop-expert-with-typescript/blob/master/README.md)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/jafari-dev-oop-expert-with-typescript
