GithubHelp home page GithubHelp logo

joshai-challenge's Introduction

Christian Prather joshai-challenge

Overview

This is a basic cli written to interact with the Josh.ai lights server API. Its function is a one way communication and data display application. When ran it will print all info on current lights seen by the server as well as notify the consol of any changes (updates to existing light, removal of a light, addition of a light).

This application works in a continuous polling fashion constantly asking the server if there is any updates.

Code

Execution Instructions

To run the program you may either build the executable from source (see Build Instructions below) or if running on a compatible system you may download a bin from the release page.

Once you have a bin you may run it with the command ./josh-ai-interface

This will run the cli with default arguments. To get a list / help of all available arguments run.

./josh-ai-interface -h

You should get output similar to the below

USAGE:

   ./josh-ai-interface  [-k] [-r <int>] [-p <string>] [-a <string>] [--]
                        [--version] [-h]


Where:

   -k,  --keep-alive
     Make connections with keepAlive header, defaults to true

   -r <int>,  --rate <int>
     Rate for client to poll server for updates. (Not a guarantee, if
     client can not keep up)

   -p <string>,  --port <string>
     Port number.

   -a <string>,  --server-address <string>
     The server address.

   --,  --ignore_rest
     Ignores the rest of the labeled arguments following this flag.

   --version
     Displays version information and exits.

   -h,  --help
     Displays usage information and exits.


   Josh.ai CLI

By default the cli looks for a server at address localhost:8080, will poll as fast as your system allows, and will use the keepAlive http header.

Build Instructions

The project is built with C++17 and CMake 3.8. It has only been tested against Ubuntu 22.04. In order to build follow the instructions below.

1. git clone [email protected]:Christian-Prather/joshai-challenge.git
2. cd joshai-challenge
3. mkdir build
4. cd build
5. cmake ..
6. make -jn (n = number of threads)

This will make a binary in the build folder called josh-ai-interface

Run it with ./josh-ai-interface

Install

If you wish to install the program system wide you may run sudo make install which will place the bin in your binary folder.

Documentation

Building API docs

All code here is documented with Doxygen. In order to build the docs you must first have Doxygen and graphviz installed. Both are available through the debian/ubuntu repositories. After this, cd to the docs/ directory, and run doxygen. This should generate both HTML and LaTeX output. To view the HTML, simply navigate to file:///path/to/joshai-challenge/docs/html/index.html in your web browser of choice.

You can also go to the website here: https://christian-prather.github.io/joshai-challenge/

Module Decomposition

This program was broken into multiple modules to allow for the decouplign of dependencies as well as scalability.

The main modules and their roles are as follows

Module Description
Device Interface This is the primary logic of the application, this module is device specific and handles the device specific logic.
DataStore This is a module responsible for the access and validity of data from the server. Used to keep other subsystems from needing a direct client connection to the server.
Connection Manager This is the module responsible for the direct connection to the server. It is split out to allow for non reliance on any given http or web connection library / technology. If a change was made to gRPC for instance this is the only module that would need to be modified.

Third Party

This application relies onn a few third party libraries. As they are all header only they have been included in the third-party folder of this repo so there is no need to install them to build or run this application.

joshai-challenge's People

Contributors

christian-prather 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.