1.0.0 • Published 5 months ago
buildblox v1.0.0
BuildBlox
Overview
BuildBlox is a simple and efficient CLI tool that generates a structured Node.js backend project using Express. It automates the setup process by creating directories, boilerplate files, and essential configurations—allowing you to jump straight into development.
Features
- Automatically creates a well-structured Express project.
- Includes predefined folders for authentication, configuration, controllers, database, middleware, models, routes, utilities, and views.
- Generates essential boilerplate files such as
server.js
and.env
. - Provides an intuitive CLI prompt to confirm project creation.
- Displays the generated project structure upon completion.
Installation
You can use npx
to run the package without installing it globally:
npx buildblox
Alternatively, install it globally for repeated use:
npm install -g buildblox
Usage
To generate a new backend project, follow these steps:
- Create and navigate into your project directory:
mkdir backend cd backend
- Run the CLI tool:
If installed globally, use:npx buildblox
buildblox
- Confirm the setup when prompted.
- Install necessary dependencies:
npm install express cors dotenv
- Your project is ready! Start your development server:
node server.js
Project Structure
After running the command, your project will be structured as follows:
my-backend-app/
├── auth/
│ ├── .auth.js
├── config/
│ ├── .conf.js
├── controllers/
│ ├── .controller.js
├── db/
│ ├── .db.js
├── helpers/
│ ├── .helper.js
├── middleware/
│ ├── .middleware.js
├── models/
│ ├── .model.js
├── routes/
│ ├── .routes.js
├── utils/
│ ├── .util.js
├── views/
│ ├── .view.ejs
├── .env
├── server.js
Notes
- The
.env
file includesPORT=3000
by default. - The
server.js
file initializes an Express server with CORS enabled. - You can modify the project structure and files as per your requirements.
License
This project is licensed under the MIT License.
Contributing
Feel free to open issues and submit pull requests to enhance the project.
Support
For any questions or issues, please open an issue on the GitHub repository.
1.0.0
5 months ago