Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/d0whc3r/moleculer-template-project-ts
:mortar_board: Common project template for Moleculer-based projects
https://github.com/d0whc3r/moleculer-template-project-ts
Last synced: 2 months ago
JSON representation
:mortar_board: Common project template for Moleculer-based projects
- Host: GitHub
- URL: https://github.com/d0whc3r/moleculer-template-project-ts
- Owner: d0whc3r
- License: mit
- Fork: true (moleculerjs/moleculer-template-project)
- Created: 2020-05-20T08:39:34.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-11-06T05:50:12.000Z (about 1 year ago)
- Last Synced: 2024-08-03T02:04:10.226Z (5 months ago)
- Language: TypeScript
- Homepage: https://moleculer-template-project-ts.now.sh
- Size: 601 KB
- Stars: 7
- Watchers: 2
- Forks: 3
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-moleculer - moleculer-template-project-ts - Project template for typescript including decorators and more (Templates / Typescript)
README
# Moleculer template: `project-ts`
:mortar_board: Moleculer-based microservices project template. [Live demo on now.sh](https://moleculer-demo-project-ts.now.sh/)## Features
- Moleculer v0.14 with full-detailed `moleculer.config.js` file.
- Common mono-repo project with a demo `greeter` service.
- Sample database `products` service (with file-based NeDB in development & MongoDB in production).
- Optional API Gateway service with detailed service settings.
- Beautiful static welcome page to test generated services & watch nodes and services.
- Optional Transporter & Cacher.
- Metrics & Tracing.
- Docker & Docker Compose & Kubernetes files.
- Unit tests with [Jest](http://facebook.github.io/jest/).
- Lint with [ESLint](http://eslint.org/).
- Launch file for debugging in [VSCode](https://code.visualstudio.com/).
- User auth with JWT authentication sample
- Typescript decorators for moleculer [https://github.com/d0whc3r/moleculer-decorators](https://github.com/d0whc3r/moleculer-decorators)
- Configuration for development/production/testing using environment variables## Install
To install use the [moleculer-cli](https://github.com/moleculerjs/moleculer-cli) tool.```bash
$ moleculer init d0whc3r/moleculer-template-project-ts my-project
```## Prompts
```
$ moleculer init d0whc3r/moleculer-template-project-ts moleculer-demoTemplate repo: d0whc3r/moleculer-template-project-ts
Downloading template...
? Add API Gateway (moleculer-web) service? Yes
? Would you like to communicate with other nodes? Yes
? Select a transporter NATS (recommended)
? Would you like to use cache? No
? Add DB sample service? Yes
? Add User sample service? (authenticate) Yes
? Would you like to enable metrics? Yes
? Would you like to enable tracing? Yes
? Add Docker & Kubernetes sample files? Yes
? Use ESLint to lint your code? Yes
Create 'moleculer-demo' folder...
? Would you like to run 'npm install'? Yes
```## NPM scripts
- `npm run dev`: Start development mode (load all services locally without transporter with hot-reload & REPL)
- `npm run build`: Build project to javascript in `dist` folder (with rollup)
- `npm run start`: Start production mode (set `SERVICES` env variable to load certain services) `used for docker`
- `npm run start:prod`: Start using `env/production.env`
- `npm run cli`: Start a CLI and connect to production. _Don't forget to set production namespace with `--ns` argument in script_
- `npm run lint`: Run ESLint
- `npm run test:watch`: Run continuous test mode with watching
- `npm test`: Run tests
- `npm test:coverage`: Run tests & generate coverage report
- `npm run dc:up`: Start the stack with Docker Compose
- `npm run dc:logs`: Watch & follow the container logs
- `npm run dc:down`: Stop the stack with Docker Compose## License
moleculer-template-project is available under the [MIT license](https://tldrlegal.com/license/mit-license).## Contact
Copyright (c) 2020 MoleculerJS[![@moleculerjs](https://img.shields.io/badge/github-moleculerjs-green.svg)](https://github.com/moleculerjs) [![@MoleculerJS](https://img.shields.io/badge/twitter-MoleculerJS-blue.svg)](https://twitter.com/MoleculerJS)