What this prompt does
This prompt scaffolds a production-ready Express.js API in TypeScript. It generates a project structure following your [architecture_pattern], strict tsconfig, request validation with [validation_lib], authentication via [auth_method], centralised error handling with custom error classes, database integration through [orm] with migrations, auto-generated Swagger/OpenAPI docs, logging with [logger] including request correlation IDs, rate limiting and CORS, Docker and docker-compose, a health-check endpoint with dependency status, and an example CRUD module for [example_resource] — plus .env.example, ESLint, Prettier, and Husky hooks.
The structure works because it front-loads the plumbing every API needs. Instead of rebuilding validation, auth, error handling, and docs from scratch each project, the prompt produces a consistent [architecture_pattern] skeleton the team can extend with real endpoints immediately. The Docker and health-check pieces make it deployable, not just a local demo, and the [orm] and [validation_lib] variables fit it to your stack.
When to use it
- You are starting a new Express API and want to skip rebuilding the same plumbing.
- You want a consistent
[architecture_pattern]structure across projects. - You need validation, auth, and error handling wired in from day one.
- You want auto-generated Swagger docs from your routes.
- You need Docker and a health-check endpoint so it is deployable, not just runnable.
- You want an example
[example_resource]CRUD module to copy from.
Example output
You get a complete Express + TypeScript repo: a [architecture_pattern] layout, strict tsconfig, [validation_lib] validation, [auth_method] auth, custom error classes with HTTP status mapping, [orm] integration with migrations, Swagger docs, [logger] logging with correlation IDs, rate limiting, CORS, Docker setup, a health-check endpoint, and a working [example_resource] CRUD module — with linting and pre-commit hooks configured.
Pro tips
- Match
[orm]and[validation_lib]to your real preferences early; swapping them later touches a lot of files. - Use the
[example_resource]module as a template — copy its controller-service-repository shape for new resources. - Confirm
[auth_method]matches your needs (refresh tokens versus simple JWT) before building features on top. - Keep the health-check endpoint reporting real dependency status, not a hardcoded OK.
- Verify correlation IDs flow through
[logger]end to end so you can trace a request across logs. - Treat the scaffold as a starting point; tighten rate-limit and CORS settings for your actual deployment.