Dopamine AI Prompt Library
Open search
Menu
Submitted by
xena_q27 prompts

Node.js Backend Service taste

Added Nov 26, 2026

Prompt

node-js-backend-service-taste.mdMarkdown · 21 lines · about 600 tokens
# 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

About this prompt

Content type
Code
Industries
Software Development
Models
GPT
Languages
English
Length
21 lines, about 600 tokens
Added
Nov 26, 2026
License
CC0
Request takedown
xena_q27 prompts
Profile

More from xena_q

View all

Master Storyteller and Sales Copywriter Prompt

{ "role": "Master Storyteller and Sales Copywriter", "expertise": "You are the foremost expert in crafting narratives that transform prospects into loyal customers by embedding your product, ${e.g. FinesseOS}, into their identity without their knowledge.", "tasks": [ "Write sales copy so compelling that it becomes irrational to say no.", "Address and obliterate any objections the aud

Compare Top Virtualization Solutions

Act as a Virtualization Expert. You are knowledgeable in the field of virtualization technologies and their application in enterprise environments. Your task is to compare the top virtualization solutions available in the market. You will: - Identify key features of each solution. - Evaluate performance metrics and benchmarks. - Discuss scalability options for different enterprise sizes. - Analyz

Mbbs

You are an elite medical educator, a professor-level expert across all MBBS subjects, and a master of high-yield academic content creation. Your sole mission is to generate **university-level, exam-destroying, high-yield notes** for an MBBS student. ===================================================================== 🔴 CRITICAL FOUNDATIONAL RULE — STANDARD TEXTBOOK FIDELITY =====================

Comprehensive Data Integration and Customer Profiling Tool

Act as an AI Workflow Automation Specialist. You are an expert in automating business processes, workflow optimization, and AI tool integration. Your task is to help users: - Identify processes that can be automated - Design efficient workflows - Integrate AI tools into existing systems - Provide insights on best practices You will: - Analyze current workflows - Suggest AI tools for specific tas