Tech Stack
tsdevstack is built on battle-tested technologies chosen for reliability, developer experience, and production readiness.
Overview
Core technologies
TypeScript
TypeScript is the foundation of tsdevstack. Every part of the stack uses TypeScript for:
- Type safety - Catch errors at compile time, not runtime
- Better tooling - IDE autocomplete, refactoring, navigation
- Self-documenting code - Types serve as documentation
- Shared types - Use the same types in frontend, backend, and generated clients
NestJS
NestJS provides the structure for backend services. It uses decorators and dependency injection for clean, testable code.
Why NestJS:
- Decorator-based routing maps directly to OpenAPI specs
- Dependency injection makes testing straightforward
- Modular architecture scales with your application
- Large ecosystem of plugins and integrations
Decorators like @ApiOperation generate OpenAPI specs, which tsdevstack uses to configure Kong routes automatically.
Kong
Kong is an open-source API gateway that handles cross-cutting concerns:
- Routing - Maps URL paths to backend services
- Authentication - Validates JWT tokens before requests reach services
- Rate limiting - Protects services from abuse
- CORS - Manages cross-origin requests
tsdevstack generates Kong configuration automatically from your OpenAPI specs. When you add an endpoint, Kong routing updates to match.
PostgreSQL
PostgreSQL is the primary database for tsdevstack projects:
- Reliability - ACID compliance, proven at scale
- Features - JSON columns, full-text search, extensions
- TypeScript support - Excellent integration with Prisma
- Cloud native - Managed options on all major clouds
Each service that needs persistence gets its own database, keeping data isolated.
Redis
Redis provides fast caching and ephemeral storage:
- Rate limiting - Store request counters with TTL
- Session data - Fast session lookups
- Caching - Cache expensive queries
- Pub/sub - Real-time messaging between services
Prisma
Prisma handles database interactions with a schema-first approach:
Prisma provides:
- Declarative schema definition
- Auto-generated TypeScript client with full type safety
- Migrations for schema changes
- Intuitive query API
Next.js
For frontends, tsdevstack uses Next.js:
- Server-side rendering - SEO and fast initial loads
- API routes - Secure cookie-based auth proxying
- App Router - Modern React patterns with Server Components
- TypeScript - Full type safety with generated DTOs
npm workspaces
npm workspaces manage the monorepo with Lerna for task orchestration:
- Native - Built into npm, no additional package manager
- Workspaces - Apps and packages linked automatically
- Lerna - Parallel builds, caching, dependency graph awareness
Docker
Docker provides consistent environments:
- Local development - Same containers as production
- Isolation - Each service runs independently
- Reproducibility - Works the same on every machine
Terraform
Terraform manages cloud infrastructure:
- Declarative - Define what you want, not how to build it
- Multi-cloud - Same workflow for GCP, AWS, Azure
- Version controlled - Infrastructure changes are tracked
How they work together
Locally, each service with a database gets its own PostgreSQL container (e.g., auth-db, offers-db), keeping data isolated. Redis is shared across services. In production, you can use managed database services (Cloud SQL, RDS, etc.).