Coder Social home page Coder Social logo

cjbtokyo / system-runtime Goto Github PK

View Code? Open in Web Editor NEW

This project forked from design-first/system-runtime

0.0 0.0 0.0 10.06 MB

A JavaScript library that runs systems

Home Page: https://designfirst.io/systemruntime/

License: Apache License 2.0

JavaScript 100.00%

system-runtime's Introduction

System Runtime

Build Status Coverage Status devDependency Status

What is System Runtime ?

OSGi for JavaScript

System Runtime can bundle the model, components and methods of your application into a JSON object. This bundle can be then installed and started in a client or server application.

In fact, System Runtime can create, install and start bundles like in OSGi.

How works System Runtime ?

System Runtime executes your bundles client and server side.

Create a bundle

Use System Runtime APIs to create your application:

// create an app
let app = runtime.system('app');

// add code in the start method
app.on('start', function start() {
    console.log('Hello world !');
});

// run the app
app.start();

Now you can bundle your application into a JSON object:

// create a bundle
runtime.bundle();

It will return this JSON:

{
  "_id": "154cd18d0210516",
  "name": "app",
  "description": "",
  "version": "0.0.1",
  "schemas": {},
  "models": {},
  "types": {},
  "behaviors": {
    "1ea9c1d5f811ae1": {
      "_id": "1ea9c1d5f811ae1",
      "component": "154cd18d0210516",
      "state": "start",
      "action": "function start() {\n    console.log('Hello world !');\n}",
      "useCoreAPI": false,
      "core": false
    }
  },
  "components": {}
}

Install the bundle in HTML

Just add a link tag in your HTML to install and start your bundle:

<!-- install your bundle -->
<link rel="system" type="application/json" href="app.json">

Install the bundle in Node.js

Like in OSGi, just call install API to install and start your bundle:

// require System Runtime
let runtime = require('system-runtime');

// install your bundle 
runtime.install('app.json');

What contains System Runtime ?

A metamodel

System Runtime contains a metamodel to help you to design your model. The definition of the model is made on a JSON format called MSON, no code is needed.

With MSON you can define types, classes, one to one / one to many relationships and multi inheritance between classes.

MSON is based on UML, so learning it is very easy.

A component factory

System Runtime uses the Model-Driven Architecture approach to create classes based on your design. Use them to instantiate your components.

A NoSQL Database

System Runtime acts as an ODM (Object-Document Mapper) to manage your components as NoSQL Documents.

System Runtime has a micro NoSQL Database that stores your components and you can export/import them into another System Runtime NoSQL Database.

Thanks to System Runtime NoSQL Database, you can compose your model with an another one.

A workflow engine

System Runtime checks at runtime if the signatures of invoked methods are compliant with your model.

With System Runtime your components really behave the way you designed them.

Documentation

Community

Do not use System Runtime if you do not believe in Equality and Diversity.

System Runtime is not for people of hate.

License

Copyright 2017 Erwan Carriou

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

system-runtime's People

Contributors

ecarriou avatar gitter-badger avatar warpdesign avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.