npm.io
1.0.0 • Published 4d agoCLI

comman-nodejs-mongodb-code

Licence
MIT
Version
1.0.0
Deps
0
Size
73 kB
Vulns
0
Weekly
0

comman-nodejs-mongodb-code

Scaffold a ready-to-use Node.js + Express + MongoDB project structure (auth, JWT, Joi validation, Swagger, mailer, file uploads) with a single command.

Usage

# create a new folder named my-app
npx comman-nodejs-mongodb-code my-app

# or scaffold into the current (empty) folder
npx comman-nodejs-mongodb-code .

After scaffolding

cd my-app
cp .env.example .env   # fill in your MongoDB URL, JWT secrets, etc.
npm install
npm start

The server starts on the port defined in your .env (default http://localhost:4000).

What you get

my-app/
├── index.js              # app entry (Express + Mongo connection)
├── model/                # Mongoose models
├── routes/               # route registration
├── src/
│   ├── auth/             # auth controller / router / services / dto
│   ├── user/             # user module
│   └── comman/           # shared config, helpers, middleware
├── swagger.yaml
├── .babelrc
├── nodemon.json
└── .env.example

Keywords