Skip to content

TypeScript / Node.js

verikt treats TypeScript as a first-class language. You get the same composition model — pick an architecture, select capabilities, scaffold — with 39 capabilities and two architecture patterns (hexagonal and flat).

The wizard handles everything interactively:

Terminal window
verikt new my-ts-api --language typescript

Or skip the wizard if you know what you want:

Terminal window
verikt new my-ts-api \
--language typescript \
--arch hexagonal \
--cap platform,bootstrap,http-api,docker \
--no-wizard

HTTP framework. During scaffolding you choose between Express, Fastify, and Hono. The http-api capability wires the framework you pick, including middleware for request IDs, health endpoints, and graceful shutdown.

Database libraries. verikt selects the right library per capability:

  • postgres and mysqlPrisma by default, or Drizzle ORM if you pass --set OrmLibrary=drizzle. Drizzle uses schema-in-code with a SQL-first query builder — no Prisma schema file, no code generation step.
  • mongodbMongoose
  • redisioredis

Testing. The testing capability sets up Vitest with a test script and sensible defaults. Tests run with npm test.

Linting. The linting capability configures ESLint and Prettier. Run npm run lint to check.

TypeScript supports hexagonal and flat. The hexagonal pattern enforces strict layer boundaries:

src/domain/ # Business logic — no external imports
src/application/ # Use cases, ports
src/infrastructure/ # DB, external services
src/transport/ # HTTP handlers

verikt check enforces these boundaries using tree-sitter import graph analysis. If src/domain/ imports from src/infrastructure/, it’s caught at the command line.

39 capabilities are available for TypeScript, covering the most common production needs:

  • Transport: http-api, http-client, kafka-consumer
  • Data: postgres, mysql, mongodb, redis, sqlite, migrations, repository, uuid
  • Resilience: circuit-breaker, retry, timeout, rate-limiting, idempotency
  • Security: auth-jwt, cors, audit-log, encryption
  • Patterns: event-bus, worker, scheduler, outbox, cqrs, email-gateway
  • Observability: health, observability, request-id
  • Infrastructure: platform, bootstrap, docker, graceful, devcontainer, ci-github, pre-commit, makefile
  • Quality: testing, linting