The Boilerplate Dynamic Generator is a powerful tool designed to simplify the process of setting up new projects by generating custom boilerplates based on your specific technology preferences. This application allows you to select various front-end and back-end technologies, and generates a tailored project structure with the necessary configurations and dependencies.
The application uses Bootstrap for styling, providing a clean and responsive user interface.
Version: 0.0.1 License: MIT
To set up the Boilerplate Dynamic Generator, follow these steps:
-
Clone the repository:
git clone https://github.com/alamparelli/boilerplate-dynamic-generator.git
-
Navigate to the project directory:
cd boilerplate-dynamic-generator
-
Install the dependencies:
npm install
-
Review the
PROJECT_SETUP.md
file for any additional setup instructions or important information.
To use the Boilerplate Dynamic Generator:
-
Start the application in development mode:
npm run dev
Or start it in production mode:
npm start
-
Open your web browser and navigate to
http://localhost:3000
. -
You will see a form with various options for configuring your boilerplate. Select your desired technologies and options.
-
Click the submit button to generate your boilerplate.
-
The application will create a new boilerplate in the
boilerworkingfolder
directory, as specified in thesrc/boilerplate/boilerplateConfig.json
file.
To add new technology options or customize existing ones:
- Create a new JSON file in the
src/templates
directory (e.g.,newtech.json
). - Define the structure of the new technology option, including any necessary commands, npm packages, or file operations.
- Create a corresponding HTML file (e.g.,
newtech.html
) in the same directory to define the UI for selecting options related to this technology. - The application will automatically detect and include the new option in the generation process.
To modify existing templates:
- Navigate to the
src/templates
directory. - Open the relevant JSON file (e.g.,
frontend.json
,backend.json
). - Modify the content to add, remove, or change options, commands, or file operations.
- If necessary, update the corresponding HTML file to reflect changes in the UI.
Here's a concise example of a JSON template file (src/templates/setup.json
):
{
"filename": "setup",
"html": "./src/templates/setup.html",
"position": 1,
"selectModule": {
"type": "radio",
"esmodule": {
"json": {
"zone": "root",
"path": "package.json",
"default": {
"type": "module"
}
}
},
"commonjs": {
"json": {
"zone": "root",
"path": "package.json",
"default": {
"type": "commonjs"
}
}
}
},
"projectName": {
"type": "input",
"json": {
"zone": "root",
"path": "package.json",
"default": {
"name": "boilerplate"
}
}
}
}
This JSON file defines options for project setup, including module type selection and project name input. Each option specifies how it should be presented in the UI and how it affects the generated project structure.
The application uses HTML templates to create the user interface for selecting boilerplate options. Here are shortened examples of the existing templates:
<div class="row">
<div class="container">
<h2 id="frontend">Frontend</h2>
<div class="m-3">
<p>Select a Frontend framework</p>
<div class="form-check form-check-inline">
<input
class="form-check-input option"
type="radio"
name="selectFrontend"
id="reactjs"
value="reactjs"
/>
<label class="form-check-label" for="reactjs"> ReactJS </label>
</div>
<!-- More frontend options... -->
</div>
</div>
</div>
<div class="row">
<div class="container">
<h2 id="setup">Setup Project</h2>
<div class="m-3">
<p class="fw-bold">Project Infos</p>
<div>
<label class="form-label" for="projectName">Project Name</label>
<input
class="form-control option"
type="text"
id="projectName"
name="projectName"
value="my-app"
/>
</div>
<!-- More project info fields... -->
</div>
<div class="m-3">
<p class="fw-bold">Select Modules</p>
<p>This will change the type option in package-json</p>
<div class="form-check form-check-inline">
<input
class="form-check-input option"
type="radio"
name="selectModule"
id="esmodule"
value="esmodule"
checked
/>
<label class="form-check-label" for="esmodule">ES Modules </label>
</div>
<!-- More module options... -->
</div>
<!-- More setup options... -->
</div>
</div>
These templates use Bootstrap classes for styling, ensuring a consistent and responsive layout. You can customize these templates or create new ones following a similar structure to add more options to your boilerplate generator.
If you encounter any issues:
- Check the console output for error messages.
- Ensure all dependencies are correctly installed.
- Verify that the paths in
src/boilerplate/boilerplateConfig.json
are correct. - Check that you have the necessary permissions to write to the
boilerworkingfolder
directory.
Contributions to the Boilerplate Dynamic Generator are welcome! To contribute:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and commit them with clear, descriptive messages.
- Push your changes to your fork.
- Submit a pull request to the main repository.
For major changes or new features, please open an issue first to discuss the proposed changes.
For any questions or support, please open an issue on the GitHub repository: https://github.com/alamparelli/boilerplate-dynamic-generator/issues
Happy coding!