{"id":19079304,"url":"https://github.com/covesa/iot-event-analytics","last_synced_at":"2025-04-30T05:42:23.440Z","repository":{"id":46575631,"uuid":"343409808","full_name":"COVESA/iot-event-analytics","owner":"COVESA","description":"IoT Event Analytics is a complex event processing and agent network platform","archived":false,"fork":false,"pushed_at":"2021-10-22T07:07:45.000Z","size":2593,"stargazers_count":26,"open_issues_count":10,"forks_count":14,"subscribers_count":11,"default_branch":"develop","last_synced_at":"2025-04-30T05:41:39.610Z","etag":null,"topics":["iot-platform"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/COVESA.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-03-01T12:32:40.000Z","updated_at":"2024-02-25T20:29:08.000Z","dependencies_parsed_at":"2022-09-19T10:11:47.927Z","dependency_job_id":null,"html_url":"https://github.com/COVESA/iot-event-analytics","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/COVESA%2Fiot-event-analytics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/COVESA%2Fiot-event-analytics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/COVESA%2Fiot-event-analytics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/COVESA%2Fiot-event-analytics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/COVESA","download_url":"https://codeload.github.com/COVESA/iot-event-analytics/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251651221,"owners_count":21621702,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["iot-platform"],"created_at":"2024-11-09T02:14:12.914Z","updated_at":"2025-04-30T05:42:23.412Z","avatar_url":"https://github.com/COVESA.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!---\n  Copyright (c) 2021 Bosch.IO GmbH\n\n  This Source Code Form is subject to the terms of the Mozilla Public\n  License, v. 2.0. If a copy of the MPL was not distributed with this\n  file, You can obtain one at https://mozilla.org/MPL/2.0/.\n\n  SPDX-License-Identifier: MPL-2.0\n--\u003e\n\n# IoT Event Analytics\n\n[![Gitter](https://badges.gitter.im/iot-event-analytics/community.svg)](https://gitter.im/iot-event-analytics/community)\n[![License](https://img.shields.io/badge/License-MPL%202.0-blue.svg)](https://opensource.org/licenses/MPL-2.0)\n[![Unit tests](https://github.com/GENIVI/iot-event-analytics/actions/workflows/test_js_sdk.yml/badge.svg)](https://github.com/GENIVI/iot-event-analytics/actions/workflows/test_js_sdk.yml)\n[![Integration test](https://github.com/GENIVI/iot-event-analytics/actions/workflows/run_integration_test.yml/badge.svg)](https://github.com/GENIVI/iot-event-analytics/actions/workflows/run_integration_test.yml)\n[![C++ SDK](https://github.com/GENIVI/iot-event-analytics/actions/workflows/build_and_test_cpp_sdk.yml/badge.svg)](https://github.com/GENIVI/iot-event-analytics/actions/workflows/build_and_test_cpp_sdk.yml)\n\n(c) Bosch.IO GmbH\nunder [MPL-2.0 licence](https://choosealicense.com/licenses/mpl-2.0/)\n\n## Introduction\n\nIoT Event Analytics, is a complex and freely scalable event processing and agent network platform. The platform is basically build around so called __Talents__ which form a distributed network. Each talent is a unit of work and can interact with other Talents via events. The platform itself orchestrates the flow of events and offers additional services, like an in-memory digital twin, calculation of statistical data based on given event histories and complex rule evaluation of when to inform a Talent, that something happened, that the Talent \"is interested in\".\nThus, a talent is always an event consumer and may also be an event producer. The event-driven business logic can be implemented using one of our SDKs for JavaScript, Python or C++.\nThere are more features which can be explored using various examples for the different SDKs.\n\n## Prerequisites\n\n### NodeJS\n\n- Install Node.js \u003e=12.13.0\n- Install all dependencies using yarn package manager\n  - If yarn is not available on your system, install it using `npm install -g yarn`\n    - Please make sure, you use the latest version of yarn\n  - Run `yarn` in the project root\n\n### Python\n\n- If using Anaconda to manage your Python environments, create a new one\n  - `conda create --name \u003cname-of-choice\u003e python=3.7`\n    - Python needs to be at at version \u003e=3.6.8\n    - Pick a name of choice\n  - `conda activate \u003cname-of-choice\u003e`\n- Install all necessary packages using `pip install -r requirements.dev.txt` in the project root\n\n### SDKs\n\n- Download or Build\n  - Run `yarn sdk.get` to download the most recent prebuilt SDK releases from GitHub __without__ needing to build them from scratch. You can continue with the installation. You will find the downloaded artifacts in their respective folder _./src/sdk/(javascript,python,vscode)/lib_\n  - JS SDK _(mandatory)_\n    - Run `yarn sdk.build` in the project root\n  - Python SDK _(optional)_\n    - See [README.md](./src/sdk/python/README.md)\n  - VSCode Extension _(optional, mandatory for tldr section)_\n    - Open _./src/sdk/vscode_ in your terminal\n    - Run `yarn package`\n- Manual Installation\n  - JS SDK\n    - Run `yarn add file:*.tgz`\n  - Python SDK\n    - See [README.md](./src/sdk/python/README.md)\n  - VSCode Extension\n    - Directly install the *.vsix file\n\n## tldr - get it running - asap\n\n- __IMPORTANT__ The steps in the prerequisites section above need to be done in order to quickly getting started\n- Install the latest IoT Event Analytics VSCode extension from _src/sdk/vscode/lib/*.vsix_\n- Use `Ctrl + Shift + P` to bring up the command palette and select _**Bosch IoT Event Analytics: Create new JavaScript Talent project**_ in an empty folder.\n  - Follow the instructions to create a \"ready to use\" Talent project\n- Bring the command palette up again and run _**Bosch IoT Event Analytics: Start platform using docker-compose**_.\u003cbr\u003eSelect the generated _.env_ file in the folder, which contains your newly created talent project.\n- Run your talent using NodeJS by simple run `node index.js` in your newly created talent project.\n- Send events to the platform by using the command _**Bosch IoT Event Analytics: Publish an MQTT Message**_\n- __Done__\n\n## Project structure\n\n```code\nsrc\n| |- core      The platform itself\n| |- sdk       The platform software development kits\n| |- adapter   Integrations of other systems\n|- resources   JSON schemas for object validations\nL- docs        Documentation\n```\n\n## Build and Run\n\nThe recommended way of quickstarting the platform is to use docker-compose where available. If not installed, all components can be built and run manually using the given build instructions under _./docker/README.md_ and _./docker/*/README.md_\nFor further information how to start the platform using docker-compose see [here](./docker-compose/README.md)\n\n## Run an example/your own Talent on your machine (within the project)\n\n- Simply create your first python or NodeJS talent following the examples given in _src/sdk/(javascript|python|cpp)/examples_\u003cbr\u003e\n- Start your talent by connecting it to `mqtt://localhost:1883`\u003cbr\u003e\n- There are examples, which start a platform instance by themselves. They only need an MQTT Broker running. To achieve this, simply run from within the _./docker-compose_ directory\u003cbr\u003e\n`docker-compose -f docker-compose.mosquitto.yml up`\n\n## Run an example/your own Talent on your machine (Using the JavaScript SDK)\n\n- Create a new directory for your Talent\n- Copy `src/sdk/javascript/lib/boschio.iotea-\u003cversion\u003e.tgz` into this directory\n- Run `npm init` to initialize your NodeJS project\n- Install the SDK by typing `yarn add boschio.iotea-\u003cversion\u003e.tgz`\n  - If you have problems with the installation behind a proxy try the following:\n\n    ```text\n    npm config set proxy ${HTTP_PROXY}\n    npm config set https-proxy ${HTTPS_PROXY}\n    npm config set strict-ssl false -g\n    npm config set maxsockets 5 -g\n    ```\n\n- Create an _index.js_ file with the following contents\n\n  ```javascript\n  const iotea = require('boschio.iotea');\n\n  const Logger = iotea.util.Logger;\n  process.env.LOG_LEVEL = Logger.ENV_LOG_LEVEL.INFO;\n\n  const {\n      MqttProtocolAdapter\n  } = iotea.util;\n\n  const {\n      Talent,\n      OpConstraint,\n      Rule,\n      AndRules,\n      ProtocolGateway,\n      TalentInput\n  } = iotea;\n\n  const {\n      VALUE_TYPE_RAW\n  } = iotea.constants;\n\n  class MyTalent extends Talent {\n      constructor(protocolGatewayConfig) {\n          super('some-unique-talent-id', protocolGatewayConfig);\n      }\n\n      getRules() {\n          return new AndRules([\n              new Rule(new OpConstraint('anyfeature', OpConstraint.OPS.ISSET,  null, 'anytype', VALUE_TYPE_RAW))\n          ]);\n      }\n\n      async onEvent(ev, evtctx) {\n          this.logger.info(`${TalentInput.getRawValue(ev)}`, evtctx);\n      }\n  }\n\n  // Update mqttAdapterConfig.config.brokerUrl, if you specified a different one in your configuration !!!\n  const mqttAdapterConfig = MqttProtocolAdapter.createDefaultConfiguration();\n\n  new MyTalent(\n      ProtocolGateway.createDefaultConfiguration([ mqttAdapterConfig ])\n  ).start();\n  ```\n\n- Run `node index.js` to start the test talent.\n\n## Dependencies\n\n- List all NodeJS dependencies on stdout `yarn licenses list`\n- List all Python dependencies on stdout `pip-licenses --from=mixed`\n  - To have a correct list of packages containing all subpackages needed by this project, make sure that you used a \"fresh\" environment of conda, where you install the dependencies using `pip install -r requirements.dev.txt`. Otherwise pip will list all packages you have installed in your environment.\n\n## Yarn Scripts\n\n- The jsdoc of iot-event-analytics APIs will be generated in `docs/jsdoc` folder after running `yarn` or `yarn docs.generate`\n- To run the unit tests, use `yarn test`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcovesa%2Fiot-event-analytics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcovesa%2Fiot-event-analytics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcovesa%2Fiot-event-analytics/lists"}