@coaty/core
TypeScript icon, indicating that this package has built-in type declarations

2.4.1 • Public • Published

Coaty Framework - JavaScript

Powered by Coaty 2 License: MIT release npm version

Using the Coaty [koʊti] framework as a middleware, you can build distributed applications out of decentrally organized application components, so called Coaty agents, which are loosely coupled and communicate with each other in (soft) real-time. The main focus is on IoT prosumer scenarios where smart agents act in an autonomous, collaborative, and ad-hoc fashion. Coaty agents can run on IoT devices, mobile devices, in microservices, cloud or backend services.

The Coaty framework provides a production-ready application and communication layer foundation for building collaborative IoT applications in an easy-to-use yet powerful and efficient way. The key properties of the framework include:

  • a lightweight and modular object-oriented software architecture favoring a resource-oriented and declarative programming style,
  • standardized event based communication patterns on top of an open publish-subscribe messaging protocol such as MQTT or WAMP,
  • a platform-agnostic, extensible object model to discover, distribute, share, query, and persist hierarchically typed data, and
  • rule based, context driven routing of IoT (sensor) data using smart backpressure strategies.

Coaty supports interoperable framework implementations for multiple platforms. The Coaty JS package provides the cross-platform implementation targeted at JavaScript/TypeScript, running as mobile or web apps in the browser, or as Node.js services.

Coaty JS comes with complete API documentation, a developer guide, a coding style guide, best-practice examples, and additional extensions.

Learn how to use

If you are new to Coaty or would like to learn more, we recommend reviewing the framework documentation of the coaty-js project. This documentation includes:

Coaty JS also includes a set of fully documented code examples that demonstrate best practices and typical usage patterns.

Coaty JS also includes a ready-to-use template for a Coaty agent running in Node.js and programmed in TypeScript. Copy and use it as a blueprint for your own Coaty agent projects.

Coaty JS is also accompanied by a set of additional extensions to the core framework supplied in separate projects on github. Extensions, such as connectors, adapters, or building blocks, provide reusable functionality for specialized use cases and application scenarios build on top of the Coaty core.

Finally, the integration tests delivered with the framework itself also provide a valuable source of programming examples for experienced developers.

Note that the framework makes heavy use of the Reactive Programming paradigm using RxJS observables. Understanding observables is an indispensable prerequisite for developing applications with the framework. An introduction to Reactive Programming can be found here. Examples and explanations can be found on the RxJS and Learn RxJS websites.

If you are new to TypeScript programming, we recommend to take a look at the official TypeScript website. Its "Playground" is especially useful to interactively try some TypeScript code in your browser.

To program Coaty applications, we recommend to use Visual Studio Code, a free, open source IDE that runs everywhere. Install the VS Code extension "TSLint" to enable TypeScript linting within the IDE.

Getting started

To build and run Coaty agents with the Coaty JS technology stack you need to install the Node.js JavaScript runtime (version 8 or higher) globally on your target machine. Download and installation details can be found here.

The framework uses the package dependency manager npm to download dependent libraries. npm comes with Node.js so you need to install it first.

Installing the framework

Coaty JS includes a standard distribution package that targets Coaty agents using ECMAScript version es5 and module format commonjs. It can be used to develop Node.js services and browser or Cordova apps bundled with Webpack, Browserify, or any other commonjs-compatible bundler. This package should be used to develop web and mobile apps using e.g. Angular or Ionic.

You can install the latest standard distribution package in your agent project as follows:

npm install @coaty/core

Note: The distribution package defines several optional dependency modules, including pg, cordova-sqlite-storage, and sqlite3. You need to install any such optional dependency as a package dependency in your application project if you intend to make use of the associated functionality. For example, if you want to make use of the framework's Unified Storage API by persisting objects in a PostgreSQL database, you have to install the pg module.

As need arises, more non-standard distribution packages will be made available, e.g. to target ECMAScript versions ES6 or later. If you need such a package, please contact one of the project maintainers.

Contributing

If you like Coaty, please consider ★ starring the project on github. Contributions to the Coaty framework are welcome and appreciated. Please follow the recommended practice described in CONTRIBUTING.md. This document also contains detailed information on how to build, test, and release the framework.

License

Code and documentation copyright 2018 Siemens AG.

Code is licensed under the MIT License.

Documentation is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Credits

Last but certainly not least, a big Thank You! to the folks who helped to implement Coaty JS and make it even better:

Package Sidebar

Install

npm i @coaty/core

Homepage

coaty.io

Weekly Downloads

3

Version

2.4.1

License

MIT

Unpacked Size

1.25 MB

Total Files

184

Last publish

Collaborators

  • lukasz-zet
  • markus_sag
  • coaty-001