Prompt
0 copies · 0 said it worked
Guide for building small, predictable Node.js backend services in TypeScript
A set of standing engineering rules for writing and operating Node.js backend services in TypeScript, covering validation, error handling, logging, shutdown, testing and deployment.
People use this for
- nodejs typescript backend service rules
- fastify api validation logging shutdown
- how to structure small node backend
- graceful shutdown node express typescript guide
- node typescript service best practices checklist
Imported on Nov 29, 2026 from Node.js Backend Service taste . License observed at the source on Nov 29, 2026: CC0.
Are you the author?Claim this profileRequest removal
Prompt
# Node.js Backend Service taste of a TypeScript engineer who wants small, predictable services - Write services in TypeScript with `strict: true` and native ES modules. Confidence: 0.90 - Pin the Node.js version to an active LTS release in `.nvmrc`, `engines` and the Docker base image. Confidence: 0.90 - Use Fastify or Hono for HTTP, with request and response schemas that also generate the OpenAPI document. Confidence: 0.75 - Validate every incoming body, query and header at the edge and work only with typed data inside. Confidence: 0.95 - Load configuration once at startup from environment variables, validate it with a schema and fail fast if anything is missing. Confidence: 0.90 - Keep handlers thin: they parse input, call a service function and map the result to a response. Confidence: 0.85 - Never block the event loop; move CPU-heavy work to worker threads or a separate job queue. Confidence: 0.90 - Use `async`/`await` everywhere and treat any floating promise as a lint error. Confidence: 0.90 - Log structured JSON with pino, include a request ID on every line and never log secrets or tokens. Confidence: 0.90 - Return errors in one consistent JSON shape with a stable error code, and map unknown errors to 500 without leaking stack traces. Confidence: 0.85 - Handle `SIGTERM` by closing the server, draining in-flight requests and closing database pools before exit. Confidence: 0.90 - Crash on `unhandledRejection` and `uncaughtException` after logging, and let the orchestrator restart the process. Confidence: 0.80 - Expose separate liveness and readiness endpoints; readiness checks real dependencies. Confidence: 0.85 - Set timeouts on every outgoing HTTP and database call, and use `AbortSignal` to cancel them. Confidence: 0.85 - Use a connection pool with a fixed maximum size for the database, tuned to the number of instances. Confidence: 0.80 - Prefer the built-in `fetch`, `node:test` and `node:crypto` before adding a dependency. Confidence: 0.70 - Test HTTP routes with in-process injection instead of starting a real port. Confidence: 0.75 - Add OpenTelemetry tracing early so slow requests can be followed across services. Confidence: 0.75 - Build a small production image with a multi-stage Dockerfile and run it as a non-root user. Confidence: 0.85 - Keep `package-lock.json` committed and install with `npm ci` in CI and Docker builds. Confidence: 0.90
No result recorded for this import yet. Tried it? File a report so the next person knows how it went.
Tried it
Structured reports from people who ran this prompt. They roll up into the per-model badges above.
No one has filed a report yet. Try the prompt and be the first.
Related prompts
- Data validation architect role for multi-layer input validation and sanitization
A role prompt that turns the model into a senior data integrity expert who designs multi-layer input validation, sanitization, injection prevention, and error handling, and writes the plan to a TODO_data-validator.md checklist file.
Coding · @wkaandemir
- Quality engineering agent role for risk-based test strategy and CI quality gates
A senior quality engineering role prompt that guides an assistant through risk-based test strategy, test automation architecture, CI/CD quality gates, edge-case analysis, and defect management, writing results to a TODO checklist file.
Coding · @wkaandemir
- Autonomous coding agent that builds a verified app-builder harness
Master system prompt that directs an autonomous senior Python engineer to build a spec-driven, evidence-traced app-builder harness milestone by milestone without asking questions.
Coding · @mahfuzahmedog
- Agent that writes, runs, and repairs tests after code changes
A system prompt defining a test-writer-fixer agent that writes unit, integration, and end-to-end tests, runs suites, analyzes failures, and repairs tests without weakening them.
Coding · @ersinyilmaz
- Cursor rules for writing and testing Xian smart contracts in Python
A Cursor rules file that guides the assistant through writing Xian blockchain smart contracts in Python, covering naming, state, context variables, events, error handling, and unittest-based testing with security checks.
Coding · @patrickjs
License: CC0v1 · published Nov 29, 2026
Comments
No comments yet. If you tried this prompt, say how it went.