Skip to content

codewithsaidul/codewithsaidul-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SAIDUL CLI

A simple CLI tool to generate Express.js modules with object-style services and controllers.   Interactive, fast, and perfect for structuring your backend projects.

🚀 Installation

Install globally via npm:

npm install -g codewithsaidul-cli

Usage

Generate a module:

cws create <feature_name>

Replace <feature_name> with the name of your feature/module (e.g., appointment). You will be prompted to choose the database system using arrow keys:

prisma

mongoose

raw-mongodb

You will also be asked whether to generate inside src/app/modules or just src/modules.

Example:
cws create appointment

🗂 Generated Files

Depending on your choices, the following files will be created:

service.ts → Object-style service

controller.ts → Object-style controller

route.ts → Express router

model.ts → Only if Mongoose is selected

Example directory structure:

src/app/modules/appointment/
├─ appointment.service.ts
├─ appointment.controller.ts
├─ appointment.route.ts
└─ appointment.model.ts    (if Mongoose)

✨ Features

  • Interactive arrow key DB selection (like Vite/React CLI)

  • Object-style service and controller

  • Optional Mongoose model

  • Choice of generating in src/app/modules or src/modules

⚡ Example Workflow

Install the package

npm i -g codewithsaidul-cli

1. Run
cws create appointment
2. Select database system (use arrow keys):
> prisma
  mongoose
  raw-mongodb
  1. Confirm folder location (src/app/modules or src/modules)

  2. Files are generated automatically with a Successfull message:

---------------------------------------------
👏  Hey there! Your "appointment" module is ready.
---------------------------------------------
Generated files in: src/app/modules/appointment

• Service       : appointment.service.ts
• Controller    : appointment.controller.ts
• Route         : appointment.route.ts
• Model         : appointment.model.ts

Database system: Mongoose
You can now start implementing your business logic! 🚀

Happy coding! ✨
---------------------------------------------

🛠 Requirements

  • Node.js >= 18

  • npm >= 9

Works on Linux, macOS, and Windows terminals

📜 License

MIT

🧑‍💻 Author

SAIDUL ISLAM RANA

Frontend Dev | Backend Learner | MERN Stack Enthusiast

GitHub: @codewithsaidul

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published