Giter VIP home page Giter VIP logo

courier-agent-engine's Introduction

Courier Engine (nodejs)

The Courier project is broken down into four pieces - Agent, Engine, Server & Admin Console - and is divided up between three different repos.

  1. Agent - https://github.com/makeandbuild/courier-agent-nodejs
  2. Server & Admin Console - https://github.com/makeandbuild/Courier
  3. Engine - https://github.com/makeandbuild/courier-agent-engine

For a high level overview including architecture diagrams refer to our blog post Courier iBeacon Implementation

Summary

This code listens for a message from the server specifying an action to perform. To be more specific, the action to perform is to play a specified audio file.

We run this code on the same Raspberry Pi that the agent code is running on, but this could easily be separated to different devices. This code also runs on OSX.

It uses socket.io to register with the server and then listens for playaudio events.

socket.on('playaudio', function(payload) {
    console.log('Courier has requested this RPI play: ' + JSON.stringify(payload));
    // code to play audio file
});

Setup

npm install

Run

node engine.js

Demo

A quick demo of this code running standalone can be done by running two separate node instances:

node demo.js

and then in a separate console window:

node engine.js

Then navigate your browser to http://localhost:9000 and click the 'Hello' button to play the hello.mp3 file.

Roadmap

This repo is a work in progress - IT IS NOT PRODUCTION READY.

This is subject to change, but the items that we plan to work on next are the following:

  • Download audio files from S3 automatically (currently you have to manually download the files and point the config to the directory they are in)
  • Use authentication wtih socket.io connection to the server

courier-agent-engine's People

Contributors

jdye64 avatar lindsaythurmond avatar telrod avatar

Stargazers

Mehdi B. avatar

Watchers

Ken Orji avatar James Cloos avatar  avatar  avatar  avatar Gabriel Arronte avatar Joel Myers avatar  avatar  avatar Make & Build 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.