nest-hexagon-cli

3.1.0 • Public • Published

NestJS Hexagonal Architecture Generator

npm version License

A command-line interface (CLI) tool that generates modules in hexagonal architecture for NestJS, making it easy to follow the principles of clean architecture and separation of concerns.

Features

  • Scaffold modules using the hexagonal architecture pattern
  • Generate service, controller, repository, and DTO files
  • Automatically wire up dependencies using NestJS decorators
  • Promote a modular and maintainable code structure
  • Enhance separation of concerns and testability
  • Enable better code organization and scalability

Installation

npm install -g nest-hexagon-cli

Usage

To generate a module using the hexagonal architecture pattern, simply run the following command:

nest-hexagon generate module <module-name>

This will create a new module in the current directory with the specified name, along with the necessary files and folder structure.

Examples

Generate a new module named users:

nest-hexagon generate module users

License

This project is licensed under the MIT License.

Contributing

Contributions are welcome! If you have any ideas, suggestions, or bug reports, please open an issue or submit a pull request.

Roadmap

Here are some ideas and potential features for future development:

  • Support for generating other components such as guards, interceptors, and pipes
  • Integration with popular testing frameworks to generate test files
  • Support for customizing the generated code templates
  • Ability to generate modules with additional configuration options
  • Improved error handling and user-friendly error messages

Feel free to contribute by implementing any of these features or suggesting your own!

Acknowledgements

This project is inspired by the principles of hexagonal architecture and the clean architecture movement. Special thanks to the NestJS community for their amazing work and support.

Contact

For any questions or inquiries, please contact contact.khalfoun@gmail.com.


We hope this CLI tool helps you build modular and maintainable applications with NestJS and the hexagonal architecture pattern. Happy coding!

Note: This is a sample readme file. You can modify it as per your requirements and add more details specific to your npm library.

Ideas for Improvement

Here are a few ideas to enhance your NestJS hexagonal architecture generator:

  1. Interactive CLI: Create an interactive command-line interface that guides users through the module generation process, allowing them to choose options and configure different components.
  2. Code Templates: Implement a system that allows users to define custom code templates for different files, enabling them to tailor the generated code to their specific needs.
  3. Integration with TypeORM: Extend the generator to integrate with TypeORM, enabling the generation of database-related files such as entities, migrations, and query builders.
  4. Configuration Options: Add support for configuration files where users can define default options for the generator, making it easier to maintain consistency across projects.
  5. Testing Support: Incorporate testing frameworks such as Jest or Mocha to generate test files alongside the module scaffolding, promoting a test-driven development (TDD) approach.
  6. Documentation Generation: Include a feature to generate API documentation using tools like Swagger or Compodoc, automating the process of documenting the generated modules.

Package Sidebar

Install

npm i nest-hexagon-cli

Weekly Downloads

1

Version

3.1.0

License

MIT

Unpacked Size

214 kB

Total Files

196

Last publish

Collaborators

  • khalfoun_mehdi