A comprehensive boilerplate specifically tailored for creating and organizing a NestJS package. It serves as a foundational framework equipped with all the necessary configurations to streamline the development process. This boilerplate provides a robust and scalable structure, ensuring best practices are adhered to while building NestJS packages.
It includes essential setup files, pre-configured tools, and integrations, allowing developers to focus on coding functionality without worrying about setting up the initial project structure. Ideal for those seeking a ready-to-use solution for rapid development and efficient package management in NestJS.
To begin developing with Blitz, fork or clone this repository using the command below:
git clone https://github.com/surelle-ha/Blitz-Boilerplate
After cloning, update the details in package.json as needed. Next, install the required dependencies for the boilerplate:
npm install
After a fresh installation, your src
directory should look like the following structure. You may modify it based on your needs, but ensure that the index.ts
file is not removed:
📦src
┣ 📜blitz.controller.ts
┣ 📜blitz.module.ts
┣ 📜blitz.service.ts
┗ 📜index.ts
When you finish developing your package, make sure to update the index.ts
file accordingly:
export * from "./blitz.module";
export * from "./blitz.service";
export * from "./blitz.controller";
To build and test your package locally, run the following command:
npm run build && npm link
This will make your package available for local use. To test your package, navigate to another NestJS project and install your package:
npm install @username/blitz-boilerplate
Note: Replace @username/blitz-boilerplate with your updated package name if it has been changed.
This boilerplate comes with two pre-configured GitHub workflows: one for pushing the package to GitHub Registry, and another for pushing it to the NPM Registry.
No configuration is needed for the GitHub Registry action. However, for the NPM Registry action, you'll need to generate an Access Token from the NPM website. After that, create a repository secret on your GitHub account named NPM_TOKEN. Once this is done, both workflows will succeed.
To get started, here’s what you need to know:
We prioritize creating a respectful and inclusive environment. Please review and adhere to our Code of Conduct to ensure a positive experience for all collaborators.
If you find a bug in the codebase:
- Check Existing Issues: Verify if the issue has already been reported to avoid duplication.
- Create a Detailed Issue: Include a descriptive title, a clear explanation of the problem, steps to reproduce, and the expected outcome.
To suggest a new feature:
- Search Existing Suggestions: Check if someone else has already proposed something similar.
- Submit a New Issue: Clearly describe the proposed feature, its benefits, and possible implementations.
- Fork the Repository: Start by forking the project repository on GitHub.
- Clone Your Fork: Clone your forked repository to your local machine.
- Install Dependencies: Navigate to the project directory and run
npm install
to install required dependencies.
- Create a New Branch: Use a branch specific to the feature or fix you are working on.
- Commit Changes: Make your changes in the new branch. Commit messages should clearly explain the purpose of the changes.
- Write Tests: Add or update tests to cover the new functionality or fixes. Ensure all tests pass.
- Update Your Branch: Rebase your branch on the latest main branch to ensure a smooth integration.
- Submit a Pull Request (PR): Push your branch to GitHub and open a PR against the main branch of the original project repository.
- Review Process: The project maintainer will review your PR. Be open to making revisions based on feedback.
- PR Approval and Merge: Once approved, the maintainers will merge your PR.
- Documentation: Familiarize yourself with the project documentation to understand how to use and extend the project.
Community: Join our community forums or chat channels to discuss ideas and ask questions.
Contributors who help improve the project make a significant impact. We appreciate your dedication and effort in enhancing this project.
Thank you for choosing to contribute to the project. We look forward to your contributions!