Skip to content

nestarcBuild reliable NestJS SaaS backends. See where async work breaks.

Open-source modules protect data and delivery. Nestarc Reliability follows evidence across requests, databases, queues, workers, and webhooks — without collecting payloads.

Build locally. Follow failures across the whole path.

Open-source packages keep execution in your environment. Nestarc Reliability correlates the bounded operational evidence those systems explicitly report; it does not execute customer work or collect request bodies, webhook payloads, raw logs, or SQL.

Open-source data plane

Own the execution path

Use tenancy, idempotency, outbox, jobs, and webhook independently or together inside your NestJS application.

Hosted control plane

See where evidence stops

Follow one operation from request to external effect. The current pilot is read-only, and recovery controls are not enabled.

Package lineup

Supported packages have active compatibility coverage and maintained documentation. Preview packages are usable, but their APIs and operating contracts are still evolving. Status does not replace the version number or changelog when assessing upgrade risk.

Supported · v0.14.0tenancy

PostgreSQL RLS + Prisma multi-tenancy with tenant-aware cache keys.

Supported · v0.15.0safe-response

API response wrapper with Swagger integration, field selection, error catalogs, and i18n support.

Supported · v0.3.0pagination

Prisma 7 cursor, keyset, and offset pagination with filters, sorting, and Swagger helpers.

Supported · v0.6.0soft-delete

Prisma soft-delete with relation filters, cascade, bulk restore, purge, and lifecycle events.

Preview · v0.4.0idempotency

IETF draft-07 Idempotency-Key handling with stable fingerprints, Redis/Postgres storage, and response/header replay.

Preview · v0.4.0audit-log

Atomic Prisma change tracking with checkpointed export, durable streams, and retention controls.

Preview · v0.3.0api-keys

Tenant-scoped API keys with zero-downtime rotation, IP allowlists, lifecycle hooks, and verification metrics.

Supported · v0.5.0feature-flag

DB-backed feature flags with cache adapters, Admin API, rollouts, and tenant overrides.

Supported · v0.2.0rbac

Typed tenant-aware permissions, fail-closed guards, resource scopes, Prisma storage, and audit hooks.

Preview · v0.2.0outbox

Prisma-native transactional outbox with polling, retry, and event decorators.

Preview · v0.3.0jobs

Typed jobs with tenant-fair in-memory scheduling, restart-safe BullMQ workers, Redis dedupe, retries, and outbox publishing.

Supported · v0.13.0webhook

Idempotent outbound delivery with HMAC signing, retry and replay controls, worker metrics, and data retention.

Preview · v0.2.0data-subject

GDPR/CCPA export and erase workflows with entity policies, retention, and outbox fan-out.

Why nestarc?

Multi-tenant SaaS teams repeatedly implement the same high-risk infrastructure. nestarc provides tested building blocks with explicit compatibility ranges, operational contracts, and documented limitations.

Tenant Isolation
One misconfigured query leaks customer data across tenants.
PostgreSQL RLS enforces isolation at the database level.
Audit Trail
Manually logging every write is tedious and easy to forget.
Prisma extension auto-tracks CUD with before/after diffs.
Feature Flags
External flag services add latency, cost, and a new dependency.
DB-backed flags with tenant overrides and percentage rollouts.
Soft Delete
deletedAt alone breaks unique constraints and leaks deleted records.
Prisma extension with cascade, restore, and query filtering.
Pagination
Implementing cursor + offset with filters is boilerplate-heavy.
12 filter operators, sorting, and Swagger docs out of the box.
Response Format
Inconsistent API envelopes across endpoints frustrate frontend teams.
Auto-wrapped responses with error codes, pagination, and i18n.
Idempotency
Network retries cause double charges, duplicate orders, and corrupt state.
IETF draft-07 Idempotency-Key handling with fingerprint validation and response replay.
Transactional Outbox
DB writes and event emission can get out of sync, causing lost or duplicate events.
Prisma-native outbox with polling, SKIP LOCKED, and retry with backoff.
Webhook Delivery
Reliable outbound webhooks require retry, signing, circuit breaking, and audit trails.
HMAC-signed delivery with exponential backoff, circuit breaker, and full delivery logs.
API Keys
Rolling your own key hashing, prefixing, and rotation is one bug away from a credential leak.
Timing-safe verification, zero-downtime rotation, fail-closed IP allowlists, and test/live isolation.
Access Control
Ad hoc role checks drift across controllers, services, tenants, and resource scopes.
Tenant-aware RBAC keeps roles, permissions, and guards consistent.
Data Subject Rights
GDPR/CCPA export and erase requests collide with legal retention on invoices, audits, and tax records.
Per-entity policies with delete/anonymize/retain, legal basis tracking, and outbox fan-out.
Background Jobs
One noisy tenant's backlog starves every other tenant's jobs in a plain FIFO queue.
Weighted in-memory fairness plus durable BullMQ retry, Redis-backed dedupe, restart-safe status, and first-party outbox delivery.

Without nestarc

typescript
// Scattered across 50+ services, easy to forget, hard to audit
async updateUser(id: string, dto: UpdateUserDto) {
  const before = await this.prisma.user.findUnique({ where: { id } });
  await this.prisma.$executeRaw`SELECT set_config('app.current_tenant', ${tenantId}, true)`;
  const after = await this.prisma.user.update({ where: { id, deletedAt: null }, data: dto });
  await this.auditService.log({
    action: 'user.update',
    targetType: 'User',
    targetId: id,
    metadata: { before, after },
  });
  return { success: true, data: after, timestamp: new Date() };
}

With nestarc

typescript
// Tenant isolation, audit logging, soft-delete filtering, and response wrapping
// are all handled automatically by Prisma extensions and NestJS interceptors.
// PrismaService exposes a client created with:
// createAuditedClient(base, { consistency: 'atomic-required', trackedModels: ['User'] });
async updateUser(id: string, dto: UpdateUserDto) {
  return this.prisma.client.withAuditTransaction((tx) =>
    tx.user.update({ where: { id }, data: dto }),
  );
}

Evidence over slogans

Package documentation publishes benchmark setup, compatibility ranges, and known limitations alongside the feature guide. Benchmark results describe specific code paths under documented conditions; they are not universal latency promises or cross-package comparisons.

Tooling

Labs · mcp-guard · v0.2.0

Static security scanning for MCP server implementations and MCP client configuration files. It is published under the @nestarc scope, but lives separately from the NestJS SaaS module lineup.

Explore mcp-guard →

Build a complete multi-tenant API in 30 minutes.

Full TutorialQuick Start (5 min)

Released under the MIT License.