Supported Apps
tsdevstack supports multiple application types within a single monorepo.
App types
NestJS Services
Backend API services built with NestJS. These are the core of most tsdevstack projects.
Services get:
- Auto-generated Kong gateway routes
- OpenAPI documentation from decorators
- Generated HTTP client libraries with DTOs
- Database connections (Postgres, Redis)
- Framework authentication
Workers
Workers process background jobs using BullMQ and Redis. They live inside a service's codebase and share its database access and dependencies.
A worker has three parts: a processor that handles jobs, a producer (any service code) that enqueues them, and a module that wires everything together.
Inline workers
The simplest setup — import your processors directly into the service's AppModule. Jobs run in the same process as the HTTP server:
This is fine for lightweight async tasks like sending emails or logging events.
Detached workers
For heavy processing or independent scaling, you can run processors in a separate container. This requires two extra files:
worker.ts calls startWorker() from nest-common, which bootstraps a NestJS application context (no HTTP server) with a health endpoint for container orchestration.
These files alone do nothing. The worker won't run unless you register it as a detached worker, which tells the framework to deploy a separate container using the same Docker image but with node dist/worker.js as the entrypoint:
Detached workers get their own Cloud Run / ECS / Container Apps instance with CPU always allocated. Like services, workers are configurable in infrastructure.json — you can set minInstances, maxInstances, cpu, and memory. Workers enforce a minimum of 1 instance (they must always be running to poll Redis queues).
Enqueueing jobs
Any service code can dispatch jobs by injecting a queue:
The queue name must be registered in both the producer's module and the worker's module.
Next.js Frontend
Server-rendered React applications built with Next.js.
SPA Applications
Single-page applications built with any framework that uses Rsbuild.
The framework executes the Rsbuild build after registering the app, so any Rsbuild-compatible setup works.
Monorepo structure
All apps live in a single monorepo:
Generated HTTP clients
When you build a NestJS service, tsdevstack generates a typed HTTP client package:
These clients have separate exports for different use cases:
In frontend apps - import as an HTTP client:
In NestJS services - import the HTTP client and/or the DTOs directly:
This eliminates the need for separate shared type packages - all types flow from the OpenAPI spec.