Giter Club home page Giter Club logo

full-stack-challenge's Introduction

App Logo Full-Stack Challenge

Build Status Coverage Status Dependency Status devDependency Status

The assignment is to build a simple Producer/Consumer system. In this system the Generator will send a series of random arithmetic expressions, while the Evaluator will accept these expressions, compute the result and then report the solution to the Generator.

What it looks like

Requires

  • NodeJS
  • npm

Setup

  1. Run npm install

Running the Consumer

The Consumer service listens for expressions from any Producers. Upon receiving an expression, it will attempt to evaluate it. If it's successful, it will emit an event back to the Producer with the answer. It will also emit the answer to the public event feed. If it can't evaluate the expression, it will broadcast an error instead.

  1. Run npm run consumer
  2. Visit http://localhost:3000/ in a modern browser

Once the Consumer is running you can visit http://localhost:3000/ in a modern browser and get the expression interface. This page will be automatically updated as expressions from any Producers are evaluated as well as when expressions fail to be evaluated. The interface provides an input so you can manually enter your own expressions to have them evaluated live.

The Consumer will log all of it's output to stdout.

Running a Producer

The Producer service will generate a random arithmetic expression consiting of two integers and an operator, e.g. "2+3=". It will do this every second until the end of time (or until you stop the process, whichever comes first). You can run as many Producer processes as your computer will support.

  1. Run npm run producer

The Producer will log all of it's output to stdout.

Running on Heroku

You can freely deploy an instance of this application on Heroku to see it in action. Simply click the Heroku deploy button below and follow the instructions.

Deploy

Once you have the app deployed on Heroku, you can increase the producer dyno to 1 to start a Producer service that will automatically start generating random expressions and sending them to the Consumer based on the interval you set for PRODUCER_INTERVAL.

Demo

You can view a live demo at http://full-stack-challenge-example.herokuapp.com which has a Producer running on a 5 minute interval.

Running Tests

Use the npm test command. This will validate the codestyle of the project using tabs4life as well as run all tests in the test directory.

Use the npm run coverage command to get the current code coverage report. It will also attempt to upload it to Coveralls.io if you have permission.

Diagrams

Activity Diagram

Activity Diagram

Sequence Diagram

Sequence Diagram

full-stack-challenge's People

Contributors

chesleybrown avatar

Stargazers

 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.