🎓 Moleculer-based microservices project template. Live demo on now.sh
- 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.
- Lint with ESLint.
- Launch file for debugging in VSCode.
- User auth with JWT authentication sample
- Typescript decorators for moleculer https://github.com/d0whc3r/moleculer-decorators
- Configuration for development/production/testing using environment variables
To install use the moleculer-cli tool.
$ moleculer init d0whc3r/moleculer-template-project-ts my-project
$ moleculer init d0whc3r/moleculer-template-project-ts moleculer-demo
Template 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 run dev
: Start development mode (load all services locally without transporter with hot-reload & REPL)npm run build
: Build project to javascript indist
folder (with rollup)npm run start
: Start production mode (setSERVICES
env variable to load certain services)used for docker
npm run start:prod
: Start usingenv/production.env
npm run cli
: Start a CLI and connect to production. Don't forget to set production namespace with--ns
argument in scriptnpm run lint
: Run ESLintnpm run test:watch
: Run continuous test mode with watchingnpm test
: Run testsnpm test:coverage
: Run tests & generate coverage reportnpm run dc:up
: Start the stack with Docker Composenpm run dc:logs
: Watch & follow the container logsnpm run dc:down
: Stop the stack with Docker Compose
moleculer-template-project is available under the MIT license.
Copyright (c) 2020 MoleculerJS