Recipes
The per-module pages cover what each module does. This section
shows how they compose — real stacks for the most common
backend shapes, with full forRoot configs and the cross-module
wiring that makes them work together.
Each recipe is read top to bottom: pick the one matching your
workload, copy the AppModule, replace the env values, ship.
Recipes
| Recipe | Use case |
| API service stack | Public HTTP / WS API: auth, database, cache, rate limiting, health, metrics |
| Worker fleet | Background jobs across pods: process manager, distributed lock, scheduler, metrics |
| Observability stack | Logs / metrics / traces / health, shipped via the relay |
| Notifications pipeline | Producer → queue → worker → channels, with rate limit + preferences |
| Multi-tenant SaaS | RLS-isolated database, contextual injection, tenant-scoped rate limits |
How to read a recipe
Every recipe has the same shape:
Shape — what kind of backend this is and when to reach for it.
Architecture diagram — the modules involved and how they pass data.
AppModule— the canonical root module with everyforRootyou need.Cross-module wiring notes — the non-obvious bits: which token from module A is consumed by module B, what order matters, what config values must agree.
Production checklist — what to verify before shipping.
Module dependency map
flowchart LR
subgraph Foundation
Redis[titan-redis]
Logger[LoggerModule built-in]
Config[ConfigModule built-in]
end
subgraph Storage
DB[titan-database]
Cache[titan-cache]
end
subgraph Coordination
Lock[titan-lock]
Discovery[titan-discovery]
Scheduler[titan-scheduler]
end
subgraph Edge
Auth[titan-auth]
RateLimit[titan-ratelimit]
end
subgraph Workflows
Events[titan-events]
Notify[titan-notifications]
PM[titan-pm]
end
subgraph Observability
Health[titan-health]
Metrics[titan-metrics]
Relay[titan-telemetry-relay]
end
Cache -.L2.-> Redis
Lock --> Redis
Discovery --> Redis
RateLimit -.optional.-> Redis
Notify --> Redis
Notify --> Events
Scheduler -.distributed.-> Lock
Health -.indicator.-> DB
Health -.indicator.-> Redis
Metrics -.ships via.-> RelayUse this map to plan your stack: start at the workload (API / worker / notifications) and trace dependencies.