Coder Social home page Coder Social logo

liveplant-server's Issues

Start Fresh

Let's go ahead and abandon the current dev branch that we made at HackDFW. It was a good start, but it was made under duress. I will keep the hackdfw branch for reference.

I'm going to

  • get us started with my general go project template
  • set up tests
  • get us a simple "hello world" web app up and running
  • deploy to chosen hosting (prolly gonna be heroku based on discussion in #4)

Vote cycle should be refreshed based on calls to the `/votes` endpoint

#29 (comment)

It should definitely reset based on calls to /votes. Couple reasons:

  • If nobody is making calls to /votes, nobody is on the website voting and the robot shouldn't be doing anything. "If a tree falls in the forest..."
  • One should be able to work on the front-end without a real robot calling the endpoint
  • Avoids race conditions where the client and robot's polling is slightly out of sync. The votes endpoint will always have accurate information regardless of the behavior of the robot.

"Current Action" endpoint

@ridhoq and I are going to commit to getting the current action endpoint squared away tomorrow evening. Anybody is free to attend, just coordinate we @ridhoq and I. We don't have a definite time but will commit to one if it makes it easier for you to attend.

For the "current action" endpoint we are going to :

  • Determine what the JSON response looks like. This is what the bot will be consuming.
  • Document API usage in the README
  • Scaffold repo #5
  • Scaffolding includes setting up Redis
  • Write failing tests for the response
  • Write code to satisfy test
  • Ship to heroku #4

Hosting

Let's discuss where we are going to host this thing.

I do not want this to become an exercise in hardcore devops: so I'm pretty sure I just want to host this thing on Heroku and be done with it to begin with. There is a chance this thing will go wildly viral and we will need to be able to rapidly scale. Heroku just works:tm:.

Another option would be to host on linode with our own install of http://deis.io if heroku gets too expensive. But this will steal valuable dev time from our effort.

Verbose Mode / Configurable Logger Output

Implement logger output that can be enabled or disabled either by an argument passed to the executable at start up, or an environment variable. The logger output would print useful debug information while the server runs and responds to requests.

For example, if debug logger is enabled, and liveplant-server receives a /votes request, it would print out information about the HTTP request (and / or current application state) to the console, and / or print out any errors or other useful debugging information.

By default, debug logger statements should be disabled.

If the liveplant server is started with argument --debug at the command line:

$ liveplant-server --debug

then the server would subsequently run with debug logger statements enabled.

Also, if the environment variable LIVEPLANTDEBUG=true is present, this would also enable debug logger statements.

Twitter actions retrieval

Allowing to have an way to retrieve commands from twitter to water the plant. Then, replying to the sender with a picture of the plant being watered.

Console idea

Basically it would be cool to have a public console for streams or events by the team. You should be able to ssh into the server and manually implement commands if necessary. That way you can ask the crowd to vote on an action and then maybe ask them what intensity they want, etc.

Forgive my psuedo code, but here's some creative stats we could consider implementing as well and maybe even showing a live feed of this console. All of these functions would relay to the Arduino for machine specific instructions.

ssh [email protected]
<password>
-----------------------
//yungtom = new Plant('species','cost', 'type', 'etc');

yungtom.water(50);

Yung Tom has been watered for 50mL giving him a total of 950mL for the day since 12:00:00AM.

yungtom.nutrients(20);

Yung Tom has added 20mg of nutrients to his diet which account for 24% of his recommended daily value.

bigjohn.sunlight(15, 60);

Big John will be exposed to sunlight for the next 15 minutes at 60% intensity. This equivalent to 2 Watt-Hours of energy.

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.