feat: modernize API boilerplate with Node 22, ESLint 9, and production-grade features#8
Merged
arifintahu merged 10 commits intomainfrom Mar 7, 2026
Merged
feat: modernize API boilerplate with Node 22, ESLint 9, and production-grade features#8arifintahu merged 10 commits intomainfrom
arifintahu merged 10 commits intomainfrom
Conversation
…ces, database synchronization, and comprehensive testing setup.
…ces, repositories, and authentication.
…ing services, repositories, controllers, and models.
…features, and usage instructions.
…, logging, Docker, and CI.
… environment variables, and refine Dockerfile build and logging setup.
…h validation and Swagger documentation.
…g an environment variable fallback.
…ample to default to 'db'.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR performs a major overhaul of the API boilerplate, upgrading the core runtime to Node.js 22 and TypeScript 5.7 while introducing production-ready features such as security hardening, structured logging, request tracing, and standardized API responses.
Key Changes
eslint.config.js)Dockerfilewith non-root user and healthchecksdocker-compose.ymlwith PostgreSQL healthchecks and configurable environment variableshelmetfor security headers andexpress-rate-limitfor DDoS protection/healthcheck endpoint with database connectivity validationApiResponseandAppErrorutilities for uniform JSON responses and error handlingrequestIdMiddlewareto trace requests viaX-Request-IdheadersUserRepositoryTesting
UserRepositoryandRoleRepositoryto validate new pagination logic and mocking strategies. Run vianpm test.docker-compose upto verify container health and environment variable injection./docsendpoint.Notable Implementation Details
.eslintrcformat.node:22-alpineto minimize image size and attack surface.beforeCreate,beforeUpdate) to ensure security regardless of which service creates the user.Out of Scope
Impact
These changes provide a robust, secure, and highly observable foundation for building RESTful APIs. It reduces technical debt by adopting the latest ecosystem standards and ensures that new features can be built on top of a production-hardened architecture.