---
id: "titan/modules/index"
title: "Modules"
---

# Titan Modules

The Titan ecosystem has three module tiers, each rendered with a
origin badge so you can tell at a glance where a module comes
from and what its guarantees are.

| Tier          | Origin    | Where it lives                                    | Guarantees                                            |
| ------------- | --------- | ------------------------------------------------- | ----------------------------------------------------- |
| **Built-in**  | Built-in  | `@omnitron-dev/titan/module/*`                    | Ships with the framework; same release cadence        |
| **Official**  | Official  | `packages/titan-*` in the `omnitron-dev` monorepo | Maintained by the Omnitron team; independent versions |
| **Community** | Community | Third-party npm packages                          | Audit before adopting; no maintenance commitment      |

Every module page in this section starts with a `<span class="module-badge"></span>`
chip that reflects its tier.

> Want a bird's-eye view of how the 16 modules interlock — who
> depends on whom, which combinations form common stacks, when to
> prefer one over a similar one? Read the **[Module map](/docs/titan/modules/module-map)**.

## Built-in modules

<span class="module-badge">built-in · @omnitron-dev/titan · /module/*</span>

Config and Logger ship inside `@omnitron-dev/titan` and are **auto-loaded**
unless you pass `disableCoreModules: true`. RLS guards are imported explicitly.
No extra Titan package is needed for these entry points.

| Module                                       | Subpath          | Purpose                                                    |
| -------------------------------------------- | ---------------- | ---------------------------------------------------------- |
| [`ConfigModule`](/docs/titan/modules/config) | `/module/config` | Layered, validated, hot-reloadable configuration           |
| [`LoggerModule`](/docs/titan/modules/logger) | `/module/logger` | Structured pino-based logging with transports + processors |
| [RLS guards](/docs/titan/modules/rls)        | `/module/rls`    | Context guard decorators; no module registration           |

## Official modules (`titan-*` packages)

<span class="module-badge">official · @omnitron-dev/titan-*</span>

Fourteen independent packages in the `omnitron-dev` monorepo. Each is
versioned separately; adopting one does not pin you to others.

| Module                                                         | Package                               | Purpose                                                   |
| -------------------------------------------------------------- | ------------------------------------- | --------------------------------------------------------- |
| [`TitanAuthModule`](/docs/titan/modules/auth)                  | `@omnitron-dev/titan-auth`            | JWT auth (HS256 / RS256 / ES256), JWKS, token cache       |
| [`TitanCacheModule`](/docs/titan/modules/cache)                | `@omnitron-dev/titan-cache`           | Multi-tier (L1/L2) caching with LRU / LFU, Redis backing  |
| [`TitanDatabaseModule`](/docs/titan/modules/database)          | `@omnitron-dev/titan-database`        | Kysely + migrations + RLS, multi-dialect                  |
| [`DiscoveryModule`](/docs/titan/modules/discovery)             | `@omnitron-dev/titan-discovery`       | Redis-backed service discovery + Netron integration       |
| [`EventsModule`](/docs/titan/modules/events)                   | `@omnitron-dev/titan-events`          | Typed event bus, wildcard, scheduling, history            |
| [`TitanHealthModule`](/docs/titan/modules/health)              | `@omnitron-dev/titan-health`          | Health indicators (memory, event-loop, disk, db, redis)   |
| [`TitanLockModule`](/docs/titan/modules/lock)                  | `@omnitron-dev/titan-lock`            | Distributed Redis locks with UUID ownership + Lua scripts |
| [`TitanMetricsModule`](/docs/titan/modules/metrics)            | `@omnitron-dev/titan-metrics`         | Counters / gauges / histograms, pluggable storage         |
| [`NotificationsModule`](/docs/titan/modules/notifications)     | `@omnitron-dev/titan-notifications`   | Multi-channel delivery + templates + DLQ                  |
| [`ProcessManagerModule`](/docs/titan/modules/pm)               | `@omnitron-dev/titan-pm`              | Process supervision, worker pools, IPC                    |
| [`TitanRateLimitModule`](/docs/titan/modules/ratelimit)        | `@omnitron-dev/titan-ratelimit`       | Token-bucket, sliding-window, fixed-window strategies     |
| [`TitanRedisModule`](/docs/titan/modules/redis)                | `@omnitron-dev/titan-redis`           | Redis client (clustering, sentinel, TLS, named instances) |
| [`SchedulerModule`](/docs/titan/modules/scheduler)             | `@omnitron-dev/titan-scheduler`       | Cron + interval + timeout with persistence                |
| [`TelemetryRelayService`](/docs/titan/modules/telemetry-relay) | `@omnitron-dev/titan-telemetry-relay` | Store-and-forward telemetry pipeline (no module)          |

## Community modules

<span class="module-badge">community · @your-scope/titan-*</span>

No third-party modules registered yet. See [Community
Modules](/docs/titan/modules/community) for what counts, how to adopt safely, and
how to publish your own.

## Composition

Modules compose through the standard `imports` chain — order does
not matter, the container resolves the dependency graph:

```typescript
@Module({
  imports: [
    // Built-in (auto-loaded; shown explicitly here for illustration)
    ConfigModule.forRoot({ schema: AppConfigSchema, sources: [/* … */] }),
    LoggerModule.forRoot({ level: 'info' }),

    // Official
    TitanRedisModule.forRoot({ config: { url: env.REDIS_URL } }),
    TitanAuthModule.forRoot({ jwtSecret: env.JWT_SECRET }),
    TitanCacheModule.forRoot({ multiTier: true, l2: { client: redisClient, ttl: 60 } }),
    TitanDatabaseModule.forRoot({ connection: { dialect: 'postgres', connection: env.DATABASE_URL } }),
    SchedulerModule.forRoot({ persistence: { provider: redisPersistenceProvider } }),
    TitanMetricsModule.forRoot({ storage: { type: 'memory' } }),
  ],
  providers: [/* your services */],
})
export class AppModule {}
```

## Redis dependency among official modules

Five official modules depend on a Redis client provided by
`TitanRedisModule`:

- `titan-cache` (when L2 tier enabled)
- `titan-lock`
- `titan-discovery`
- `titan-ratelimit` (when `storageType: 'redis'`)
- `titan-notifications` (rate limiter, preference store, rotif
  messaging)

Register `TitanRedisModule.forRoot(...)` first; the rest pick up the
shared client automatically.

## Choosing modules

Most backends start with a small set:

- **Web API service**: built-in config + logger; auth + database +
  cache + health + metrics.
- **Worker service**: built-in config + logger; database + lock +
  scheduler + metrics + health.
- **Notification gateway**: built-in config + logger;
  notifications + ratelimit + metrics.
- **Multi-instance app**: add discovery to the above.

→ Start with [`ConfigModule`](/docs/titan/modules/config) for built-in config or
jump to [`TitanAuthModule`](/docs/titan/modules/auth) for the most-used official
module.

→ Want to build your own? Read
[Authoring a module](/docs/titan/modules-system/authoring-modules) — the
step-by-step recipe every official `titan-*` package follows.