Skip to content

eklemen/generate-express

Repository files navigation

generate-express logo

Generate an Express app from the command line

Tired of searching for the right boilerplate repo? Generate your next ExpressJS project from the command line, and pick the options you need to fit your next project.

Now with Typescript support!

Features

  • Code in ES6+ or Typescript
  • Interactive CLI prompts walk you through each option to customize your build (no more inline flags)
  • Choose your own database starter configs (mongojs, mongo + mongoose, sequelize, or none)
  • Optional caching configs for Redis
  • File watcher via nodemon to transpile code on change

Coming soon

  • Ability to specify SQL dialect for sequelize (postgres, mysql, sqlite, etc.)
  • More CLI options for more packages
  • Testing: starting with jest will add configs for other frameworks eventually
  • More testing of this framework itself

Quick Start

npx generate-express myCoolProject

Start your Express.js server

# run with file watch (development)
$ npm run start

Default routes

localhost:3001/api
localhost:3001/api/users

Other npm scripts

# run with file watch (development)
$ npm run start

# run as production
$ npm run prod

# create prod build to /dist
$ npm run build

Example project structure

MyCoolApp
└── server
    ├── app.js
    ├── bin
    │   └── www.js
    ├── controllers
    │   └── userController.js
    ├── models
    │   ├── User.js
    │   └── index.js
    └── routes
        ├── hello.js
        ├── index.js
        └── users.js

Contributions

Feel free to raise an issue or create a Pull Request if you see ways that can improve this library.

Current Contributors

Inspired by

Express' application generator.

License

MIT