GithubHelp home page GithubHelp logo

robotnyc / nodejs-vote-by-mac Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 150 KB

Node.js voting system using the MAC address to identify voters.

License: BSD 3-Clause "New" or "Revised" License

JavaScript 76.59% HTML 23.41%

nodejs-vote-by-mac's Introduction

nodejs-vote-by-mac

Node.js voting system using the MAC address to identify voters.

This web app is meant to be run on a local network from a Linux machine, such as a Raspberry Pi. The MAC address of the client/voter is only available in this configuration because it uses the local ARP cache to resolve the MAC address from the IP.

Deploy

On a Raspberry Pi:

  1. sudo chmod +x /etc/rc.local
  2. Append
cd /home/pi/nodejs-vote-by-mac
/usr/bin/nodejs /home/pi/nodejs-vote-by-mac/server.js &

Usage

  • Votes are cast by visiting the URL /NUMBER.
  • A vote for 0 is used to delete the vote.
  • Votes are stored in RAM and lost when the server is restarted.
  • Configuration options are available in the file config.js.
  • Configuration options can be modified by visiting the URL /config.

API

The following JSON endpoints are available for integrations.

  • /votes an unmasked dictionary of all the votes.
  • /results a dictionary of the results of the votes.
  • /winners a list of winners (more than one if there's a tie).
  • /random make a random vote from a random MAC for testing.
  • /count the current vote count.

nodejs-vote-by-mac's People

Contributors

dependabot[bot] avatar lucasrangit avatar mzzroboto avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

nodejs-vote-by-mac's Issues

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.