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

feat(bpmn-service): added sample project for bpmn-service #159

Merged
merged 3 commits into from
Apr 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ The current catalog consists of the following services:
* [notification-service](services/notification-service)
* [scheduler-service](services/scheduler-service)
* [video-conferencing-service](services/video-conferencing-service)
* [bpmn-service](services/bpmn-service)

This repository also contains a set of example projects in the [sandbox](sandbox) directory.

* [auth-multitenant-example](sandbox/auth-multitenant-example)
* [notification-socket-example](sandbox/notification-socket-example)
* [workflow-helloworld](sandbox/workflow-helloworld)

## Table of Contents

Expand Down
7 changes: 2 additions & 5 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
module.exports = {
extends: [
'@commitlint/config-conventional',
'@commitlint/config-lerna-scopes',
],
extends: ['@commitlint/config-conventional'],
rules: {
'header-max-length': [2, 'always', 100],
'body-leading-blank': [2, 'always'],
'footer-leading-blank': [0, 'always'],
'references-empty': [2, 'never'],
'references-empty': [1, 'never'],
},
parserPreset: {
parserOpts: {
Expand Down
57 changes: 56 additions & 1 deletion sandbox/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,68 @@ services:
depends_on:
- postgres

workflow-helloworld:
image: sourceloop/workflow-helloworld
build:
context: ./workflow-helloworld
dockerfile: Dockerfile
args:
- WORKFLOW_MIGRATION_SKIP=true
- WORKFLOW_MIGRATION_COPY=true
ports:
- "3031:3000"
networks:
- sandbox
environment:
NODE_ENV: dev
LOG_LEVEL: debug
DB_HOST: postgres
DB_PORT: 5432
DB_USER: ${POSTGRES_USER:-postgres}
DB_PASSWORD: ${POSTGRES_PASSWORD:-changeme}
DB_DATABASE: workflow_db
DB_SCHEMA: main
CAMUNDA_URL: http://camunda:8080/engine-rest
depends_on:
- postgres
- camunda
- postgres_orchestrator

workflow-migration:
image: sourceloop/workflow-helloworld:latest
command: ["npm", "run", "migrate"]
environment:
NODE_ENV: dev
LOG_LEVEL: debug
DB_HOST: postgres
DB_PORT: 5432
DB_USER: ${POSTGRES_USER:-postgres}
DB_PASSWORD: ${POSTGRES_PASSWORD:-changeme}
DB_DATABASE: workflow_db
DB_SCHEMA: main
depends_on:
- postgres
- postgres_orchestrator
networks:
- sandbox
restart: on-failure

redis:
image: "redis:alpine"
ports:
- "6379:6379"
networks:
- sandbox

camunda:
container_name: camunda_engine
image: camunda/camunda-bpm-platform:run-latest
ports:
- "8080:8080"
networks:
- sandbox
restart: unless-stopped

postgres:
container_name: postgres_container
image: postgres
Expand Down Expand Up @@ -104,7 +159,7 @@ services:
- sandbox
depends_on:
- postgres
command: bash -c "export PGPASSWORD=${POSTGRES_PASSWORD:-changeme} && psql -U ${POSTGRES_USER:-postgres} -d postgres -h postgres -c 'create database authentication_db' && psql -U ${POSTGRES_USER:-postgres} -d postgres -h postgres -c 'create database notification_db'"
command: bash -c "export PGPASSWORD=${POSTGRES_PASSWORD:-changeme} && psql -U ${POSTGRES_USER:-postgres} -d postgres -h postgres -c 'create database authentication_db' && psql -U ${POSTGRES_USER:-postgres} -d postgres -h postgres -c 'create database notification_db' && psql -U ${POSTGRES_USER:-postgres} -d postgres -h postgres -c 'create database workflow_db'"


pgadmin:
Expand Down
6 changes: 6 additions & 0 deletions sandbox/workflow-ms-example/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
npm-debug.log
/dist
# Cache used by TypeScript's incremental build
*.tsbuildinfo
.env
5 changes: 5 additions & 0 deletions sandbox/workflow-ms-example/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules/
dist/
coverage/
.eslintrc.js
migrations/
8 changes: 8 additions & 0 deletions sandbox/workflow-ms-example/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
extends: '@loopback/eslint-config',
rules: {
'no-extra-boolean-cast': 'off',
'@typescript-eslint/interface-name-prefix': 'off',
'no-prototype-builtins': 'off',
},
};
64 changes: 64 additions & 0 deletions sandbox/workflow-ms-example/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# 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

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

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

# Dependency directories
node_modules/
jspm_packages/

# Typescript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# Transpiled JavaScript files from Typescript
/dist

# Cache used by TypeScript's incremental build
*.tsbuildinfo
5 changes: 5 additions & 0 deletions sandbox/workflow-ms-example/.mocharc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"exit": true,
"recursive": true,
"require": "source-map-support/register"
}
2 changes: 2 additions & 0 deletions sandbox/workflow-ms-example/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
package-lock=true
scripts-prepend-node-path=true
2 changes: 2 additions & 0 deletions sandbox/workflow-ms-example/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist
*.json
7 changes: 7 additions & 0 deletions sandbox/workflow-ms-example/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"bracketSpacing": false,
"singleQuote": true,
"printWidth": 80,
"trailingComma": "all",
"arrowParens": "avoid"
}
49 changes: 49 additions & 0 deletions sandbox/workflow-ms-example/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"skipFiles": [
"<node_internals>/**"
],
"program": "${workspaceFolder}/dist/index.js",
},
{
"type": "node",
"request": "launch",
"name": "Run Mocha tests",
"program": "${workspaceRoot}/node_modules/mocha/bin/_mocha",
"runtimeArgs": [
"-r",
"${workspaceRoot}/node_modules/source-map-support/register"
],
"cwd": "${workspaceRoot}",
"autoAttachChildProcesses": true,
"args": [
"--config",
"${workspaceRoot}/.mocharc.json",
"${workspaceRoot}/dist/__tests__/**/*.js",
"-t",
"0"
]
},
{
"type": "node",
"request": "launch",
"name": "App Bundle Service Debug",
"program": "${workspaceFolder}/dist/index.js",
"cwd": "${workspaceFolder}",
"outFiles": [
"${workspaceFolder}/dist/**/*.js"
],
"runtimeArgs": [
"--preserve-symlinks",
"--preserve-symlinks-main"
],
"protocol": "inspector",
"sourceMaps": true,
"autoAttachChildProcesses": true
},
]
}
32 changes: 32 additions & 0 deletions sandbox/workflow-ms-example/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"editor.rulers": [80],
"editor.tabCompletion": "on",
"editor.tabSize": 2,
"editor.trimAutoWhitespace": true,
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true,
"source.fixAll.eslint": true
},

"files.exclude": {
"**/.DS_Store": true,
"**/.git": true,
"**/.hg": true,
"**/.svn": true,
"**/CVS": true,
"dist": true,
},
"files.insertFinalNewline": true,
"files.trimTrailingWhitespace": true,

"typescript.tsdk": "./node_modules/typescript/lib",
"typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": false,
"typescript.preferences.quoteStyle": "single",
"eslint.run": "onSave",
"eslint.nodePath": "./node_modules",
"eslint.validate": [
"javascript",
"typescript"
]
}
29 changes: 29 additions & 0 deletions sandbox/workflow-ms-example/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Watch and Compile Project",
"type": "shell",
"command": "npm",
"args": ["--silent", "run", "build:watch"],
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": "$tsc-watch"
},
{
"label": "Build, Test and Lint",
"type": "shell",
"command": "npm",
"args": ["--silent", "run", "test:dev"],
"group": {
"kind": "test",
"isDefault": true
},
"problemMatcher": ["$tsc", "$eslint-compact", "$eslint-stylish"]
}
]
}
6 changes: 6 additions & 0 deletions sandbox/workflow-ms-example/.yo-rc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"@loopback/cli": {
"packageManager": "npm",
"version": "2.18.0"
}
}
36 changes: 36 additions & 0 deletions sandbox/workflow-ms-example/DEVELOPING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Developer's Guide

We use Visual Studio Code for developing LoopBack and recommend the same to our
users.

## VSCode setup

Install the following extensions:

- [eslint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
- [prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)

## Development workflow

### Visual Studio Code

1. Start the build task (Cmd+Shift+B) to run TypeScript compiler in the
background, watching and recompiling files as you change them. Compilation
errors will be shown in the VSCode's "PROBLEMS" window.

2. Execute "Run Rest Task" from the Command Palette (Cmd+Shift+P) to re-run the
test suite and lint the code for both programming and style errors. Linting
errors will be shown in VSCode's "PROBLEMS" window. Failed tests are printed
to terminal output only.

### Other editors/IDEs

1. Open a new terminal window/tab and start the continuous build process via
`npm run build:watch`. It will run TypeScript compiler in watch mode,
recompiling files as you change them. Any compilation errors will be printed
to the terminal.

2. In your main terminal window/tab, run `npm run test:dev` to re-run the test
suite and lint the code for both programming and style errors. You should run
this command manually whenever you have new changes to test. Test failures
and linter errors will be printed to the terminal.
Loading