setup-server
v1.0.6
Published
CLI to generate server setup
Readme
setup-server
A minimal CLI tool to bootstrap a production-ready Node.js backend structure instantly.
This tool generates a clean and scalable server setup with Express, MongoDB configuration, environment variables, and best-practice project structure — all in seconds.
Features
- Zero-config backend setup
- Clean folder architecture
- Pre-configured Express server
- MongoDB connection setup using Mongoose
- Environment variable management using dotenv
- Developer-friendly structure for scalability
Installation & Usage
Recommended (No Installation Required)
Run directly using npx:
npx setup-serverThis will generate a server folder in your current directory with the complete setup.
Generated Project Structure
server/
├── src/
│ ├── app.js
│ └── configs/
│ ├── db.config.js
│ └── env.config.js
├── .env
├── package.json
└── server.jsWhat Gets Created
Express App (app.js)
- JSON parsing enabled
- Morgan logger configured
Database Config (db.config.js)
- MongoDB connection using Mongoose
- Error handling included
Environment Config (env.config.js)
- Centralized configuration management
Server Entry (server.js)
- Connects to database
- Starts server using environment variables
Environment File (.env)
Predefined variables:
MONGO_URI=
JWT_SECRET=
SERVER_PORT=5000
SERVER_HOST=localhostGetting Started After Setup
cd server
npm install
npm startRequirements
- Node.js >= 14
- npm >= 6
Philosophy
This CLI is designed to eliminate repetitive backend setup so developers can focus on building features instead of configuring boilerplate.
Author
Suryakumar Sirvi
License
ISC
---
If you want next level upgrade, we can enhance this with:
- CLI options (`project name`, `port`, etc.)
- TypeScript support
- Git initialization
- Custom templates
Just tell me.