Giter Club home page Giter Club logo

live-poll's Introduction

Live-Poll

All Contributors

Set Up

  1. Clone repository
  2. Run npm install
  3. Copy and rename .env.example to .env
  4. Run npm run postinstall (optional)
  5. Run npm run dev (development mode) or npm start (production mode)
  6. Open the page in your browser (https://localhost:3000). It will list all the active polls.
  7. Type in the username and password found in .env

Available Routes

Additional URL-Parameters

  • monotone=boolean
    • applies a reduced color scheme for voting bars
    • ignored if overlay=true is used
  • simple=boolean
    • applies a basic font type
  • overlay=boolean
    • overwrites monotone parameter
    • applies a compact view especially for live streams / OBS

Example usage

/poll/{poll_id}?monotone=true&simple=true&overlay=true

Contributors โœจ

Thanks goes to these wonderful people (emoji key):


crunchypi

๐Ÿ’ป ๐Ÿค”

Julian

๐Ÿ’ป ๐Ÿค”

Manthan

๐Ÿ’ป ๐ŸŽจ

Simon Tiger

๐Ÿ’ป ๐Ÿค”

Pieter De Schepper

๐ŸŽจ ๐Ÿ’ป

Dimitri Tabatadze

๐Ÿ’ป ๐Ÿค”

Shaw Kai

๐Ÿ’ป ๐Ÿค”

Beery Shklar

๐Ÿ’ป

Fun Planet

๐Ÿค” ๐Ÿ’ป

Samuel Martineau

๐Ÿค”

Daniel Shiffman

๐Ÿ’ป

John

๐Ÿค”

Bunnygamers

๐Ÿค”

Rajaram Joshi

๐Ÿ“–

Younes Aassila

๐Ÿ“–

GiggioG

๐Ÿ’ป ๐ŸŽจ

Tom

๐Ÿ’ป ๐ŸŽจ

This project follows the all-contributors specification. Contributions of any kind welcome!

live-poll's People

Contributors

abhpd avatar adriaan1313 avatar allcontributors[bot] avatar beeryshklar avatar blackbirb avatar crunchypi avatar d-t-666 avatar dipamsen avatar drc avatar elunico avatar foxytocin avatar giggiog avatar heinrichxiao avatar konsti219 avatar lunatichacker avatar pieterdeschepper avatar samuel-martineau avatar shawkai91 avatar shiffman avatar simon-tiger avatar thecbkm avatar younesaassila avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

live-poll's Issues

No more than one vote?

Hi there,
I was trying your project on glitch and succesfully created a poll.
But as I try to vote from different browsers and IPs, I see that only one vote is taken in account.
Try it at https://livepoll.glitch.me/vote/6Uy0D8EymKk7ApAY

Did I miss something?

BTW, fsevent is a pain:

No Node version was specified; we are using default version 10. You can change this in package.json: https://glitch.happyfox.com/kb/article/59-can-i-change-the-version-of-node-js-my-project-uses/

Initializing node_modules, hold on...

/opt/watcher/app-types/node/install.sh: line 106: ((: <= 12: syntax error: operand expected (error token is "<= 12")

node v10.23.0, npm 6.14.8

Installing...

npm WARN deprecated [email protected]: "Please update to latest v2.3 or v2.2"

> [email protected] postinstall /app

> husky install

On branch master

nothing to commit, working directory clean

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.1 (node_modules/nodemon/node_modules/chokidar/node_modules/fsevents):

npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.2 (node_modules/chokidar/node_modules/fsevents):

npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

added 111 packages from 117 contributors, removed 49 packages, moved 325 packages and audited 467 packages in 72.124s

37 packages are looking for funding

  run `npm fund` for details

found 0 vulnerabilities

Total install time: 87161ms

vote-bar not showing up for me

Ive run npm install,
npm postinstall

Ive imputed the _id but the vote-bar is not showing up for me i get no errors and the console.log is showing up.
by vote-bar i mean the results
what am i missing?

sorry if this doesn't belong here

Syntax Error in sketch.js

Syntax Error (Unexpected end of Input)

// public/sketch.js
async function submitVote() {
  let choice = radio.value(); // choice is a number
  if (!isNaN(choice)) {
    let response = await fetch(`vote/${poll_id}/${choice}`);
    let status = await response.json();
    console.log(status);
  } else {
    console.log('no choice selected');
  }
// no closing curly brace

A 1 optioned poll?!?!

I could make a poll and only add 1 option or even 0 options, but I did see some code that was fixing that, it didn't work...

Swap out p5.js for jQuery (or similar)

This project is actually not using hardly any p5 specific code anymore, and it might benefit more from a library like jQuery to do the dom manipulation rather than have p5 still in there.

Any thoughts?

disabling spam check?

is there a way we can toggle the spam check?

i had something that at lest seemed to work, before it got updated.

Some design changes/other improvements

Listing some changes/improvements to the Live Poll

  • In homepage, add VOTE button and SEE LIVE RESULTS button for each poll (instead of linking to results link)
  • In every page: Instead of using h1 for the name of the page, we can do
<!-- (use pug equivalent) -->
<h1><a href="/">The Coding Train Live Poll</a></h1>
<h2>{name of page ("Currently active polls", "Create a Poll", etc)}</h2>
  • /create route: add better styling for form elements (public/css/style.css)
  • Fix visual bug: when the width of progressbar is less, the number of votes doesn't render correctly (See) (fixed in #72)

Should we add websockets for the poll to be live?

Currently, to have live data, we make an HTTP request twice per second. I think Web Sockets would be an alternative to consider. We could use Express WS or Socket.IO to transmit the data.

Pros: Prevents from doing unnecessary HTTP requests and spamming the server
Cons: To receive each new vote could spam the clients
Fix: We could make the server only send events each X seconds

Let me know what you think and, if you like the idea, I'll try to write a PR.

Database?

I don't actually need a database b/c I can just store the votes in memory for a real-time poll. But what if I want to restart the server and not lose the votes? Currently I'm using nedb just as a simple beginner-friendly database example, please add your suggestions and thoughts to this thread!

Add License

This project is currently Unlicensed. We should add a Open Source License, as the project is driven by the community! (MIT? <3)

[question] [discussion] why use pug

I was going through the code and I was wondering why do we use pug? Yeah, there are the includes but that can easily be done with simple javascript. We don't use it's more complex features.

Overlay Design

Different "views" for different scenarios in OBS. For example, maybe a semi-transparent background for when the OBS video is very noisy and busy.

redirect bypass??

is there a way to bypass the voting only once for testing / fafing aboot with it?

Future improvements

  • deploy to glitch!
  • accessibility concerns (rainbow color etc.?)
  • endpoint for new poll and front-end for new poll
  • anti-spam protections?

Hacktoberfest Opt-in?

There has been recent update in Hacktoberfest, wherein now individual repositories have to voluntarily opt-in for Hactoberfest in order for the PRs to count. Read more here: https://hacktoberfest.digitalocean.com/hacktoberfest-update.

PRs count if:
Submitted in a repo with the hacktoberfest topic

image

(Source: https://hacktoberfest.digitalocean.com/hacktoberfest-update)

Could the hacktoberfest topic be added to this repository in order to make the PRs eligible for Hacktoberfest?

I have a different more simpler method for this.

I made an app for a cat or dog poll. My method was simpler and more beginner friendly.
It counted how many of each on the client side and then displayed it. It used nedb and express it only had one file for the server.
I'll post it to github soon. Thank you so much Bye!!!

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.