Giter Site home page Giter Site logo

andresilveirah / jsrulez Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 2.15 MB

A simple rule processor written in Javascript using React as view layer

Home Page: http://codebikeandmore.com/jsrulez

License: MIT License

HTML 9.65% CSS 5.54% JavaScript 84.81%
flow-engine javascript rule-processor react jest es6 es6-javascript jest-tests ci yarn

jsrulez's Introduction

JS Rulez Build Status

A simple rule processor written in Javascript using React as view layer.

Challenge description

The challenge is to create a simple flow engine.

A flow engine is an application that executes a flow consisting of several linked rules, in this case against some incoming data (a JSON string that can be parsed to a JavaScript object literal).

Each rule should contain (at least)

  • An ID (unique within the flow, required)
  • A rule that will be run against the incoming JSON data. This is a function that takes a parameter and returns a boolean result. Each function should be called with the same incoming data (the JS object literal)
  • An ID of the rule to execute if the function returns true (true_id)
  • An ID of the rule to execute if the function returns false (false_id)

Pass an object (an example of an object and a rule is given below) to the created flow.

The execution will end when a null is provided for the true_id (and the function returns true) or when null is provided for the false_id (and the function returns false).

Additionally, the flow engine (with the provided rule-set) should not be circular.

Mockup

Please implement UI according to the following design:

Mockup

Instructions

  • Please use ReactJs as view layer. For the Flow logic use a pure JavaScript (no underscore and other libraries)
  • Unit tests and bundler/task runner are a plus.
  • Use pure CSS preprocessor for the styling of the UI - no external libraries

What we're looking for:

  • Code quality
  • Correctness
  • Technical choices

We appreciate your time and energy completing the coding exercise and will review your solution as quickly as possible.

Install

Run yarn install (it should also work with NPM).

Build

Run yarn run build.

You can try it out locally by running yarn run start on your browser or codebikeandmore.com/jsrulez

Test

Run yarn test and everything should be ๐Ÿ’š

jsrulez's People

Contributors

andresilveirah avatar

Watchers

 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.