NOTE: this generator is based on template files located in microservice-template repository on github.
Blue Generator is a tool to initialize a working microservice template project ready to run, test and deploy.
Git
should be installed before using this tool.
This tool is using git
to fetch
template options from a remote repository and to clone
the selected template.
To install the generator run:
npm install --global https://github.com/blue-stream/blue-stream-generator
Run:
blue-generator
Answer questions about your project
- Project name
- Main feature name
- Features to apply
√ Fetching templates from git repository
? What project template would you like to generate? root
? Project name: example-project
? Main feature name: user
√ Generating template files
┌────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ │
│ .d8888b. 888 │
│ d88P Y88b 888 │
│ 888 888 888 │
│ 888 .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. 888d888 │
│ 888 88888 d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d88""88b 888P" │
│ 888 888 88888888 888 888 88888888 888 .d888888 888 888 888 888 │
│ Y88b d88P Y8b. 888 888 Y8b. 888 888 888 Y88b. Y88..88P 888 │
│ "Y8888P88 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y88P" 888 │
│ │
│ │
│ by Ron Borysovski │
│ │
└────────────────────────────────────────────────────────────────────────────────────────────────────┘
? Project name: example-project
? Main feature name: user
✔ Fetching template
✔ Fetching available features
? Select features to enable MongoDB, Error Handler, Authentication using JWT
✔ Applying features
┌────────────────────────────────────────┐
│ │
│ Template is ready! │
│ To run your project: │
│ cd example-project │
│ npm install │
│ npm start │
│ │
│ │
└────────────────────────────────────────┘
Will generate the following structure
example-project
|____ src
| |____ user
| | |____ user.router.ts
| | |____ user.router.ts
| | |____ user.controller.ts
: : :
| | |____ user.interface.ts
| config.ts
| server.ts
: :
After generating a project named example-project
cd example-project
npm install
npm start
npm test
Tests are executed with Mocha
and Chai