├── toolchain.png ├── docs ├── acme-vid.png ├── actions.png ├── save-api.png ├── sharing.png ├── summary.png ├── create-api.png ├── deploy-env.png ├── run-stage.png ├── toolchains.png ├── architecture.png ├── create-api-key.png ├── endpoint-modal.png ├── configure-deploy.png └── apic-erp-images │ ├── try-it.png │ ├── apic-edit.png │ ├── npm-start.png │ ├── start-app.png │ └── npm-install.png ├── acme-architecture.png ├── Notice.txt ├── .bluemix ├── create_toolchain_button.png ├── erp-api.pipeline.yml ├── webui.pipeline.yml ├── recommendation.pipeline.yml ├── controller.pipeline.yml ├── deploy.json └── toolchain.yml ├── CONTRIBUTING.md ├── TOOLCHAIN-README-ko.md ├── WALKTHROUGH-ko.md ├── TOOLCHAIN-README.md ├── APIC-ERP-README-ko.md ├── README-cn.md ├── MAINTAINERS.md ├── WALKTHROUGH.md ├── README-ko.md ├── OW-NAPI-README-ko.md ├── APIC-ERP-README.md ├── OW-NAPI-README.md ├── README-pt.md ├── README.md └── LICENSE /toolchain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/acme-freight/master/toolchain.png -------------------------------------------------------------------------------- /docs/acme-vid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/acme-freight/master/docs/acme-vid.png -------------------------------------------------------------------------------- /docs/actions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/acme-freight/master/docs/actions.png -------------------------------------------------------------------------------- /docs/save-api.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/acme-freight/master/docs/save-api.png -------------------------------------------------------------------------------- /docs/sharing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/acme-freight/master/docs/sharing.png -------------------------------------------------------------------------------- /docs/summary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/acme-freight/master/docs/summary.png -------------------------------------------------------------------------------- /docs/create-api.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/acme-freight/master/docs/create-api.png -------------------------------------------------------------------------------- /docs/deploy-env.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/acme-freight/master/docs/deploy-env.png -------------------------------------------------------------------------------- /docs/run-stage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/acme-freight/master/docs/run-stage.png -------------------------------------------------------------------------------- /docs/toolchains.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/acme-freight/master/docs/toolchains.png -------------------------------------------------------------------------------- /acme-architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/acme-freight/master/acme-architecture.png -------------------------------------------------------------------------------- /docs/architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/acme-freight/master/docs/architecture.png -------------------------------------------------------------------------------- /docs/create-api-key.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/acme-freight/master/docs/create-api-key.png -------------------------------------------------------------------------------- /docs/endpoint-modal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/acme-freight/master/docs/endpoint-modal.png -------------------------------------------------------------------------------- /docs/configure-deploy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/acme-freight/master/docs/configure-deploy.png -------------------------------------------------------------------------------- /Notice.txt: -------------------------------------------------------------------------------- 1 | This product includes software originally developed by IBM Corporation 2 | Copyright 2016 IBM Corp. -------------------------------------------------------------------------------- /docs/apic-erp-images/try-it.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/acme-freight/master/docs/apic-erp-images/try-it.png -------------------------------------------------------------------------------- /docs/apic-erp-images/apic-edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/acme-freight/master/docs/apic-erp-images/apic-edit.png -------------------------------------------------------------------------------- /docs/apic-erp-images/npm-start.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/acme-freight/master/docs/apic-erp-images/npm-start.png -------------------------------------------------------------------------------- /docs/apic-erp-images/start-app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/acme-freight/master/docs/apic-erp-images/start-app.png -------------------------------------------------------------------------------- /.bluemix/create_toolchain_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/acme-freight/master/.bluemix/create_toolchain_button.png -------------------------------------------------------------------------------- /docs/apic-erp-images/npm-install.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/acme-freight/master/docs/apic-erp-images/npm-install.png -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | This is an open source project, and we appreciate your help! 4 | 5 | We use the GitHub issue tracker to discuss new features and non-trivial bugs. 6 | 7 | In addition to the issue tracker, [#journeys on 8 | Slack](https://dwopen.slack.com) is the best way to get into contact with the 9 | project's maintainers. 10 | 11 | To contribute code, documentation, or tests, please submit a pull request to 12 | the GitHub repository. Generally, we expect two maintainers to review your pull 13 | request before it is approved for merging. For more details, see the 14 | [MAINTAINERS](MAINTAINERS.md) page. 15 | -------------------------------------------------------------------------------- /.bluemix/erp-api.pipeline.yml: -------------------------------------------------------------------------------- 1 | --- 2 | stages: 3 | - name: BUILD 4 | inputs: 5 | - type: git 6 | branch: ${REPO_BRANCH} 7 | service: ${REPO} 8 | triggers: 9 | - type: commit 10 | jobs: 11 | - name: Build 12 | type: builder 13 | - name: TEST 14 | inputs: 15 | - type: job 16 | stage: BUILD 17 | job: Build 18 | triggers: 19 | - type: stage 20 | properties: 21 | - name: REPO_BRANCH 22 | value: ${REPO_BRANCH} 23 | jobs: 24 | - name: Unit Test 25 | type: tester 26 | script: | 27 | #!/bin/bash 28 | ./.bluemix/pipeline-TEST.sh 29 | - name: DEPLOY 30 | inputs: 31 | - type: job 32 | stage: BUILD 33 | job: Build 34 | triggers: 35 | - type: stage 36 | properties: 37 | - name: REPO_BRANCH 38 | value: ${REPO_BRANCH} 39 | jobs: 40 | - name: Blue/Green Deploy 41 | type: deployer 42 | target: 43 | region_id: ${REGION_ID} 44 | organization: ${ORG_NAME} 45 | space: ${SPACE_NAME} 46 | application: ${CF_APP_NAME} 47 | script: |- 48 | #!/bin/bash 49 | ./.bluemix/pipeline-DEPLOY.sh 50 | -------------------------------------------------------------------------------- /.bluemix/webui.pipeline.yml: -------------------------------------------------------------------------------- 1 | --- 2 | stages: 3 | - name: BUILD 4 | inputs: 5 | - type: git 6 | branch: ${REPO_BRANCH} 7 | service: ${REPO} 8 | triggers: 9 | - type: commit 10 | properties: 11 | - name: REPO_BRANCH 12 | value: ${REPO_BRANCH} 13 | - name: CONTROLLER_SERVICE_APP_NAME 14 | value: ${CONTROLLER_SERVICE_APP_NAME} 15 | type: text 16 | - name: REGION_ID 17 | value: ${REGION_ID} 18 | jobs: 19 | - name: Build 20 | type: builder 21 | artifact_dir: dist 22 | build_type: shell 23 | script: |- 24 | #!/bin/bash 25 | ./.bluemix/pipeline-BUILD.sh 26 | - name: DEPLOY 27 | inputs: 28 | - type: job 29 | stage: BUILD 30 | job: Build 31 | triggers: 32 | - type: stage 33 | properties: 34 | - name: REPO_BRANCH 35 | value: ${REPO_BRANCH} 36 | jobs: 37 | - name: Blue/Green Deploy 38 | type: deployer 39 | target: 40 | region_id: ${REGION_ID} 41 | organization: ${ORG_NAME} 42 | space: ${SPACE_NAME} 43 | application: ${CF_APP_NAME} 44 | script: |- 45 | #!/bin/bash 46 | ./.bluemix/pipeline-DEPLOY.sh 47 | -------------------------------------------------------------------------------- /.bluemix/recommendation.pipeline.yml: -------------------------------------------------------------------------------- 1 | --- 2 | stages: 3 | - name: BUILD 4 | inputs: 5 | - type: git 6 | branch: ${REPO_BRANCH} 7 | service: ${REPO} 8 | triggers: 9 | - type: commit 10 | properties: 11 | - name: REPO_BRANCH 12 | value: ${REPO_BRANCH} 13 | jobs: 14 | - name: Build 15 | type: builder 16 | build_type: shell 17 | script: |- 18 | #!/bin/bash 19 | ./.bluemix/pipeline-BUILD.sh 20 | - name: DEPLOY 21 | inputs: 22 | - type: job 23 | stage: BUILD 24 | job: Build 25 | triggers: 26 | - type: stage 27 | properties: 28 | - name: REPO_BRANCH 29 | value: ${REPO_BRANCH} 30 | - name: PACKAGE_NAME 31 | value: ${PACKAGE_NAME} 32 | type: text 33 | - name: CLOUDANT_DATABASE 34 | value: ${CLOUDANT_DATABASE} 35 | type: text 36 | - name: OPENWHISK_AUTH 37 | value: ${OPENWHISK_AUTH} 38 | type: secure 39 | - name: CONTROLLER_SERVICE_APP_NAME 40 | value: ${CONTROLLER_SERVICE_APP_NAME} 41 | type: text 42 | - name: REGION_ID 43 | value: ${REGION_ID} 44 | jobs: 45 | - name: Deploy 46 | type: deployer 47 | target: 48 | region_id: ${REGION_ID} 49 | organization: ${ORG_NAME} 50 | space: ${SPACE_NAME} 51 | application: "not-used" 52 | script: |- 53 | #!/bin/bash 54 | ./.bluemix/pipeline-DEPLOY.sh 55 | -------------------------------------------------------------------------------- /.bluemix/controller.pipeline.yml: -------------------------------------------------------------------------------- 1 | --- 2 | stages: 3 | - name: TEST 4 | inputs: 5 | - type: git 6 | branch: ${REPO_BRANCH} 7 | service: ${REPO} 8 | triggers: 9 | - type: commit 10 | properties: 11 | - name: REPO_BRANCH 12 | value: ${REPO_BRANCH} 13 | jobs: 14 | - name: Unit Test 15 | type: tester 16 | script: | 17 | #!/bin/bash 18 | ./.bluemix/pipeline-TEST.sh 19 | - name: BUILD 20 | inputs: 21 | - type: git 22 | branch: ${REPO_BRANCH} 23 | service: ${REPO} 24 | triggers: 25 | - type: stage 26 | jobs: 27 | - name: Build 28 | type: builder 29 | - name: DEPLOY 30 | inputs: 31 | - type: job 32 | stage: BUILD 33 | job: Build 34 | triggers: 35 | - type: stage 36 | properties: 37 | - name: REPO_BRANCH 38 | value: ${REPO_BRANCH} 39 | - name: ERP_SERVICE_APP_NAME 40 | value: ${ERP_SERVICE_APP_NAME} 41 | type: text 42 | - name: REGION_ID 43 | value: ${REGION_ID} 44 | - name: RECOMMENDATION_PACKAGE_NAME 45 | value: ${RECOMMENDATION_PACKAGE_NAME} 46 | type: text 47 | - name: OPENWHISK_AUTH 48 | value: ${OPENWHISK_AUTH} 49 | type: secure 50 | jobs: 51 | - name: Blue/Green Deploy 52 | type: deployer 53 | target: 54 | region_id: ${REGION_ID} 55 | organization: ${ORG_NAME} 56 | space: ${SPACE_NAME} 57 | application: ${CF_APP_NAME} 58 | script: |- 59 | #!/bin/bash 60 | ./.bluemix/pipeline-DEPLOY.sh 61 | -------------------------------------------------------------------------------- /TOOLCHAIN-README-ko.md: -------------------------------------------------------------------------------- 1 | ## 나만의 Acme Freight를 DevOps 툴체인으로 Bluemix에 배포하세요 2 | 3 | *다른 언어로 보기: [English](TOOLCHAIN-README.md).* 4 | 5 | 버튼 클릭 한 번으로 여러분은 Acme Freight 인스턴스에 필요한 모든 마이크로서비스와 서버리스 액션을 배포할 수 있습니다. 더불어, 여러분이 Github에 푸쉬하는 변경사항들을 자동으로 배포하도록 사전 설정된 개발 파이프라인 툴체인도 제공됩니다. 이를 통해, Bluemix의 DevOps 환경을 경험하게 되실 것이며, 동시에 Acme Freight 애플리케이션의 기능도 확장할 수 있습니다. 6 | 7 | Acme Freight의 실행 중인 인스턴스를 확인하려면 이 곳에 엑세스하십시오: 8 | [http://acme-freight.mybluemix.net](http://acme-freight.mybluemix.net) 9 | 10 | [![Deploy To Bluemix](./.bluemix/create_toolchain_button.png)](https://console.ng.bluemix.net/devops/setup/deploy?repository=https%3A%2F%2Fgithub.com%2FIBM%2Facme-freight.git&cm_mmc=github-readme--native-_-acme-_-create-toolchain&cm_mmca1=000019RT&cm_mmca2=10004796) 11 | 12 | 시작하려면, Create Toolchain 버튼을 클릭합니다. Bluemix에 로그인합니다. - 아직 계정이 없으시다면, 30일 무료 체험판에 가입합니다. 로그인하면 툴체인을 생성하기 위한 개별 설정을 하기 위한 창이 제공됩니다. 아래 단계를 따라합니다: 13 | 14 | 1. 맨 위에 있는 여러분의 툴체인 이름부터 `acme-freight-toolchain-XXX`같은 식으로 변경합니다. URL 경로는 앱 이름으로 결정된다는 점에 유의하여, 고유한 이름을 고릅니다. 15 | 1. `GitHub` 탭에서 "Track Deployment of Code Changes" 을 선택하면 모든 GitHub 저장소의 코드 변경을 추적합니다. 16 | 1. `Delivery Pipeline` 탭을 클릭하고 17 | * 애플리케이션 이름을 개별 설정합니다. 가령 ERP 앱은 Acme-Freight-ERP라고 입력하는 식으로요. 18 | * OpenWhisk Authorization 키를 검색합니다: https://console.ng.bluemix.net/openwhisk/cli (권한 키 정보는 `네임스페이스 및 권한 키`섹션의 "--auth" 다음에 위치합니다) 19 | * 해당 OpenWhisk Authorization 키를 해당 필드에 복사하여 붙입니다. 20 | 1. `Create`을 클릭합니다 21 | 22 | 23 | 15분 정도면, 마이크로서비스의 배포가 끝나고 여러분은 자신만의 Acme Freight 인스턴스를 엑세스할 수 있습니다. [Bluemix 대시보드](https://console.ng.bluemix.net/dashboard/apps/)로 이동하여 애플리케이션의 상태를 확인하고 엑세스합니다. 24 | 25 | 앱을 확장하거나 변경하려면, 여러분에게 포크된 GitHub 저장소에 변경 사항을 푸쉬합니다. 배포된 툴체인 파이프라인이 알아서 나머지 처리를 완료합니다. 26 | -------------------------------------------------------------------------------- /WALKTHROUGH-ko.md: -------------------------------------------------------------------------------- 1 | # Acme Freight 둘러보기 2 | 3 | *다른 언어로 보기: [English](WALKTHROUGH.md).* 4 | 5 | 이번 편에서는 https://acme-freight.mybluemix.net/ 에 있는 공유 실행 환경을 사용하거나 [툴체인](https://github.com/IBM/acme-freight/blob/master/TOOLCHAIN-README-ko.md)을 사용해 배포된 여러분 자신의 환경을 사용할 수도 있습니다. 6 | 7 | 이제 여러분을 공급망 관리 매니저라고 가정하겠습니다. 여러분은 여러 물류센터, 소매점과 여러 배송 업무를 소유한 세계적 규모의 유통 회사에서 근무하고 있습니다. 8 | 9 | 1. 웹브라우저를 통해 해당 홈페이지로 이동합니다, https://acme-freight.mybluemix.net/ 또는 당신의 *webui* 앱의 url을 활용합니다. 10 | 11 | > webui의 소스 코드는 [여기](https://github.com/ibm/acme-freight-webui)에서 확인하실 수 있습니다. 12 | 13 | 1. 이 홈페이지는 포털 형태로 이번 설명편의 시작점이기도 합니다. 14 | 15 | 1. **LOGIN TO ACME FREIGHT**를 클릭하십시오. 16 | 17 | > 만약 여러분이 실제로 이 회사의 직원이라면 애플리케이션에 로그인할 신임정보가 있겠지만, 이것은 예제이므로 아무런 신임정보가 필요하지 않습니다. 그래서 대신, 여러분이 이 버튼만 클릭하면 임의의 데이터세트로 구성된 독립된 환경을 자동 생성하도록 만들었습니다. 매번 버튼을 클릭하실 때마다 이 환경은 동일합니다. 다른 사용자의 액션에 영향을 받지 않고 마음껏 실행하실 수 있습니다. 18 | 19 | 1. 대시보드에는 현재 진행 중인 배송건이 지도에 표시되어 공급망 매니저가 관련 정보를 한 눈에 파악할 수 있습니다. 20 | 21 | > 물류센터, 소매점, 배송 정보는 [the controller](https://github.com/ibm/acme-freight-controller)를 통해 [ERP 시뮬레이터](https://github.com/ibm/acme-freight-erp)에서 가져온 것입니다. 22 | 23 | 1. 물류센터를 고르면, 해당 물류센터에서 출고되는 배송건을 보여줍니다. 24 | 25 | 1. 소매점을 고르면, 이 지역의 날씨와 입하되는 배송건을 보여줍니다. 26 | 27 | > 기상 정보는 [the recommendation service](https://github.com/ibm/acme-freight-recommendation)에 정의된 OpenWhisk액션을 호출하는 [controller](https://github.com/ibm/acme-freight-controller)를 통해 가져옵니다. 28 | 29 | 1. 배송을 선택하면, 현재 위치와 그 위치의 날씨를 확인할 수 있습니다. 30 | 31 | 1. 자세히보기 창을 닫으십시오. 32 | 33 | 1. 지도에 **Simulate Storm** 버튼이 있습니다. 우리가 날씨를 바꿀 수는 없지만, 시뮬레이션을 통해 해당 기상 정보가 추천 서비스에 입력되면 새로운 배송 추천안이 생성됩니다. 34 | 35 | 1. **Simulate Storm** 버튼을 누릅니다. 36 | 37 | > 버튼을 누르면 [the recommendation service](https://github.com/ibm/acme-freight-recommendation)는 폭풍우라는 이벤트에 맞는 배송 추천안을 생성하는 OpenWhisk 액션을 호출합니다. 38 | 39 | 1. 잠시 기다리면 경고창이 나타나며 지도가 업데이트 되어 폭풍우의 영향권에 해당되는 지역을 보여줍니다. 40 | 41 | 1. 지도에서 폭풍권에 속하는 지역을 선택합니다. 42 | 43 | 1. 폭풍우 정보를 보여주는 패널이 디스플레이됩니다. 기상 조건과 추가적인 배송 추천안을 확인할 수 있습니다. 44 | 45 | 1. 공급망 관리 매니저로서 여러분은 배송 추천안을 선택하거나 거절할 수 있습니다. 46 | 47 | 1. 한 개의 배송안을 승인하고, 다른 것은 거절합니다. 48 | 49 | > 승인과 거절된 2개의 추천 배송안은 [the recommendation service](https://github.com/ibm/acme-freight-recommendation)의 2가지 다른 OpenWhisk 액션입니다. 50 | 51 | 1. 자세히 보기 창에서 추천안이 사라집니다. 52 | -------------------------------------------------------------------------------- /TOOLCHAIN-README.md: -------------------------------------------------------------------------------- 1 | ## Deploy your own Acme Freight on Bluemix with DevOps Toolchain 2 | 3 | *Read this in other languages: [한국어](TOOLCHAIN-README-ko.md).* 4 | 5 | With the click of a button, you can deploy all the microservices and serverless actions required to run your own instance of Acme Freight. In addition, the toolchain comes with a development pipeline configured to automatically deploy any changes you push to GitHub. This is the perfect way to begin exploring the capabilities available on Bluemix and even extending the Acme Freight application. 6 | 7 | Note that if you want to access a running instance of Acme Freight, you can access it here: 8 | [http://acme-freight.mybluemix.net](http://acme-freight.mybluemix.net) 9 | 10 | [![Deploy To Bluemix](./.bluemix/create_toolchain_button.png)](https://console.ng.bluemix.net/devops/setup/deploy?repository=https%3A%2F%2Fgithub.com%2FIBM%2Facme-freight.git&cm_mmc=github-readme--native-_-acme-_-create-toolchain&cm_mmca1=000019RT&cm_mmca2=10004796) 11 | 12 | To get started, click the Create Toolchain button. You'll be asked to login to Bluemix - you can start with a 30 day free trial. Once logged in, you'll be asked to go through some customization options for creating the toolchain. Follow these steps: 13 | 14 | 1. Customize your toolchain name at the top - something like `acme-freight-toolchain-XXX`. Note that the URL routes are determined by the app name, so choose something unique. 15 | 1. In the `GitHub` tab, choose "Track Deployment of Code Changes" for all of the GitHub repos 16 | 1. Click the `Delivery Pipeline` tab 17 | * Customize the names of the applications. For example, Acme-Freight-ERP for the ERP app. 18 | * Retrieve your OpenWhisk Authorization Key: https://console.ng.bluemix.net/openwhisk/cli (note that the authorization key is the bit following "--auth" in the `New Authentication` section) 19 | * Paste that OpenWhisk Authorization Key in the appropriate field 20 | 1. Click `Create` 21 | 22 | 23 | In about 15 minutes, the microservices should finish deploying and you can start accessing your personal Acme Freight instance. Go to the [Bluemix dashboard](https://console.ng.bluemix.net/dashboard/apps/) to see the status of your applications and start accessing them. 24 | 25 | To extend the app or make changes, simply push changes to the GitHub repos that were forked for you. The Toolchain Pipeline that was deployed will take care of the rest. 26 | -------------------------------------------------------------------------------- /APIC-ERP-README-ko.md: -------------------------------------------------------------------------------- 1 | ## ERP LoopBack 앱을 로컬에서 개발하기 2 | 3 | *다른 언어로 보기: [English](APIC-ERP-README.md).* 4 | 5 | ### 이 과정의 준비 사항 6 | 7 | #### Node.js 8 | Node.js는 브라우저가 아닌 환경에서 JavaScript를 실행하는 플랫폼입니다. ERP 레이어는 Node.js 환경에서 APIs를 빠르게 개발하는 LoopBack 프레임워크 기반의 애플리케이션입니다. 9 | 10 | Node.js 설치를 아직 안하셨다면, 여러분의 플랫폼에 맞는 인스톨러를 NodeJS.org에서 검색해 보세요. 11 | 12 | #### API Connect 13 | Node.js에 있는 Node Package Manager를 사용해 API Connect을 설치하겠습니다. 터미널에 아래와 같이 입력합니다: 14 | 15 | `npm install --global apiconnect` 16 | 17 | 이제 여러분의 컴퓨터에 API Connect Node.js 가 설치되는데, 이제는 컴퓨터 내의 어떤 디렉토리에서든지 API Connect을 활용할 수 있게 됩니다. 18 | 19 | ### 로컬 머신에 ERP 코드 가져오기 20 | 21 | 여러분 컴퓨터의 로컬에서 코드를 운영하는 가장 쉬운 방법 두 가지는 git을 사용하여 저장소를 로컬에 복제하거나 또는 단순히 zip 파일을 다운로드 받는 것입니다. 여러분이 만약 저장소를 복제한다면, 업데이트가 있을 때 변경본을 쉽게 가지고 올 수 있습니다. 만약 코드만 다운로드 받는다면, 그 기능은 사용할 수 없습니다. 22 | 23 | 코드를 복제하려면, 터미널에서 이 명령을 실행하십시오: 24 | `git clone https://github.com/IBM/acme-freight-erp.git` 25 | 26 | 코드를 다운로드하려면, 전체 저장소의 zip 아카이브 파일을 받을 수 있는 이 링크를 클릭하십시오: 27 | https://github.com/IBM/acme-freight-erp/archive/dev.zip 28 | 29 | 만약 추가적으로 코드를 수정하여 마스터 프로젝트에 여러분의 수정사항을 반영하고 싶으시다면, Github 계정으로 저장소를 포크(fork)하신 후 그 포크를 복제하십시오. 30 | 31 | ### 로컬머신에서 ERP 코드를 실행하십시오 32 | 33 | 로컬머신에 소스 코드 환경이 갖춰어 졌다면 (이전 단계), 터미널에서 해당 디렉토리로 이동합니다. 우선 실행에 필요한 종속 패키지들(dependencies)을 모두 다운로드합니다. 아래와 같이 타이핑하십시오: 34 | 35 | `npm install` 36 | 37 | 하위 패키지들을 모두 다운로드 받은 후에는 애플리케이션을 실행하실 수 있습니다. 아래와 같이 타이핑하십시오: 38 | 39 | `npm start` 40 | 41 | 여기서 애플리케이션은 인메모리 데이터베이스로 실행됩니다. 앱을 중단하면 그간의 모든 변화가 소실됩니다. 이제 영구적 저장소(persistent storage)를 구성해봅니다. 42 | 43 | 44 | ### 영구적 인메모리 데이터베이스 사용하기 45 | 46 | 아래와 같이 file server/datasources.local.json 를 생성합니다: 47 | ``` 48 | { 49 | "db": { 50 | "name": "db", 51 | "connector": "memory", 52 | "file": "in-memory-database.json" 53 | } 54 | } 55 | ``` 56 | 애플리케이션을 시작합니다: `npm start` 57 | 이제 데이터는 in-memory-database.json에 영구적으로 저장됩니다. 58 | 59 | ## 이제 만든 APIs를 테스트해 봅니다 60 | 61 | ### APIC 툴킷을 실행하십시오 62 | API Connect의 툴킷을 사용하면 비주얼한 환경에서 APIs를 생성, 테스트, 배포할 수 있습니다. 시작하려면, 여러분의 애플리케이션 디렉토리에서 apic edit을 실행하십시오. 처음 실행 시 로그인 창이 나타날 수 있습니다. 기존 Bluemix 계정이 있다면 해당 정보로 로그인하시고, 없으실 경우 Bluemix 계정을 만드십시오. 63 | ``` 64 | apic edit 65 | ``` 66 | 67 | ### 애플리케이션 실행하기 68 | 이제 APIs가 모두 생성되었으니 여러분의 APIs에 엑세스하기 위해 로컬에서 애플리케이션을 실행할 수 있습니다. 왼쪽 아래에 위치한 `Play` 버튼을 클릭하면 애플리케이션이 실행됩니다. 몇 초 안에 애플리케이션과 마이크로게이트웨이가 실행될 것입니다. 애플리케이션이 실제 APIs 환경을 제공한다면, 마이크로게이트웨이는 rate limiting과 같은 API 운영 정책을 시행하고 보안 레이어를 제공합니다. 69 | 70 | ### 나의 APIs 알아보기 71 | 다음으로, 오른쪽 상단에 위치한 Explore 버튼을 클릭하면 Swagger기반 뷰(Open API Spec)로 가용한 APIs를 보여줍니다. 화면 왼쪽에는 여러분이 이전 단계에서 생성한 모델의 운영상황을 확인할 수 있습니다. 72 | 73 | 화면 아래쪽 `Demo.newDemo` operation 으로 이동한 후, `Try it`을 클릭합니다. 그런 다음 `Call Operation`을 클릭합니다. CORS 에러창이 나타는 경우, 링크를 클릭하여 CORS 에러를 무시고, 예외조항을 추가한 후 탭을 닫습니다. 그런 다음, 다시 `Call Operation`을 클릭합니다. 74 | 75 | 사용자 정보와 토큰이 담긴 결과를 확인할 수 있습니다. 새로운 세션을 통해 Acme Freight 샘플이 접근될 때 마다, 토큰이 생성되며 이 정보는 다른 엔트포인트에 접근할 때 필요합니다. 76 | 77 | API Connect 툴킷을 사용하면, 보안과 CRUD를 위한 복잡한 APIs를 생성하는 것 뿐 아니라, 로컬 머신에서 바로 테스트를 해 볼 수 있습니다. Acme Freight 애플리케이션을 확장하실 계획이 있다면, API Connect 기반의 ERP LoopBack 애플리케이션에서 시작하시면 됩니다. 78 | -------------------------------------------------------------------------------- /README-cn.md: -------------------------------------------------------------------------------- 1 | # Acme Freight Code Pattern 2 | 3 | *阅读本文的其他语言版本:[English](README.md)。* 4 | 5 | Acme Freight Shipping 是一家虚构的运输物流公司,它使用 [Logistics Wizard](https://github.com/ibm-bluemix/logistics-wizard) 应用程序框架重塑21世纪的供应链优化系统。 6 | 7 | Acme Freight 使用了一个名为 [Logistic Wizard](https://github.com/ibm-bluemix/logistics-wizard) 的应用程序来管理它的一些资产。该应用程序由若干微服务组成,其中包括 3 个 Cloud Foundry 应用程序和多个 OpenWhisk Actions。 8 | 9 | Acme Freight 使用了开源 Node.js 框架 LoopBack——一个为新的和现有的应用程序和数据快速创建并暴露 API的程序框架。LoopBack 使 Acme Freight 能够创建一个与其现有 ERP 系统集成的应用程序,而API Connect 使他们能够通过托管的 API 暴露数据。 10 | 11 | *有关 Acme Freight Code Pattern及其相关技术的更多信息,请访问 [Acme Freight Code Pattern 网站](http://developer.ibm.com/code/journey/unlock-enterprise-data-using-apis?cm_mmc=github-code-_-native-_-acme-_-journey&cm_mmca1=000019RT&cm_mmca2=10004796)。* 12 | 13 | ## Acme Freight 教程 14 | 15 | 要进一步了解 Acme Freight 及其相关技术,请参考下面列出的教程。 16 | 17 | ### 部署 Acme Freight 18 | * [通过 IBM DevOps Toolchain 部署您自己的 Acme Freight](TOOLCHAIN-README.md) 19 | > [![部署到 IBM Cloud](./.bluemix/create_toolchain_button.png)](https://console.ng.bluemix.net/devops/setup/deploy?repository=https%3A%2F%2Fgithub.com%2FIBM%2Facme-freight.git&cm_mmc=github-readme--native-_-acme-_-create-toolchain&cm_mmca1=000019RT&cm_mmca2=10004796) 20 | 21 | ### 利用 Node API Framework LoopBack 快速创建 API 22 | * [使用 LoopBack 和 API Connect 通过 API 的形式快速暴露 ERP 数据](APIC-ERP-README.md) 23 | 24 | ### 通过几次简单的点击为 OpenWhisk Action创建安全的 API 25 | * [在 IBM Cloud 上为 OpenWhisk Action创建安全的 API](OW-NAPI-README.md) 26 | 27 | ## Acme Freight 概述 28 | 下面的视频将演示 Acme Freight 如何使用 Logistics Wizard 框架(以及 IBM API Connect)提供一个应用程序来帮助它们彻底改善其供应链的敏捷性。 29 | 30 | [![](docs/acme-vid.png)](https://www.youtube.com/watch?v=R1KCrJAXLvA) 31 | 32 | 33 | ## Acme Freight 架构 34 | ![](acme-architecture.png) 35 | 36 | Acme Freight 解决方案中利用了以下项目: 37 | 38 | * [acme-freight-erp](https://github.com/ibm/acme-freight-erp) - 定义了Acme Freight 访问 ERP 系统中的数据所需要的API。它还提供了一种默认实现来用作模拟器。该模拟器是一个连接到 PostgreSQL 数据库的 Node.js 应用程序。它通过自己的 API 来管理用户(供应链经理和零售店经理)、配送中心、零售店和运输路线。 39 | 40 | * [acme-freight-webui](https://github.com/ibm/acme-freight-webui) - 提供一个仪表板来查看正在进行的运输和警报。无需登录或用户凭证即可使用已部署的应用程序。任何试用该应用程序的新用户都会分配一个唯一演示 ID。在每个演示 ID 背后,Acme Freight 都会创建一个隔离环境,其中包含一组默认的业务用户、配送中心、零售店和运输路线。请参阅[演练](WALKTHROUGH.md)了解相关功能。 41 | 42 | * [acme-freight-recommendation](https://github.com/ibm/acme-freight-recommendation) - 根据天气情况来提供运输路线建议。它是一组 IBM Cloud OpenWhisk Actions,用于检索当前天气情况,并根据天气事件来生成新运输路线建议。然后,可以将这些建议转换为实际指令。 43 | 44 | * [acme-freight-controller](https://github.com/ibm/acme-freight-controller) - 充当服务之间交互的主要控制器。它接收来自用户界面的请求,将它们路由到 ERP 或天气推荐模块。 45 | 46 | *Acme Freight 是从 IBM Cloud 项目 Logistics Wizard 复制和扩展而来。请访问 Logistics Wizard 项目 [wiki](https://github.com/IBM-Bluemix/logistics-wizard/wiki),查看原始 Logicistics Wizard 架构和部署策略的细节。* 47 | 48 | 49 | ## 其他参考资源 50 | - [Acme Freight Code Pattern](http://developer.ibm.com/code/journey/unlock-enterprise-data-using-apis?cm_mmc=github-code-_-native-_-acme-_-journey&cm_mmca1=000019RT&cm_mmca2=10004796) 51 | - [通过 LoopBack 解锁企业数据](https://developer.ibm.com/code/2017/05/04/unlock-enterprise-data-with-loopback?cm_mmc=github-code-_-native-_-acme-_-related-content&cm_mmca1=000019RT&cm_mmca2=10004796) 52 | 53 | 54 | ## 许可 55 | 56 | 参阅 [LICENSE](LICENSE) 了解许可信息。 57 | -------------------------------------------------------------------------------- /.bluemix/deploy.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "Acme Freight Delivery Pipeline Setup", 4 | "description": "Deployment of the Acme Freight demo", 5 | "longDescription": "The Delivery Pipeline for DevOps Services allows you to automate your continuous deployment setup. To avoid conflicts, make sure to use unique application names. We recommend to use a common prefix like your name or initials.", 6 | "type": "object", 7 | "properties": { 8 | "selected-region": { 9 | "description": "The Bluemix region", 10 | "type": "string" 11 | }, 12 | "selected-organization": { 13 | "description": "The Bluemix org", 14 | "type": "string" 15 | }, 16 | "selected-space": { 17 | "description": "The Bluemix space", 18 | "type": "string" 19 | }, 20 | "erp-app-name": { 21 | "description": "Name of the ERP API", 22 | "type": "string" 23 | }, 24 | "controller-app-name": { 25 | "description": "Name of the controller app", 26 | "type": "string" 27 | }, 28 | "webui-app-name": { 29 | "description": "Name of the WEBUI App", 30 | "type": "string" 31 | }, 32 | "openwhisk_auth": { 33 | "type": "string" 34 | } 35 | }, 36 | "required": ["selected-region", "selected-organization", "selected-space", "erp-app-name", "controller-app-name", "webui-app-name"], 37 | "form": [ 38 | { 39 | "type": "validator", 40 | "url": "/devops/setup/bm-helper/helper.html" 41 | }, 42 | { 43 | "type": "text", 44 | "readonly": false, 45 | "title": "ERP App Name", 46 | "key": "erp-app-name" 47 | }, 48 | { 49 | "type": "text", 50 | "readonly": false, 51 | "title": "Controller App Name", 52 | "key": "controller-app-name" 53 | }, 54 | { 55 | "type": "text", 56 | "readonly": false, 57 | "title": "Webui App Name", 58 | "key": "webui-app-name" 59 | }, 60 | 61 | { 62 | "type": "table", 63 | "columnCount": 3, 64 | "widths": ["33%", "33%", "33%"], 65 | "items": [ 66 | { 67 | "type": "label", 68 | "title": "Region" 69 | }, 70 | { 71 | "type": "label", 72 | "title": "Organization" 73 | }, 74 | { 75 | "type": "label", 76 | "title": "Space" 77 | }, 78 | { 79 | "type": "select", 80 | "key": "selected-region" 81 | }, 82 | { 83 | "type": "select", 84 | "key": "selected-organization" 85 | }, 86 | { 87 | "type": "select", 88 | "key": "selected-space", 89 | "readonly": false 90 | } 91 | ] 92 | }, 93 | { 94 | "type": "label", 95 | "title": "The recommendation service relies on OpenWhisk actions. To deploy these actions, the pipeline requires your OpenWhisk authorization key. Make sure to enter the authorization key associated with the space where the applications will be deployed." 96 | }, 97 | { 98 | "type": "text", 99 | "readonly": false, 100 | "title": "OpenWhisk Authorization Key", 101 | "key": "openwhisk_auth" 102 | } 103 | ] 104 | } 105 | -------------------------------------------------------------------------------- /MAINTAINERS.md: -------------------------------------------------------------------------------- 1 | # Maintainers Guide 2 | 3 | This guide is intended for maintainers - anybody with commit access to one or 4 | more Code Pattern repositories. 5 | 6 | ## Methodology 7 | 8 | This repository does not have a traditional release management cycle, but 9 | should instead be maintained as a useful, working, and polished reference at 10 | all times. While all work can therefore be focused on the master branch, the 11 | quality of this branch should never be compromised. 12 | 13 | The remainder of this document details how to merge pull requests to the 14 | repositories. 15 | 16 | ## Merge approval 17 | 18 | The project maintainers use LGTM (Looks Good To Me) in comments on the pull 19 | request to indicate acceptance prior to merging. A change requires LGTMs from 20 | two project maintainers. If the code is written by a maintainer, the change 21 | only requires one additional LGTM. 22 | 23 | ## Reviewing Pull Requests 24 | 25 | We recommend reviewing pull requests directly within GitHub. This allows a 26 | public commentary on changes, providing transparency for all users. When 27 | providing feedback be civil, courteous, and kind. Disagreement is fine, so long 28 | as the discourse is carried out politely. If we see a record of uncivil or 29 | abusive comments, we will revoke your commit privileges and invite you to leave 30 | the project. 31 | 32 | During your review, consider the following points: 33 | 34 | ### Does the change have positive impact? 35 | 36 | Some proposed changes may not represent a positive impact to the project. Ask 37 | whether or not the change will make understanding the code easier, or if it 38 | could simply be a personal preference on the part of the author (see 39 | [bikeshedding](https://en.wiktionary.org/wiki/bikeshedding)). 40 | 41 | Pull requests that do not have a clear positive impact should be closed without 42 | merging. 43 | 44 | ### Do the changes make sense? 45 | 46 | If you do not understand what the changes are or what they accomplish, ask the 47 | author for clarification. Ask the author to add comments and/or clarify test 48 | case names to make the intentions clear. 49 | 50 | At times, such clarification will reveal that the author may not be using the 51 | code correctly, or is unaware of features that accommodate their needs. If you 52 | feel this is the case, work up a code sample that would address the pull 53 | request for them, and feel free to close the pull request once they confirm. 54 | 55 | ### Does the change introduce a new feature? 56 | 57 | For any given pull request, ask yourself "is this a new feature?" If so, does 58 | the pull request (or associated issue) contain narrative indicating the need 59 | for the feature? If not, ask them to provide that information. 60 | 61 | Are new unit tests in place that test all new behaviors introduced? If not, do 62 | not merge the feature until they are! Is documentation in place for the new 63 | feature? (See the documentation guidelines). If not do not merge the feature 64 | until it is! Is the feature necessary for general use cases? Try and keep the 65 | scope of any given component narrow. If a proposed feature does not fit that 66 | scope, recommend to the user that they maintain the feature on their own, and 67 | close the request. You may also recommend that they see if the feature gains 68 | traction among other users, and suggest they re-submit when they can show such 69 | support. 70 | -------------------------------------------------------------------------------- /WALKTHROUGH.md: -------------------------------------------------------------------------------- 1 | # Acme Freight Walkthrough 2 | 3 | *Read this in other languages: [한국어](WALKTHROUGH-ko.md).* 4 | 5 | For this walkthrough, you can use the shared deployment available at https://acme-freight.mybluemix.net/ or deploy your own version using [the toolchain](https://github.com/IBM/acme-freight/blob/master/TOOLCHAIN-README.md). 6 | 7 | You are going to play the role of a supply chain manager. You are working with a global retail company with multiple distribution centers, retail stores and a bunch of ongoing shipments. 8 | 9 | 1. Go to the home page of the web user interface, i.e https://acme-freight.mybluemix.net/ or the url of the *webui* app if you deployed your own. 10 | 11 | > The source code for the webui is available [here](https://github.com/ibm/acme-freight-webui). 12 | 13 | 1. The homepage acts mainly as a portal to the app source and a starting point for this walkthrough. 14 | 15 | 1. Click on **View Acme Freight in action**. 16 | 17 | > If you were really working for this company you would have your own set of credentials to log into the application. Here we did not want you to have to think about any credentials. So instead we choose to automatically generate an isolated environment - with its own data set - when you click on this button. The environment will be the same every time you click the button. The benefit is that you can play with the deployment without being impacted by the actions of other users. 18 | 19 | 1. The dashboard shows up. It gives the supply chain manager an overview of ongoing shipments on a map. 20 | 21 | > The distribution centers, retail stores and shipments are retrieved from [the ERP simulator](https://github.com/ibm/acme-freight-erp) by going through [the controller](https://github.com/ibm/acme-freight-controller). 22 | 23 | 1. Select a distribution center. It shows outgoing shipments from this distribution center. 24 | 25 | 1. Select a retail store. It shows incoming shipments and the weather at this location. 26 | 27 | > The weather information is retrieved by going through [the controller](https://github.com/ibm/acme-freight-controller) which in turn calls an OpenWhisk action defined in [the recommendation service](https://github.com/ibm/acme-freight-recommendation). 28 | 29 | 1. Select a shipment. It shows its current location and the current weather for this location. 30 | 31 | 1. Close the detail view. 32 | 33 | 1. You may have noticed the **Simulate Storm** button on the map. We don't control the weather but we can inject into the recommendation service a fabricated event to trigger the generation of new shipment recommendations. 34 | 35 | 1. Press **Simulate Storm**. 36 | 37 | > When you press the button, an OpenWhisk action is called in [the recommendation service](https://github.com/ibm/acme-freight-recommendation) to generate suggested shipments given the storm event. 38 | 39 | 1. After a short while, an alert is displayed, the map is updated and shows the area impacted by the storm. 40 | 41 | 1. Select the storm area on the map. 42 | 43 | 1. The storm information panel is displayed. It shows the weather conditions and the suggested additional shipments. 44 | 45 | 1. As a supply chain manager, you can decide whether to approve or reject the suggested shipments. 46 | 47 | 1. Approve one shipment and reject the other. 48 | 49 | > Approve and reject are two other OpenWhisk actions in [the recommendation service](https://github.com/ibm/acme-freight-recommendation). 50 | 51 | 1. Both recommendations disappear from the details. 52 | -------------------------------------------------------------------------------- /README-ko.md: -------------------------------------------------------------------------------- 1 | # Acme Freight 개발과정 2 | 3 | *다른 언어로 보기: [English](README.md).* 4 | 5 | *Acme Freight社의 개발과정과 그 이면의 기술에 대한 자세한 내용을 알아보시려면 , [Acme Freight pattern 웹사이트](http://developer.ibm.com/code/journey/unlock-enterprise-data-using-apis?cm_mmc=github-code-_-native-_-acme-_-journey&cm_mmca1=000019RT&cm_mmca2=10004796)를 방문하십시오.* 6 | 7 | Acme Freight Shipping은 21세기에 걸맞은 공급망 최적화 시스템 구현을 위해 [Logistics Wizard](https://github.com/ibm-bluemix/logistics-wizard) 애플리케이션 프레임워크를 사용하는 것으로 설정된 가상의 운송물류 회사입니다. 8 | 9 | Acme Freight社는 기업 내 자산 일부를 관리하기 위해 [Logistic Wizard](https://github.com/ibm-bluemix/logistics-wizard) 라고 불리는 애플리케이션을 사용합니다. 이 애플리케이션은 3개의 Cloud Foundry 애플리케이션과 다수의 OpenWhisk 액션을 포함한 여러 마이크로서비스로 구성됩니다. 10 | 11 | Acme Freight는 신규 애플리케이션과 기존 애플리케이션, 데이터를 위한 API를 빠르게 생성하고 노출시키기 위해 개발된 오픈소스 Node.js 프레임워크 LoopBack을 사용합니다. Acme Freight社는 LoopBack을 사용해 기존 ERP시스템과 통합된 애플리케이션을 구축하며, APIC Connect은 관리되는 API를 통해 데이터가 공개되도록 합니다. 12 | 13 | ## Acme Freight 튜토리얼 14 | 15 | Acme Freight社와 그 이면의 기술에 관해 더 알아보시려면 아래 튜토리얼 중 하나로 이동하십시오. 16 | 17 | ### Acme Freight 배포하기 18 | * [IBM DevOps Toolchain으로 여러분 소유의 Acme Freight환경을 배포합니다.](TOOLCHAIN-README-ko.md) 19 | > [![Deploy To Bluemix](./.bluemix/create_toolchain_button.png)](https://console.ng.bluemix.net/devops/setup/deploy?repository=https%3A%2F%2Fgithub.com%2FIBM%2Facme-freight.git&cm_mmc=github-readme--native-_-acme-_-create-toolchain&cm_mmca1=000019RT&cm_mmca2=10004796) 20 | 21 | ### Node API 프레임워크 LoopBack으로 빠르게 API 생성하기 22 | * [ERP 데이터를 LoopBack과 API Connect를 사용하여 빠르게 API로 노출시킵니다.](APIC-ERP-README-ko.md) 23 | 24 | ### 단 몇 번의 클릭으로 OpenWhisk 액션을 위한 보안성 높은 API 생성하기 25 | * [Bluemix에서 OpenWhisk 액션을 위한 보안성 높은 API를 생성합니다.](OW-NAPI-README-ko.md) 26 | 27 | ## Acme Freight 개요 28 | 아래 비디오에서는 Acme Freight Shipping이 IBM API Connect와 Logistics Wizard 프레임워크를 사용하여 자사 공급망을 혁신적으로 민첩(agile)하게 변화시키는 애플리케이션을 어떻게 개발하였는지를 보여줍니다. 29 | 30 | [![](docs/acme-vid.png)](https://www.youtube.com/watch?v=R1KCrJAXLvA) 31 | 32 | 33 | ## Acme Freight 아키텍처 34 | ![](acme-architecture.png) 35 | 36 | Acme Freight 전반적인 솔루션에서 활용되는 프로젝트는 다음과 같습니다. 37 | 38 | * [acme-freight-erp](https://github.com/ibm/acme-freight-erp) - Acme Freight社가 사용하는 API를 정의하고 ERP 시스템에서 데이터에 접근합니다. EPR 시스템을 시뮬레이터 형태로 구현한 것이라고 보면 됩니다. 즉, 이 시뮬레이터는 PostgreSQL 데이터베이스에 연결된 Node.js 애플리케이션 형태입니다. 시뮬레이터 내 API를 통해 사용자 (공급망 관리자와 소매점 관리자), 물류센터, 소매점, 출고를 관리합니다. 39 | 40 | * [acme-freight-webui](https://github.com/ibm/acme-freight-webui) - 진행중인 배송과 알림을 볼 수 있는 대시보드를 제공합니다. 배포된 애플리케이션 사용을 위한 로그인이나 사용자 자격증명을 요구하지 않는 대신, 해당 애플리케이션을 사용하려는 모든 신규 사용자에게 고유 데모 ID를 할당합니다. Acme Freight社는 각 데모 ID에 대해 기본적으로 비즈니스 사용자, 물류센터, 소매점, 배송에 대한 독립 환경을 제공합니다. 기능을 둘러보시려면 [walkthrough](WALKTHROUGH-ko.md) 를 참조하십시오. 41 | 42 | * [acme-freight-recommendation](https://github.com/ibm/acme-freight-recommendation) - 날씨 상태에 따라 배송에 대한 추천을 합니다. 현재 기상조건을 검색하고 날씨에 따라 신규 배송 필요를 추천하는 등의 과정을 수행하는 Bluemix OpenWhisk 세트입니다. 추천은 실제 지시로 전환될 수 있습니다. 43 | 44 | * [acme-freight-controller](https://github.com/ibm/acme-freight-controller) - 서비스 간 상호작용을 위한 주컨트롤러 역할을 합니다. 사용자 인터페이스로부터 요청을 받고 ERP나 날씨 추천 모듈로 요청을 전송합니다. 45 | 46 | *Acme Freight는 IBM Bluemix 프로젝트인 Logistics Wizard에서 파생되어 확장된 것입니다. 기존 Logicistics Wizard 아키텍처와 배포에 대한 상세한 내용은 Logistics Wizard 프로젝트 [wiki](https://github.com/IBM-Bluemix/logistics-wizard/wiki) 를 참조하십시오.* 47 | 48 | 49 | ## 리소스 50 | - [• Acme Freight 개발과정](http://developer.ibm.com/code/journey/unlock-enterprise-data-using-apis?cm_mmc=github-code-_-native-_-acme-_-journey&cm_mmca1=000019RT&cm_mmca2=10004796) 51 | - [• LoopBack으로 기업 데이터 안전하게 노출시키기](https://developer.ibm.com/code/2017/05/04/unlock-enterprise-data-with-loopback?cm_mmc=github-code-_-native-_-acme-_-related-content&cm_mmca1=000019RT&cm_mmca2=10004796) 52 | 53 | 54 | ## 라이센스 55 | 56 | 라이센스 정보를 보시려면 [LICENSE](LICENSE) 를 참조하십시오. 57 | -------------------------------------------------------------------------------- /OW-NAPI-README-ko.md: -------------------------------------------------------------------------------- 1 | ## Bluemix에서 OpenWhisk 액션을 위한 보안된 APIs 생성하기 2 | 3 | *다른 언어로 보기: [English](OW-NAPI-README.md).* 4 | 5 | ### Bluemix에서 OpenWhisk 액션을 위한 API 생성하기 6 | 7 | [툴체인 인스톨하기](TOOLCHAIN-README.md)를 마치면, 툴체인을 생성할 때 선택했던 bluemix 상의 region(지역) 및 space(공간)에 OpenWhisk 액션들이 배포됩니다. [Bluemix 상 OpenWhisk 대시보드](https://console.ng.bluemix.net/openwhisk/manage/actions)에서 해당 내용을 확인하실 수 있습니다. 폭풍우가 발생하는 상황의 시물레이션이 실행 될 때 마다, OpenWhisk 액션들이 실행되어, 필요한 조치에 대한 추천을 하게 됩니다. 8 | 9 | OpenWhisk actions 10 | 11 | #### API와 엔드포인트 생성하기 12 | 13 | API의 일부로 OpenWhisk액션을 노출시키기 위해서는, Bluemix OpenWhisk 인터페이스 상단 (또는 좌측 메뉴)에 위치한 API 링크를 클릭해야 합니다. 그리고서는 Create an OpenWhisk API 버튼을 클릭하십시오. 14 | 15 | 1. 생성하고자 하는 API 이름을 입력하세요. 저는 `Acme Freight OpenWhisk API`로 하겠습니다. 16 | 17 | 2. Create Operation 버튼을 클릭하여 여러분의 엔트포인트를 생성합니다. 18 | 19 | 각각의 OpenWhisk액션에 상응하도록 엔드포인트 이름을 지정하십시오. Verb 입력란에 `POST` 를 선택하세요. 아래 예를 참조하십시오: 20 | 21 | Create operation endpoints 22 | 23 | OpenWhisk액션마다 상응하는 엔드포인트를 만드시려면, 위의 단계를 반복하십시오. 24 | 25 | 여러분이 만든 페이지는 아래의 이미지와 유사할 것입니다: 26 | 27 | API create 28 | 29 | 화면 아래쪽으로 이동합니다. 30 | 31 | - "Require ... via API key" 옵션을 선택합니다; 관련된 다른 값들 (Method, Location of API key and secrete 등)은 기본값을 그대로 사용합니다. 32 | - "Method" 부분은 "API key only"로 선택되어 있는지 확인합니다. 33 | - "Enable CORS..." 옵션도 선택되어 있는지 확인합니다. 34 | - Save 버튼을 클릭합니다. 35 | 36 | API save 37 | 38 | #### API 키 생성하기 39 | 40 | 엔드포인트에 엑세스하기 위한 API 키를 생성하려면, 아래 화면의 왼쪽에 위치한 "Sharing" 링크를 클릭합니다: 41 | 42 | Sharing 43 | 44 | 이 화면에서 "Create API Key" 버튼을 클릭합니다. 45 | 46 | Create API Key 화면에서 아래 항목들을 실행합니다: 47 | 48 | - API key에 이름을 지정합니다 49 | - 여러분의 API key를 기록해 둡니다 50 | - "Create"를 클릭합니다: 51 | 52 | Create API Key 53 | 54 | 마지막으로 필요한 것은 여러분이 생성한 APIs로 전체 경로 정보인데, 이는 Summary 페이지에서(아래 화면의 'Route'부분) 확인하실 수 있습니다. 다음 단계를 위해서 이를 저장합니다. 55 | 56 | Summary 57 | 58 | ### Configure the controller application to use your newly created secure API endpoints 59 | 60 | 이제 보안이 적용된 엔드포인트 (secured endpoint)를 생성하였으니, OpenWhisk액션을 호출할 Acme Freight 마이크로서비스 쪽을 변경할 차례입니다. 컨트롤러 애플리케이션에는 보안이 적용된 엔트포인트를 호출하는 코드가 이미 있습니다; 단순히 애플리케이션이 보안이 적용된 해당 API URL과 API 키를 사용하도록 설정하면 됩니다. 61 | 62 | _Note: 컨트롤러가 사용하는 백엔드 서비스 정보를 업데이트할 때는 환경설정(environment configuration)을 사용하는 것이 가장 좋습니다. 컨트롤러 코드가 보안이 적용된 API를 엑세스하기 위해 API URL과 API 키가 제공되었는 지를 확인하고 호출시 사용합니다. [코드 보기](https://github.com/IBM/acme-freight-controller/blob/dev/server/utils.py#L76)_ 63 | 64 | [Bluemix DevOps toolchains](https://console.ng.bluemix.net/devops/toolchains) 으로 가서 Acme Freight로 생성한 툴체인을 클릭합니다. 그러면 아래와 같은 화면이 보이는데, `controller` 파이프라인을 위해서는 `Deliver` 밑의 사각형을 클릭하십시오: 65 | 66 | Toolchains 67 | 68 | 그런 다음, `Deploy` 단계의 파이프라인은 `Configure Stage`옵션을 클릭하십시오: 69 | 70 | Configure Deploy 71 | 72 | Under the `Environment Properties` 탭 아래, `OW_API_KEY`와 `OW_API_URL`라는 두 개의 `Text Property` 필드를 추가합니다. 대소문자가 구별된다는 것에 유의하세요. 다른 필드는 그대로 둡니다. 아래 화면을 참조하십시오: 73 | 74 | Deploy environment 75 | 76 | save 버튼을 클릭하고 파이프라인으로 돌아가서 `Run Stage` 버튼을 클릭하십시오: 77 | 78 | Run stage 79 | 80 | 몇 번의 클릭만으로 Acme Freight 애플리케이션은 보안이 적용된 OpenWhisk액션에 엑세스됩니다! OpenWhisk액션에 보안을 적용함에 따른 장점은 다음과 같습니다.: 81 | - 안전한 rate-limit 세팅 (호출 빈도 제한)을 통해 당신의 OpenWhisk 액션을 향한 악성 스팸으로부터 애플리케이션을 보호하게 됩니다. 82 | - Acme Freight가 아닌 다른 애플리케이션에서도 호출이 가능하도록, 여러분의 OpenWhisk 엔드포인트가 공개되는데, 접근이 필요한 애플리케이션 별, API 접근을 위한 키를 생성하면, 여러분의 API가 어떻게 활용되는지 추적 및 관리가 가능하며, 필요시 접근에 대한 권한을 해지할 수도 있습니다. 83 | - 분석 뷰(analytics view)를 활용하여 여러분의 APIs가 얼마나 자주 호출되는지와 실행되는데 얼마나 시간이 걸리는지 알수 있습니다. 모니터링을 통해 성능 지원의 이슈가 있는 APIs를 알아낼 수 있습니다. 84 | -------------------------------------------------------------------------------- /.bluemix/toolchain.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: "Cloud-native Toolchain for the Acme Freight sample" 3 | description: "With this cloud-native toolchain, you use the acme freight template to create a supply chain management web app and back end that consists of multiple microservices: a Controller API, an ERP API, and a WEB-UI. The toolchain is preconfigured for continuous delivery, source control, blue-green deployment, unit testing, and issue tracking.\n\nTo get started, click **Create**." 4 | required: 5 | - deploy 6 | 7 | # Github repos 8 | erp-api-repo: 9 | service_id: githubpublic 10 | parameters: 11 | repo_name: "acme-freight-erp" 12 | repo_url: "https://github.com/IBM/acme-freight-erp" 13 | type: clone 14 | has_issues: true 15 | 16 | controller-repo: 17 | service_id: githubpublic 18 | parameters: 19 | repo_name: "acme-freight-controller" 20 | repo_url: "https://github.com/IBM/acme-freight-controller" 21 | type: clone 22 | has_issues: true 23 | 24 | webui-repo: 25 | service_id: githubpublic 26 | parameters: 27 | repo_name: "acme-freight-webui" 28 | repo_url: "https://github.com/IBM/acme-freight-webui" 29 | type: clone 30 | has_issues: true 31 | 32 | recommendation-repo: 33 | service_id: githubpublic 34 | parameters: 35 | repo_name: "acme-freight-recommendation" 36 | repo_url: "https://github.com/IBM/acme-freight-recommendation" 37 | type: clone 38 | has_issues: true 39 | 40 | erp-api-build: 41 | service_id: pipeline 42 | parameters: 43 | name: "erp" 44 | configuration: 45 | content: $file(erp-api.pipeline.yml) 46 | env: 47 | REPO: "erp-api-repo" 48 | REPO_BRANCH: "master" 49 | CF_APP_NAME: "{{deploy.parameters.erp-app-name}}" 50 | SPACE_NAME: "{{deploy.parameters.selected-space}}" 51 | ORG_NAME: "{{deploy.parameters.selected-organization}}" 52 | REGION_ID: "{{deploy.parameters.selected-region}}" 53 | execute: true 54 | services: ["erp-api-repo"] 55 | hidden: [form, description] 56 | 57 | controller-build: 58 | service_id: pipeline 59 | parameters: 60 | name: "controller" 61 | configuration: 62 | content: $file(controller.pipeline.yml) 63 | env: 64 | REPO: "controller-repo" 65 | REPO_BRANCH: "master" 66 | ERP_SERVICE_APP_NAME: "{{deploy.parameters.erp-app-name}}" 67 | CF_APP_NAME: "{{deploy.parameters.controller-app-name}}" 68 | SPACE_NAME: "{{deploy.parameters.selected-space}}" 69 | ORG_NAME: "{{deploy.parameters.selected-organization}}" 70 | REGION_ID: "{{deploy.parameters.selected-region}}" 71 | OPENWHISK_AUTH: "{{deploy.parameters.openwhisk_auth}}" 72 | RECOMMENDATION_PACKAGE_NAME: "lwr" 73 | execute: true 74 | services: ["controller-repo"] 75 | hidden: [form, description] 76 | 77 | webui-build: 78 | service_id: pipeline 79 | parameters: 80 | name: "webui" 81 | configuration: 82 | content: $file(webui.pipeline.yml) 83 | env: 84 | REPO: "webui-repo" 85 | REPO_BRANCH: "master" 86 | CONTROLLER_SERVICE_APP_NAME: "{{deploy.parameters.controller-app-name}}" 87 | CF_APP_NAME: "{{deploy.parameters.webui-app-name}}" 88 | SPACE_NAME: "{{deploy.parameters.selected-space}}" 89 | ORG_NAME: "{{deploy.parameters.selected-organization}}" 90 | REGION_ID: "{{deploy.parameters.selected-region}}" 91 | execute: true 92 | services: ["webui-repo"] 93 | hidden: [form, description] 94 | 95 | recommendation-build: 96 | service_id: pipeline 97 | parameters: 98 | name: "recommendation" 99 | configuration: 100 | content: $file(recommendation.pipeline.yml) 101 | env: 102 | CONTROLLER_SERVICE_APP_NAME: "{{deploy.parameters.controller-app-name}}" 103 | REPO: "recommendation-repo" 104 | REPO_BRANCH: "master" 105 | OPENWHISK_AUTH: "{{deploy.parameters.openwhisk_auth}}" 106 | PACKAGE_NAME: "lwr" 107 | CLOUDANT_DATABASE: "recommendations" 108 | SPACE_NAME: "{{deploy.parameters.selected-space}}" 109 | ORG_NAME: "{{deploy.parameters.selected-organization}}" 110 | REGION_ID: "{{deploy.parameters.selected-region}}" 111 | execute: true 112 | services: ["recommendation-repo"] 113 | hidden: [form, description] 114 | 115 | #Web IDE 116 | webide: 117 | service_id: orion 118 | 119 | #Deployment 120 | deploy: 121 | schema: 122 | $ref: deploy.json 123 | service-category: pipeline 124 | parameters: 125 | selected-region: "{{region}}" 126 | selected-organization: "{{organization}}" 127 | selected-space: "{{space}}" 128 | erp-app-name: "{{name}}-erp" 129 | controller-app-name: "{{name}}-controller" 130 | webui-app-name: "{{name}}-webui" 131 | openwhisk_auth: 132 | -------------------------------------------------------------------------------- /APIC-ERP-README.md: -------------------------------------------------------------------------------- 1 | ## Local Development of ERP LoopBack app 2 | 3 | *Read this in other languages: [한국어](APIC-ERP-README-ko.md).* 4 | 5 | ### Prerequisites 6 | 7 | #### Node.js 8 | Node.js is a platform to run JavaScript outside of the browser. The ERP layer is a LoopBack application, which is a framework to rapidly build APIs in Node.js. 9 | 10 | If you do not have Node.js installed, you can find the installer for your platform at NodeJS.org. 11 | 12 | #### API Connect 13 | Included with Node.js is the Node Package Manager, which we will use to install API Connect. In your terminal, type: 14 | 15 | `npm install --global apiconnect` 16 | 17 | npm install 18 | 19 | This will install the API Connect Node.js package globally to your machine so you can work with API Connect in any local directory. 20 | 21 | ### Get the ERP code on your local machine 22 | 23 | The two easiest ways to run the code locally on your computer is to either use git to clone the repository locally or to simply download a zip file. If you clone the repository, you can pull updates as they become available. If you only download the code, you lose that ability. 24 | 25 | To clone the code, simple run this command in your terminal: 26 | `git clone https://github.com/IBM/acme-freight-erp.git` 27 | 28 | To download the code, click this link to obtain a zip archive of the entire repository: 29 | https://github.com/IBM/acme-freight-erp/archive/dev.zip 30 | 31 | If you were interested in editing the code and contributing your changes upstream to the master project, you could fork the repository to your Github user account and then clone your fork. 32 | 33 | ### Run the ERP code on your local machine 34 | 35 | Once you have the code on your local machine (previous step), go into that directory in your terminal. The first thing needed is to download all the project's dependencies. You can do so by typing: 36 | 37 | `npm install` 38 | 39 | Once you have your dependencies downloaded, you can run the appliation by typing: 40 | 41 | `npm start` 42 | 43 | npm start 44 | 45 | At that point the application runs with an in-memory database. You lose all changes when you stop the app. Let's configure a persistent storage. 46 | 47 | ### Using a persistent in-memory database 48 | 49 | Create the file server/datasources.local.json with the following content: 50 | ``` 51 | { 52 | "db": { 53 | "name": "db", 54 | "connector": "memory", 55 | "file": "in-memory-database.json" 56 | } 57 | } 58 | ``` 59 | Start the application: `npm start` 60 | The data is now persisted in in-memory-database.json. 61 | 62 | ## Testing and Exploring your APIs 63 | 64 | ### Launch the APIC toolkit 65 | API Connect comes with a toolkit that allows you to visually create, test and deploy APIs. To launch it, simply run apic edit from the directory of your application. 66 | The first time you open it, it may ask you to log-in. If you have a Bluemix account, you can use it to log-in. Otherwise, make an account on Bluemix. 67 | ``` 68 | apic edit 69 | ``` 70 | 71 | apic edit 72 | 73 | 74 | ### Start the application 75 | Since the APIs have already been created, you can start the application locally to access your APIs. Click the `Play` button on the bottom left to start your application. In a few seconds the application and microgateway will start. While the application serves the actual APIs, the microgateway provides a security layer and the capability to enforce custom API policies, like rate limiting. 76 | 77 | start app 78 | 79 | ### Explore your APIs 80 | Next, hit the Explore button on the top right which launches a Swagger-based view (Open API Spec) of the APIs that are available. Along the left side, you should see a number of operations with the model that you created in the previous step. Let's try calling one of these operations. 81 | 82 | Scroll down to the `Demo.newDemo` operation and click `Try it`. Then hit `Call Operation`. You might see a notification indicating a CORS error. Override the CORS error by clicking the link, adding the exception, and then closing the tab. Then retry the `Call Operation`. 83 | 84 | call operation 85 | 86 | You should see a response with some user information and a GUID. This GUID is represents the session that is generated everytime the Acme Freight sample is accessed. The GUID is then used to obtain an access token (`Demo.loginAs`) which allows access to the other endpoints. 87 | 88 | Using the API Connect toolkit, you can not only create complex APIs for security and CRUD but also test them directly on your local machine. If you want to extend the Acme Freight application, the ERP LoopBack application powered by API Connect is the perfect place to begin. 89 | -------------------------------------------------------------------------------- /OW-NAPI-README.md: -------------------------------------------------------------------------------- 1 | ## Create secured APIs for your IBM Cloud Functions 2 | 3 | *Read this in other languages: [한국어](OW-NAPI-README-ko.md).* 4 | 5 | ### Creating an API for your IBM Cloud Functions 6 | 7 | Once the [toolchain is installed](TOOLCHAIN-README.md), a set of Cloud Function actions will get deployed to the region and space you chose when creating the toolchain. You can view them in the [Cloud Functions dashboard](https://cloud.ibm.com/openwhisk/manage/actions). Whenever a storm is simulated, the Cloud Function actions are utilized to generate recommendations. 8 | 9 | Cloud Function actions 10 | 11 | #### Create API and Endpoints 12 | 13 | To expose these Cloud Function actions as a part of an API, we need to click the APIs link near the top of the IBM Cloud Functions interface. And then click on the Create an Cloud Functions API button. 14 | 15 | 1. Create a name for your API. I chose `Acme Freight Cloud Functions API` 16 | 17 | 2. Click Create Operation button to begin adding your endpoints. 18 | 19 | Name each endpoint to correspond with each Cloud Function action. Choose `POST` as your Verb. Below is an example: 20 | 21 | Create operation endpoints 22 | 23 | Repeat above to make an endpoint corresponding with each Cloud Function action. 24 | 25 | Your resulting page should look like the image below: 26 | 27 | API create 28 | 29 | Scroll down 30 | 31 | - Enable the "Require ... via API key" option; default options are suitable. 32 | - Ensure the "Method" is "API key only" 33 | - Make sure "Enable CORS..." option is checked 34 | - Click Save button 35 | 36 | API save 37 | 38 | #### Create API Key 39 | 40 | To create an API key, which is required to access the endpoints, click the "Sharing" link on the left of your screen shown below: 41 | 42 | Sharing 43 | 44 | From this screen, click the "Create API Key" button. 45 | 46 | In the Create API Key screen, do the following: 47 | 48 | - Name your API key 49 | - Take note of your API key 50 | - Click "Create": 51 | 52 | Create API Key 53 | 54 | The last thing you'll need is the full path to your APIs, which you can find on the summary page (shown below as your 'Route'). Take a note of this as well for the next step. 55 | 56 | Summary 57 | 58 | ### Configure the controller application to use your newly created secure API endpoints 59 | 60 | Now that we've created the secure endpoints, we need to update the Acme Freight microservice that calls the Cloud Function actions. The controller application already has the code to call a secured endpoint; we simply need to tell the application your secured API URL and API key that you created earlier. 61 | 62 | _Note: Using environment configuration is the best practice for updating the backend services that the controller needs. To access the secured API, the controller code checks if an API URL and API key are provided and uses them for requests. [See the code](https://github.com/IBM/acme-freight-controller/blob/dev/server/utils.py#L76)_ 63 | 64 | Jump to your [IBM Cloud DevOps toolchains](https://cloud.ibm.com/devops/toolchains) and click the toolchain you created for Acme Freight. You should then see the following screen, click on the square under `Deliver` for the `controller` pipeline: 65 | 66 | Toolchains 67 | 68 | Then click the `Configure Stage` option for the `Deploy` step of the pipeline: 69 | 70 | Configure Deploy 71 | 72 | Under the `Environment Properties` tab, add two additional `Text Property` fields for `OW_API_KEY` and `OW_API_URL`. Note that it is case sensitive. Leave the other fields as-is. It should look like this: 73 | 74 | Deploy environment 75 | 76 | Then hit save, go back to the pipeline and hit the `Run Stage` button: 77 | 78 | Run stage 79 | 80 | With just those few clicks, the Acme Freight application is now accessing secured Cloud Function actions! Here are some of the advantages to securing our Cloud Function actions: 81 | - Set a safe rate-limit setting to protect your application (and your credit card) from malicious spamming against your Cloud Function actions. 82 | - Reveal your Cloud Function endpoints to other consumer applications, not just Acme Freight. By creating API keys for each application that needs access to these APIs, you can individually track and manage consumers and even revoke access if ever necessary. 83 | - Utilize the analytics view to see how often your APIs are being called and how long they take to fulfill. This enables you to track down latency issues as they arise. 84 | -------------------------------------------------------------------------------- /README-pt.md: -------------------------------------------------------------------------------- 1 | # A Jornada da Acme Freight 2 | 3 | *Ler em outros idiomas: [한국어](README-ko.md).* 4 | 5 | A Acme Freight Shipping é uma empresa de remessa e logística fictícia que usa a estrutura do aplicativo [Logistics Wizard](https://github.com/ibm-bluemix/logistics-wizard) para reimaginar sistemas de otimização da cadeia de suprimento para o século XXI. 6 | 7 | A Acme Freight utiliza um aplicativo, chamado [Logistic Wizard](https://github.com/ibm-bluemix/logistics-wizard), para gerenciar alguns dos seus ativos. O aplicativo é composto por diversos microsserviços, incluindo três aplicativos do Cloud Foundry e várias ações do OpenWhisk. 8 | 9 | A Acme Freight usa o LoopBack, uma estrutura Node.js de software livre desenvolvida para criar e expor rapidamente APIs para aplicativos e dados novos e existentes. Com o LoopBack, a Acme Freight pode criar um aplicativo que se integre ao sistema existente de ERP, enquanto o API Connect permite a exposição de dados por uma API gerenciada. 10 | 11 | *Para saber mais sobre a jornada da Acme Freight e as tecnologias por trás dela, [acesse o website da jornada da Acme Freight](http://developer.ibm.com/code/journey/unlock-enterprise-data-using-apis?cm_mmc=github-code-_-native-_-acme-_-journey&cm_mmca1=000019RT&cm_mmca2=10004796).* 12 | 13 | ## Tutoriais da Acme Freight 14 | 15 | Para começar a saber mais sobre a Acme Freight e a tecnologia por trás dela, escolha um dos tutoriais abaixo. 16 | 17 | ### Implementar a Acme Freight 18 | 19 | * [Implemente sua própria Acme Freight com a cadeia de ferramentas do IBM DevOps](TOOLCHAIN-README.md) 20 | > [![Deploy To Bluemix](./.bluemix/create_toolchain_button.png)](https://console.ng.bluemix.net/devops/setup/deploy?repository=https%3A%2F%2Fgithub.com%2FIBM%2Facme-freight.git&cm_mmc=github-readme--native-_-acme-_-create-toolchain&cm_mmca1=000019RT&cm_mmca2=10004796) 21 | 22 | ### Crie APIs rapidamente com a estrutura de API do nó, LoopBack 23 | * [Use LoopBack e API Connect para expor dados de ERP rapidamente com APIs](APIC-ERP-README.md) 24 | 25 | ### Crie APIs protegidas para ações do OpenWhisk em poucos cliques 26 | * [Crie APIs protegidas para ações do OpenWhisk no Bluemix](OW-NAPI-README.md) 27 | 28 | ## Visão geral da Acme Freight 29 | O vídeo abaixo demonstra como a Acme Freight Shipping usou a estrutura do Logistics Wizard, junto com o IBM API Connect, para oferecer um aplicativo que permitisse revolucionar a agilidade da cadeia de suprimento. 30 | 31 | [![](docs/acme-vid.png)](https://www.youtube.com/watch?v=R1KCrJAXLvA) 32 | 33 | ## Arquitetura da Acme Freight 34 | ![](acme-architecture.png) 35 | 36 | Os projetos a seguir são aproveitados na solução geral da Acme Freight: 37 | 38 | * [acme-freight-erp](https://github.com/ibm/acme-freight-erp) - define a API usada pela Acme Freight para acessar dados de um sistema de ERP. Também oferece uma implementação padrão para usar como simulador. O simulador é um aplicativo Node.js conectado a um banco de dados PostgreSQL. Por meio da sua API, gerencia usuários (gerentes de cadeia de suprimento e gerentes de lojas de varejo), centros de distribuição, lojas de varejo e remessas. 39 | 40 | * [acme-freight-webui](https://github.com/ibm/acme-freight-webui) - oferece um painel para visualizar remessas e alertas em andamento. Não existem credenciais de login ou do usuário propriamente ditas para utilizar os aplicativos implementados. Em vez disso, um ID de demonstração exclusivo é atribuído a qualquer usuário novo que esteja experimentando o aplicativo. Atrás de cada ID de demonstração, a Acme Freight cria um ambiente isolado com um conjunto padrão de usuários corporativos, centros de distribuição, lojas de varejo e remessas. Consulte o [passo a passo](WALKTHROUGH.md) para fazer um tour pelos recursos. 41 | 42 | * [acme-freight-recommendation](https://github.com/ibm/acme-freight-recommendation) - faz recomendações sobre as remessas com base nas condições meteorológicas. Trata-se de uma configuração do Bluemix OpenWhisk para recuperar as condições meteorológicas atuais e, considerando um evento climático, gerar novas recomendações sobre as remessas. Em seguida, essas recomendações podem ser transformadas em pedidos reais. 43 | 44 | * [acme-freight-controller](https://github.com/ibm/acme-freight-controller) - funciona como o principal controlador para a interação entre os serviços. Recebe solicitações da interface com o usuário e as encaminha para o ERP ou para o módulo de recomendações meteorológicas. 45 | 46 | *A Acme Freight é bifurcada e estendida a partir do projeto IBM Bluemix, chamado de Logistics Wizard. Visite a [wiki](https://github.com/IBM-Bluemix/logistics-wizard/wiki) do projeto Logistics Wizard para encontrar uma análise detalhada da arquitetura e da estratégia de implementação originais do Logicistics Wizard.* 47 | 48 | ## Recursos 49 | - [A Jornada da Acme Freight](http://developer.ibm.com/code/journey/unlock-enterprise-data-using-apis?cm_mmc=github-code-_-native-_-acme-_-journey&cm_mmca1=000019RT&cm_mmca2=10004796) 50 | - [Liberte dados corporativos com o LoopBack](https://developer.ibm.com/code/2017/05/04/unlock-enterprise-data-with-loopback?cm_mmc=github-code-_-native-_-acme-_-related-content&cm_mmca1=000019RT&cm_mmca2=10004796) 51 | ## Licença 52 | 53 | Consulte [LICENÇA](LICENÇA) para obter informações sobre a licença. 54 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # The Acme Freight Pattern 2 | 3 | *Read this in other languages: [한국어](README-ko.md)、[中国](README-cn.md).* 4 | 5 | *For more on the Acme Freight pattern and the technologies behind it, [visit the Acme Freight pattern website](http://developer.ibm.com/code/journey/unlock-enterprise-data-using-apis?cm_mmc=github-code-_-native-_-acme-_-journey&cm_mmca1=000019RT&cm_mmca2=10004796).* 6 | 7 | Acme Freight Shipping is a fictional shipping and logistics company using the [Logistics Wizard](https://github.com/ibm-bluemix/logistics-wizard) application framework to reimagine supply chain optimization systems for the 21st century. 8 | 9 | Acme Freight uses an application, called [Logistic Wizard](https://github.com/ibm-bluemix/logistics-wizard) to manage some of its assets. The application is composed of several microservices, including three Cloud Foundry applications and multiple Cloud Function actions. 10 | 11 | Acme Freight uses LoopBack, an open source Node.js framework, built for quickly creating and exposing APIs for new and existing applications and data. LoopBack enables Acme Freight to create an application that integrates with their existing ERP system, and API Connect allows them to expose data via a managed API. 12 | 13 | ## Acme Freight Tutorials 14 | 15 | To start learning more about Acme Freight and the technology behind it, jump to one of the tutorials below. 16 | 17 | ### Deploy Acme Freight 18 | * [Deploy your own Acme Freight with IBM DevOps Toolchain](TOOLCHAIN-README.md) 19 | > [![Deploy To Bluemix](./.bluemix/create_toolchain_button.png)](https://console.ng.bluemix.net/devops/setup/deploy?repository=https%3A%2F%2Fgithub.com%2FIBM%2Facme-freight.git&cm_mmc=github-readme--native-_-acme-_-create-toolchain&cm_mmca1=000019RT&cm_mmca2=10004796) 20 | 21 | ### Rapidly Create APIs with the Node API Framework, LoopBack 22 | * [Use LoopBack and API Connect to rapidly expose ERP data with APIs](APIC-ERP-README.md) 23 | 24 | ### Create secured APIs for Cloud Function actions in just a few clicks 25 | * [Create secured APIs for your Cloud Function actions on Bluemix](OW-NAPI-README.md) 26 | 27 | ## Acme Freight Overview 28 | The video below demonstates how Acme Freight Shipping used the Logistics Wizard framework, along with IBM API Connect, to deliver an application allowing them to revolutionize the agility of their supply chain. 29 | 30 | [![](docs/acme-vid.png)](https://www.youtube.com/watch?v=R1KCrJAXLvA) 31 | 32 | 33 | ## Acme Freight Architecture 34 | ![](acme-architecture.png) 35 | 36 | The following projects are leveraged in the overall Acme Freight solution: 37 | 38 | * [acme-freight-erp](https://github.com/ibm/acme-freight-erp) - defines the API used by Acme Freight to access data from an ERP system. It also provides a default implementation to be used as a simulator. The simulator is a Node.js application connected to a PostgreSQL database. Through its API, it manages users (supply chain managers and retail store managers), distribution centers, retail stores and shipments. 39 | 40 | * [acme-freight-webui](https://github.com/ibm/acme-freight-webui) - provides a dashboard to view ongoing shipments and alerts. There is no log-in or user credentials per se to use the deployed applications. Instead a unique demo ID is assigned to any new user trying the application. Behind each demo ID, Acme Freight creates an isolated environment with a default set of business users, distribution centers, retail stores, shipments. Refer to the [walkthrough](WALKTHROUGH.md) to get a tour of the capabilities. 41 | 42 | * [acme-freight-recommendation](https://github.com/ibm/acme-freight-recommendation) - makes shipment recommendations based on weather conditions. It is a set of IBM Cloud Functions to retrieve current weather conditions and given a weather event to generate new shipment recommendations. These recommendations could then be turned into real orders. 43 | 44 | * [acme-freight-controller](https://github.com/ibm/acme-freight-controller) - acts as the main controller for interaction between the services. It receives requests from the user interface and routes them to the ERP or the weather recommendation module. 45 | 46 | *Acme Freight is forked and extended from the IBM Bluemix project, Logistics Wizard. Visit the Logistics Wizard project [wiki](https://github.com/IBM-Bluemix/logistics-wizard/wiki) for a detailed breakdown of the original Logicistics Wizard architecture and deployment strategy.* 47 | 48 | 49 | ## Resources 50 | - [The Acme Freight pattern](http://developer.ibm.com/code/journey/unlock-enterprise-data-using-apis?cm_mmc=github-code-_-native-_-acme-_-journey&cm_mmca1=000019RT&cm_mmca2=10004796) 51 | - [Unlock Enterprise Data with LoopBack](https://developer.ibm.com/code/2017/05/04/unlock-enterprise-data-with-loopback?cm_mmc=github-code-_-native-_-acme-_-related-content&cm_mmca1=000019RT&cm_mmca2=10004796) 52 | 53 | 54 | ## License 55 | 56 | This code pattern is licensed under the Apache Software License, Version 2. Separate third party code objects invoked within this code pattern are licensed by their respective providers pursuant to their own separate licenses. Contributions are subject to the [Developer Certificate of Origin, Version 1.1](https://developercertificate.org/) and the [Apache License, Version 2](https://www.apache.org/licenses/LICENSE-2.0.txt). 57 | 58 | [Apache License FAQ](https://www.apache.org/foundation/license-faq.html#WhatDoesItMEAN) 59 | 60 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | --------------------------------------------------------------------------------