generator-create-service
v1.20.0
Published
Boring Express Microservice Generator
Downloads
13
Maintainers
Readme
Features
Generated service includes the following features:
- [x] Express.js
- [x] MongoDB ODM using Mongoose
- [x] PostgreSQL ORM using Sequelize, TypeORM or Prisma
- [x] Code structure inspired by Node.js Best Practices & Uncle Bob Clean Architecture
Other features:
- [x] Webpack with Typescript using @boringcodes/backpack
- [x] Prettier using @boringcodes/prettier-config
- [x] ESLint using @boringcodes/eslint-config-typescript
- [x] Husky
- [x] Lint Staged
- [x] NVM
- [x] Dockerfile
- [x] Standard Version
Install
Make sure yeoman
is installed
$ yarn global add yo
Then install the generator
$ yarn global add generator-create-service
Usage
Create a new directory
$ mkdir service-name
Then navigate to the created directory and run the following command to generate source
$ yo create-service
# or :with-mongo
$ yo create-service:with-mongo
# or :with-postgres-sequelize
$ yo create-service:with-postgres-sequelize
# or :with-postgres-typeorm
$ yo create-service:with-postgres-typeorm
# or :with-postgres-prisma
$ yo create-service:with-postgres-prisma
This scaffolds out:
├── .husky
├── src
│ ├── components
│ │ ├── index.ts
│ │ └── types.ts
│ ├── config
│ │ ├── index.ts
│ │ ├── mongo.ts (:with-mongo)
│ │ └── postgres.ts (:with-postgres-sequelize/:with-postgres-typeorm)
│ ├── db
│ │ ├── mongo.ts (:with-mongo)
│ │ ├── postgres.prisma (:with-postgres-prisma)
│ │ └── postgres.ts (:with-postgres-sequelize/:with-postgres-typeorm/:with-postgres-prisma)
│ ├── app.ts
│ └── index.ts
├── .dockerignore
├── .env.example
├── .gitignore
├── .nvmrc
├── Dockerfile
├── LICENSE
├── package.json
├── README.md
└── tsconfig.json
To generate service component with full CRUD
functions, please use @boringcodes/create-service-component
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.