anuraghazra / QuickerPoll

QuickerPoll is a crowd-sourced real-time polling app created with React and Nodejs.

Home Page:https://quickerpoll.herokuapp.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

QuickerPoll

QuickerPoll is a crowd-sourced real-time polling app created with React and Nodejs. QuickerPoll lets you create edit, update, delete public polls and vote on them publicly. This project is just an example of using react, nodejs and restfull apis all together

NOTE : please do not create any violating contents here as is this database is publicly visible and i'm not responsibe for any violating content

API Endpoints:

GET - GET POLLS

// GET ALL POLLS
/api/polls -> 
[
  {
    name: String,
    votes: [Object],
    _id: String,
    request: {
      type: 'GET',
      url: `/api/polls/${_id}`
    }
  }
]

// GET SINGLE POLL
/api/polls/:poll_id -> 
{
  name: String,
  votes: [Object],
  _id: String,
  request: {
    type: 'GET',
    url:  `/api/polls/`
  }
}

POST - CREATE POLLS

// PAYLOAD TO SEND
payload = {
  name: String,
  votes: [
    {
      name : String,
      value: Number,
      color: String
    }
  ]
}

/api/polls -> 
{
  name: String,
  votes: [Object],
  request: {
    type: 'GET',
    url: `/api/polls/_id`
  }
}

PATCH - UPDATE POLLS

// PAYLOAD TO SEND
payload = [
  {"propName" : "name", "value" : "new name"},
  {"propName" : "votes.0.value", "value" : "80"},
  ...
]

/api/polls/:poll_id ->
{
  message: 'Poll has been updated!',
  request: {
    type: 'GET',
    url: `/api/polls/_id`
  }
}

PATCH - VOTE POLLS

// PAYLOAD TO SEND
payload = vote_id : String

/api/polls/cast/:poll_id ->
{
  name: String,
  votes: [Object],
  _id: String,
  message: 'Thanks for voting!',
  request: {
    type: 'GET',
    url: `/api/polls/_id`
  }
}

DELETE - DELETE POLL

/api/polls/:poll_id ->
{
  message: 'Successfully deleted the poll',
  request: {
    type: 'GET',
    url: `/api/polls`
  }
}

Get Started

Clone the repo to your local machine

git clone https://github.com/anuraghazra/QuickerPoll.git

Install all the dependencies

npm install

Start the application on localhost:3000

npm run dev

NPM Commands

start the application

npm run dev

start the backend server

npm start

watch for changes in server

npm run watch-server

in the ./clients folder to build react front-end type

npm run build

Tools Used

Made with ❤️ and javascript

About

QuickerPoll is a crowd-sourced real-time polling app created with React and Nodejs.

https://quickerpoll.herokuapp.com


Languages

Language:JavaScript 95.1%Language:HTML 3.4%Language:CSS 1.5%