# Ontologic > A zero-dependency TypeScript toolkit for Domain-Driven Design: domain entities and value objects that enforce their own invariants, versioned domain events with an outbox-backed event bus, a Result type for explicit domain failures, and typed resumable workflows. - Ontologic is published on npm as `ontologic` and has no runtime dependencies. - All examples import from the package root: `import { DomainEntity, ok, err } from "ontologic"`. - Worked, tested examples live at https://github.com/SachaCR/ontologic/tree/main/src/examples ## Introduction - [Model Your Business in TypeScript](https://ontologic.site/docs/intro): Ontologic is a TypeScript toolkit for Domain-Driven Design typed entities, invariants, domain events with outbox pattern, and resumable workflows. ## Domain Model - [Domain Entity](https://ontologic.site/docs/domain-model/domain-entity): Domain-Driven Design (DDD) is an approach to software development that puts the business domain at the center of your code. Rather than thinking in terms of database tables or HTTP endpoints, you… - [Value Object](https://ontologic.site/docs/domain-model/value-object): A Domain Entity is defined by who it is. A Value Object is defined by what it is. - [Domain Events](https://ontologic.site/docs/domain-model/domain-events): In Domain-Driven Design, a Domain Event is a record that something meaningful happened in your domain. - [Invariants](https://ontologic.site/docs/domain-model/invariants): An invariant is a rule that must always be true about your entity — no matter what. - [The Result Pattern](https://ontologic.site/docs/domain-model/result-pattern): When an operation can fail, there are two common ways to communicate that failure to the caller: throw an exception, or return a value that represents the outcome. - [Repository](https://ontologic.site/docs/domain-model/repository): In Domain-Driven Design, a Repository is the interface between your domain and your persistence layer. Its job is simple: store entities and retrieve them. Everything else — SQL queries, ORM… ## Application - [Use Case](https://ontologic.site/docs/application/use-case): An entity knows its own rules. A use case knows everything else: which aggregates to load, ## Messaging - [Event Bus](https://ontologic.site/docs/event-bus/event-bus): Once domain events are persisted via the Outbox pattern, a message relay needs to read them from the database and then use an event bus to deliver events to the rest of your system. - [Message Relay](https://ontologic.site/docs/event-bus/message-relay): The Message Relay is the bridge between your outbox table and your event bus. Its job is to read domain events that were persisted by the repository and forward them to the rest of your system via… - [Command Bus](https://ontologic.site/docs/event-bus/command-bus): The event bus is fire-and-forget: a publisher announces that something happened, and has no idea who listens. A command bus is the opposite. It is request/response over a broker: a caller sends a… ## Workflows - [Workflows](https://ontologic.site/docs/workflows): Some business operations cannot fit in a single method. A SEPA payment is not just a database write — it is a sequence: check the balance, validate the receiver, run an AML screen, reserve the funds,… - [Step workflow](https://ontologic.site/docs/workflows/step-workflow): Use the step flavor when your process is essentially a chain: each step depends on the previous one's output, and the order is sequential. Steps are added one after the other with addStep, and the… - [Graph workflow](https://ontologic.site/docs/workflows/graph-workflow): Use the graph flavor when the dependencies between steps form a tree (or DAG) rather than a line: a node has named children, runs them concurrently, and receives a record of their outputs as its… ## Event Sourcing - [Event Sourcing](https://ontologic.site/docs/event-sourcing): Most applications store the current state of things. A row in a carts table says the cart holds two mugs. Ask it how it got there was one mug added twice, or two at once, and did the customer briefly… ## Optional - [Full documentation as a single file](https://ontologic.site/llms-full.txt): every page above, concatenated - [Source and examples](https://github.com/SachaCR/ontologic): the repository, including tested example aggregates