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.
- 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.
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
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
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
- 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.
This project is licensed under the MIT License.
Happy Coding journey 😊🎁👍.