Releases: refkinscallv/node-framework
Releases · refkinscallv/node-framework
3.0.2
@refkinscallv/create-node-framework
Scaffold a new Node Framework project in seconds.
Usage
# npm
npm create @refkinscallv/node-framework my-app
# npx
npx @refkinscallv/create-node-framework my-app
# pnpm
pnpm create @refkinscallv/node-framework my-app
# yarn
yarn create @refkinscallv/node-framework my-appIf you omit the project name, the CLI will prompt for it interactively.
Options
| Flag | Description |
|---|---|
--skip-install |
Skip dependency installation |
--skip-setup |
Skip .env generation and JWT key setup |
--pm <manager> |
Package manager: npm | yarn | pnpm (auto-detected) |
-v, --version |
Print version |
Requirements
- Node.js >= 18.0.0
- npm >= 9.0.0
What it does
- Downloads the latest node-framework template
- Installs dependencies with your package manager
- Runs
npm run setupto copy.env.example→.envand generate secure JWT keys - Prints next steps
License
MIT © Refkinscallv
3.0.0
Added
AuthMiddleware(app/http/middlewares/auth.middleware.js) — Ready-to-use JWT authentication and RBAC middleware with four methods:authenticate— Requires valid Bearer token; attaches decoded payload toreq.useroptional— Setsreq.userif token present,nullotherwise; never blocksrole(...roles)— Gate: user role must be in the allowed roles listcan(...permissions)— Gate: user must have all listed permissions inreq.user.permissions
Cache(core/cache.core.js) — In-memory key-value cache with TTL and rich API:set(key, value, ttl),get(key, default),has(key),delete(key),flush()remember(key, ttl, fn)/rememberAsync(key, ttl, fn)— Get-or-set patternsadd(key, value, ttl)— Store only if key absentpull(key)— Get and delete in one callincrement(key, n)/decrement(key, n)— Atomic counter helpers
RateLimithelper (core/helpers/rateLimit.helper.js) — Factory forexpress-rate-limitinstances:RateLimit.create(windowMs, max)— Custom limiterRateLimit.strict()— 10 req/15min (for login, OTP endpoints)RateLimit.generous()— 300 req/15minRateLimit.global()— 200 req/15min
EnvValidator(core/env.validator.js) — Startup validation of required environment variables; throws with a clear list of missing keys instead of cryptic runtime errors.- Health Check endpoint —
GET /healthauto-registered byexpress.core.js; returns app name, env, uptime, timestamp, and memory stats. - Global Rate Limiter —
express.core.jsnow auto-applies a configurable global rate limiter viaconfig.rateLimit.global. - Socket.IO JWT Auth (
socket.core.js) — Optional JWT middleware for Socket.IO connections. Enable withSOCKET_AUTH_ENABLED=true; setssocket.useron success. Database.transaction(callback)— Wraps a Sequelize transaction; auto-commits on success, auto-rollbacks on error.- Docker support — Added
Dockerfile(multi-stage:development+production),docker-compose.yml(app + MySQL with healthcheck), and.dockerignore. create-cliv3.0.0 — Fully rewritten for npm publish:- Interactive project name prompt when argument is omitted
- Auto-detects package manager (npm / yarn / pnpm); overridable via
--pm --skip-installand--skip-setupflags- Node.js version check (>= 18)
- Removes
create-cli/dir from scaffolded project - Complete
package.jsonmetadata (keywords, engines, files, repository, bugs) - Added
README.mdfor the CLI package - Usage:
npm create @refkinscallv/node-framework my-app
- New unit tests — 205 tests total (up from 116):
auth.middleware.test.js(16 tests)cache.core.test.js(31 tests)env.validator.test.js(7 tests)helpers.test.js(55 tests — Arr, Str, Hash, BaseService, BaseController)
Changed
app/config.js— Addedapp.requiredEnv,socket.auth, andrateLimit.globalconfig sections.core/boot.core.js— CallsEnvValidator.validateFromConfig()during startup sequence.core/express.core.js— Registers health check endpoint and global rate limiter.core/socket.core.js— Added#setupAuth()private method for optional JWT middleware.core/database.core.js— Addedtransaction(callback)method.core/helpers/hash.helper.js— Replaceduuidpackage withcrypto.randomUUID()(built-in Node.js, removes external ESM-only dependency).jest.config.js— UpdatedcollectCoverageFromto exclude template files (app/models,app/http/validators,core/database,core/helpers/setup.js); raised coverage thresholds (branches: 52%, functions: 65%, lines/statements: 55%).
Removed
uuidpackage — Removed from dependencies; replaced bycrypto.randomUUID()inHash.uuid().
2.1.0
Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog,
and this project adheres to Semantic Versioning.
[2.1.0] - 2026-04-25
Added
JWT.signRefresh()&JWT.verifyRefresh()— Support for refresh tokens.- JWT Security — Added
issuerandaudiencesupport for tokens based on configuration. - Setup Script — Added
npm run setupcommand to easily initialize the project, copy.env.example, and generate random JWT keys securely. - Core Tests — Added comprehensive unit tests for
errorHandler,server,socket,hooks, andmailercore modules.
Changed
logger.core.js— Optimized logging to only create file transports inproductionenvironment, saving I/O overhead indevelopmentwhere only console logs are shown.
Fixed
express.core.js— Added graceful handling (try-catch) when loading custom middlewares and routes to prevent crashes withMODULE_NOT_FOUNDif the default files are missing.
1.0.5
Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog,
and this project adheres to Semantic Versioning.
[1.0.5] - 2026-02-03
Fixed
- Critical: Fixed race condition in graceful shutdown - properly await async operations
- Critical: Fixed database connection not closing properly - made
Database.close()async - Error: Fixed model loading to support subdirectories recursively
- Bug: Fixed 404 handler middleware order - now registered before error handler
- Warning: Improved error handling in hooks - critical errors now propagate properly
- Warning: Routes loading errors now throw instead of silent failure
- Warning: Enhanced socket loading error messages for better debugging
- Warning: Added null checks to
Database.getModel()andDatabase.getInstance() - Warning: Fixed server listen error handling using proper event listeners
Security
- Added prominent security warning for JWT secret configuration
- Recommended using environment variables for sensitive data
Documentation
- Updated API documentation for
Database.close()async behavior - Added breaking changes notice for async database methods
[1.0.0] - 2026-01-04
Added
- Initial release of Node.js MVC Framework
- Express.js integration with middleware support
- Socket.IO for real-time communication
- Sequelize ORM for database management
- JWT authentication utilities
- Email sending with template support (Mailer)
- File upload support with express-fileupload
- Winston logger with daily file rotation
- Application lifecycle hooks (before, after, shutdown)
- Graceful shutdown handling
- CORS configuration
- Cookie parser integration
- Error handler with API and web response modes
- Static file serving
- EJS view engine support
- Comprehensive test suite with Jest
- Code quality tools (ESLint, Prettier, Husky)
- Complete documentation (README.md, API.md)
- Example routes and configuration
Features
-
Core Modules:
- Boot: Application bootstrapper
- Database: Sequelize integration with auto model loading
- Express: Express app with middleware setup
- Logger: Winston-based logging system
- JWT: Token generation and verification
- Mailer: Email sending with EJS templates
- Hooks: Lifecycle event system
- Socket: Socket.IO integration
- Server: HTTP/HTTPS server management
- Runtime: Environment configuration
- ErrorHandler: Global error handling
-
Security:
- JWT authentication
- CORS protection
- Helmet security headers (ready to use)
- Rate limiting support (ready to use)
- Input validation with express-validator
-
Developer Experience:
- Hot reload with nodemon
- Code formatting with Prettier
- Linting with ESLint
- Pre-commit hooks with Husky
- Comprehensive test coverage
- Module aliases for clean imports
Configuration
- Centralized configuration in
app/config.js - Support for environment variables
- Flexible database settings
- Customizable CORS policies
- File upload configuration
- Socket.IO options
- Mailer settings
Documentation
- Complete README with quick start guide
- API documentation with examples
- Code comments in English
- Test examples for all core modules
Development
- Jest testing framework
- Unit and integration tests
- Test coverage reporting
- Development and production scripts
- Database migration scripts (skeleton)
[Unreleased]
Planned
- Redis caching support
- Rate limiting middleware
- API versioning
- Request validation decorators
- CLI tool for scaffolding
- Database migrations and seeders
- Session management
- OAuth integration
- Admin panel
- API documentation generator
Version History
- 1.0.5 (2026-02-03) - Bug fixes and stability improvements
- 1.0.0 (2026-01-04) - Initial release
Full Changelog: https://github.com/refkinscallv/node-framework/commits/1.0.5