proweb
v1.0.3
Published
A CLI tool to quickly scaffold backend projects with a ready-made template
Downloads
15
Maintainers
Readme
proweb
A CLI tool to auto-generate a fully-structured Node.js + Express + MongoDB backend setup in seconds.
proweb creates a complete backend project with folders, files, environment config, database setup, authentication middleware, utilities, and all required dependencies — just by running one command.
⚙️ Installation & Usage
✅ Recommended (Without Global Install)
npx proweb🚀 Features
- Generates full backend boilerplate (Express + MongoDB + MVC pattern).
- Includes auth middleware (JWT-based).
- Includes file upload setup using Multer.
- Includes utility helpers (API Response, Error Handler, Async Handler).
- Environment variable setup using
.env. - Uses modern ES Modules and clean folder structure.
- Automatically runs
npm installafter generating setup. - Works with
npxand global install.
📁 Template Folder Structure (Generated Project)
my-backend/
├─ node_modules/
├─ .env.example
├─ .gitignore
├─ package.json
├─ src/
│ ├─ app.js
│ ├─ index.js ← Server entry point
│ ├─ constants.js
│ ├─ db/
│ │ └─ connectDB.js ← MongoDB connection using Mongoose
│ ├─ models/
│ │ └─ user.model.js (example)
│ ├─ controllers/
│ │ └─ user.controller.js (example)
│ ├─ routes/
│ │ └─ user.routes.js (example)
│ ├─ middlewares/
│ │ ├─ auth.middleware.js ← JWT authentication check
│ │ └─ multer.middleware.js ← File upload handling
│ ├─ utils/
│ │ ├─ ApiResponse.js
│ │ ├─ ApiError.js
│ │ └─ asyncHandler.js
└─ README.md
---
## 📦 Packages Included in Generated Backend
| Package | Purpose |
|----------------|---------|
| express | Web framework for creating server & routes |
| mongoose | MongoDB ODM to manage database models |
| dotenv | Loads environment variables from `.env` |
| bcrypt | Hashing passwords securely |
| jsonwebtoken | JWT token generation & verification |
| cookie-parser | Reads cookies from client requests |
| cors | Handles Cross-Origin Resource Sharing |
| multer | File uploads (images, docs, etc.) |
| inquirer | Used only in CLI to ask project name (not in generated backend) |
⚙️ Installation & Usage
✅ Recommended (Without Global Install)
npx proweb✅ Or Install Globally
npm i -g proweb
proweb✅ Or Run Interactively
prowebThen it will ask:
? Enter your project name: (default: my-backend)📌 After Installation – What to Do
cd my-backend
cp .env.example .env # Add your MongoDB URI, JWT secret, etc.
npm run dev # Start development server with nodemon🔑 Environment (.env) Example
PORT=3000
MONGO_URI=****YOUR_MONGO_URI*****
CORS_ORIGIN=*
ACCESS_TOKEN_SECRET=****ANY_RANDOM_SECRET***
ACCESS_TOKEN_EXPIRY=1d
REFRESH_TOKEN_SECRET=****ANY_RANDOM_SECRET***
REFRESH_TOKEN_EXPIRY=10d🧠 Internal Architecture
✅ Entry Point
src/index.js→ Starts server, connects to DB.src/app.js→ Registers middleware, routes, error handling.
✅ Auth Flow
- User logs in → JWT token created → Stored in cookies.
auth.middleware.jsverifies token on protected routes.
✅ Multer (File Uploads)
- Used for uploading profile pictures, documents, etc.
- Files stored temporarily or in
/uploads.
✅ License
MIT License.
✅ Example Terminal Output
C:\Users> npx proweb api-server
? Enter your project name: api-server
📁 Creating project folder...
📂 Copying backend template...
📦 Installing dependencies...
✅ Setup complete!
Next steps:
cd api-server
cp .env.example .env
npm run devYour backend is now ready to use 🎯
