new changes - #22
Open
Raunak1375 wants to merge 8 commits into
Open
Conversation
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.
Fix #8
This pull request introduces the complete Celtrix project, which consists of two major components:
A Command-Line Interface (CLI) tool to automate the creation of new backend projects.
A production-ready Backend Template that includes all the features specified in the original issue, such as logging, rate limiting, authentication, and more.
Changes Implemented
A new CLI tool, installable via npm, has been created to scaffold a new backend project with a single command.
Command: celtrix create
Interactive: Uses inquirer to prompt the user if the target directory already exists, preventing accidental data loss.
User-Friendly Output: Uses chalk for colored and easy-to-read console messages.
Core Technology: Built with Node.js and commander.js for robust command handling.
The CLI generates a new project based on a powerful and scalable backend template built with Express.js and TypeScript. This template serves as the solution to the core task requirements.
Authentication: Implemented JWT-based authentication with Role-Based Access Control (RBAC). Middleware is included to protect routes and authorize specific roles (e.g., admin).
Logging: Integrated Winston for robust, asynchronous logging. Logs are directed to the console in development and to error.log / combined.log files in production.
Rate Limiting: Added middleware using express-rate-limit to prevent brute-force attacks and API abuse.
File Utilities: A dedicated service (file.service.ts) can parse the contents of uploaded PDF and XLSX files using pdf-parse and xlsx.
Notifications: A basic NotificationService stub is included, demonstrating where to integrate email, push, or WebSocket notifications.
Clean Architecture: The project follows a clean and scalable structure, separating concerns into controllers, services, middlewares, routes, and configuration.