servora
v1.3.0
Published
Scaffold a production-ready Node.js Express backend with TypeScript or JavaScript, MongoDB, ESLint, Docker, and more.
Downloads
16
Maintainers
Readme
servora
Scaffold a production-ready Node.js Express backend with TypeScript or JavaScript, MongoDB, ESLint, Docker, and more — in one command.
No install required. Use npx so anyone can create a project without installing the CLI.
Quick start
npx servora my-appAnswer the prompts; you get a full project (package.json, app entry, routes, .env, README, etc.) and optional auto-install of dependencies.
That’s it. Do not run npm install -g servora — use npx servora every time.
Optional global install:
npm install -g servora
# or: pnpm add -g servora | yarn global add servora | bun add -g servora
servora my-appOptions
| Option | Description |
|--------|-------------|
| -y, --yes | Skip all prompts; use defaults (TypeScript, no MongoDB, no auto-install). |
| -v, --version | Print version. |
| -h, --help | Print help. |
Examples:
npx servora api -y
npx servora --help
npx servora --versionWhat you get
- Language: TypeScript or JavaScript (ES modules)
- Server: Express with
express.json(),express.urlencoded() - Database: Optional MongoDB with Mongoose and a sample User model
- Middleware: CORS, global error handler, custom logger, Morgan
- Config:
.envand.env.example, path aliases (@/) for TypeScript - Quality: ESLint (flat config)
- DevOps: Optional Dockerfile and
.dockerignore - Install: Choose npm, pnpm, yarn, or bun for installing dependencies
Generated structure (TypeScript):
my-app/
├── src/
│ ├── app.ts
│ ├── routes/
│ │ └── index.ts
│ ├── lib/db.ts
│ ├── models/
│ ├── middlewares/
│ ├── utils/
│ └── controllers/
├── package.json
├── tsconfig.json
├── eslint.config.js
├── .env
├── .env.example
├── .gitignore
├── README.md
└── (optional) Dockerfile, .dockerignoreRequirements
- Node.js >= 18
- Network access (to fetch latest dependency versions and run install)
Building from source
pnpm install
pnpm run buildIf you use pnpm and the build fails with Could not resolve "...", run once:pnpm install --node-linker=hoisted then pnpm run build. (Do not commit the generated .npmrc if you want to avoid the npm warning about unknown config.)
Publishing this package to npm
Create an npm account at npmjs.com and log in:
npm loginChoose a package name
- If
servorais taken, use a scoped name inpackage.json:"name": "@your-username/servora" - Then users run:
npx @your-username/servora my-app
- If
Set repository URLs in
package.json(replaceyour-usernamewith your GitHub username):repository.urlhomepagebugs.url
Build and publish:
pnpm run build npm publishFor a scoped package (e.g.
@your-username/servora), the first publish must be:npm publish --access publicAfter publishing, anyone can run:
npx servora my-app # or npx @your-username/servora my-app
License
ISC
