1.0.0 • Published 5 months ago

buildblox v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
5 months ago

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:

  1. Create and navigate into your project directory:
    mkdir backend
    cd backend
  2. Run the CLI tool:
    npx buildblox
    If installed globally, use:
    buildblox
  3. Confirm the setup when prompted.
  4. Install necessary dependencies:
    npm install express cors dotenv
  5. 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 includes PORT=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