Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Next 0.14 #19

Merged
merged 52 commits into from
Feb 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
48dbf87
update to 0.14
icebob Jan 12, 2020
e00bbcd
add tracing & metrics
icebob Jan 12, 2020
7807f18
add modern welcome page
icebob Jan 12, 2020
1e1c1f2
mappingPolicy
icebob Jan 12, 2020
7296904
add skipInterpolation
icebob Jan 13, 2020
cdda804
fix error message
icebob Jan 13, 2020
dba4cc9
add k8s file
icebob Jan 13, 2020
99e9fd3
update html template
icebob Jan 14, 2020
dd4debf
add now publishing
icebob Jan 15, 2020
8f421f1
update readme
icebob Jan 15, 2020
549d6bb
Fix constants
icebob Jan 16, 2020
e3061cb
Change header logo
icebob Jan 20, 2020
61cda72
Remove shadow filter
icebob Jan 20, 2020
5f1d24d
add sample db service
icebob Jan 21, 2020
44ec665
add products service & improve welcome page
icebob Jan 25, 2020
be6d17b
add more tests
icebob Jan 25, 2020
4fc5d37
fix comment
icebob Jan 25, 2020
0ecd703
minor changes
icebob Jan 26, 2020
b6496e4
improve readme
icebob Jan 26, 2020
ac6585b
update moleculer to rc1
icebob Jan 26, 2020
91744ec
enable metrics & tracing by default
icebob Jan 26, 2020
9858323
add sorting
icebob Jan 29, 2020
0e62734
upgade versions
icebob Feb 1, 2020
8205020
not use transporter in development mode
icebob Feb 2, 2020
f7db22d
use traefik v2 & add mongo for products service
icebob Feb 2, 2020
7a4d87b
add missing db adapter
icebob Feb 2, 2020
88f994f
add `dc:logs` script
icebob Feb 2, 2020
6b496d7
add editorconfig
icebob Feb 2, 2020
33b721a
update readme
icebob Feb 2, 2020
02b46ef
Merge branch 'master' into next
icebob Feb 2, 2020
8c3f096
add ci workflow
icebob Feb 2, 2020
3ddf75a
docker hello world
icebob Feb 2, 2020
6503d35
test docker-compose
icebob Feb 2, 2020
cbefcf4
add working directory
icebob Feb 2, 2020
7c4eaa3
sleep
icebob Feb 2, 2020
8d5f3d0
add transporter
icebob Feb 2, 2020
5bc46bc
add curl tests
icebob Feb 2, 2020
d65db02
using transporter matrix
icebob Feb 2, 2020
c1b3b10
add all transporter
icebob Feb 2, 2020
eeb0afa
curl fail
icebob Feb 2, 2020
f494955
increase sleep
icebob Feb 2, 2020
383e5b0
add yml to editorconfig
icebob Feb 2, 2020
5065cdb
fix kafka config
icebob Feb 2, 2020
1e9f39e
fix kafka
icebob Feb 2, 2020
d6f00e4
Template improvements
AndreMaz Feb 3, 2020
3af0896
Use object instead of string to declare "rest"
AndreMaz Feb 3, 2020
7d8fddc
fix getActionREST
icebob Feb 4, 2020
57f0186
Merge pull request #18 from AndreMaz/next
icebob Feb 4, 2020
492d064
update year
icebob Feb 5, 2020
5709b7c
fix comments
icebob Feb 8, 2020
ab2aa59
update moleculer to stable 0.14
icebob Feb 12, 2020
a2beaa0
2.0.0
icebob Feb 12, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 38 additions & 22 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,38 @@
name: Test template

on: [push]

jobs:
test:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [10.x, 12.x, 13.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm i
- run: npm run dev
env:
CI: true
name: Test template

on: [push]

jobs:
test:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [10.x, 12.x]
transporter: [NATS, Redis, MQTT, AMQP, STAN, Kafka]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }} with ${{ matrix.transporter }} transporter
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm i
- run: node update-answers.js
working-directory: ./test/ci
env:
TRANSPORTER: ${{ matrix.transporter }}
- run: npm test
env:
CI: true
- run: npm run dc:up
working-directory: ./ci-test
- run: sleep 30
- run: docker-compose ps
working-directory: ./ci-test
- run: docker-compose logs
working-directory: ./ci-test
- run: curl --silent --show-error --fail http://localhost:3000/api/greeter/hello
- run: curl --silent --show-error --fail http://localhost:3000/api/products
- run: npm run dc:down
working-directory: ./ci-test
76 changes: 39 additions & 37 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,37 +1,39 @@
# Logs
logs
*.log
npm-debug.log*

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules
jspm_packages

# Optional npm cache directory
.npm

# Optional REPL history
.node_repl_history
# Logs
logs
*.log
npm-debug.log*

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules
jspm_packages

# Optional npm cache directory
.npm

# Optional REPL history
.node_repl_history

/tmp
42 changes: 21 additions & 21 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
MIT License

Copyright (c) 2018 MoleculerJS

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
MIT License
Copyright (c) 2020 MoleculerJS
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
114 changes: 60 additions & 54 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,60 @@
# Moleculer template: `project`
:mortar_board: Moleculer-based microservices project template.

## Features
- Moleculer v0.13.x with full-detailed `moleculer.config.js` file.
- Common project with a demo `greeter` service.
- Optional API Gateway service.
- Optional Transporter & Cacher.
- Docker & Docker Compose 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/).


## Install
To install use the [moleculer-cli](https://github.com/moleculerjs/moleculer-cli) tool.

```bash
$ moleculer init project my-project
```

## Prompts
```
$ moleculer init project moleculer-demo

Template repo: moleculerjs/moleculer-template-project
? Add API Gateway (moleculer-web) service Yes
? Would you like to communicate with other nodes? Yes
? Select a transporter TCP
? Would you like to use cache? No
? Add Docker files? Yes
? Use ESLint to lint your code? Yes
? Setup unit tests with Jest? 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 with hot-reload & REPL)
- `npm run start`: Start production mode (set `SERVICES` env variable to load certain services)
- `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 ci`: Run continuous test mode with watching
- `npm test`: Run tests & generate coverage report
- `npm run dc:up`: Start the stack with Docker Compose
- `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) 2018 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)
# Moleculer template: `project`
:mortar_board: Moleculer-based microservices project template. [Live demo on now.sh](https://moleculer-demo-project.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/).


## Install
To install use the [moleculer-cli](https://github.com/moleculerjs/moleculer-cli) tool.

```bash
$ moleculer init project my-project
```

## Prompts
```
$ moleculer init project moleculer-demo

Template repo: moleculerjs/moleculer-template-project
? 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
? 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 start`: Start production mode (set `SERVICES` env variable to load certain services)
- `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 ci`: Run continuous test mode with watching
- `npm test`: 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)
Loading