1Vote: React-based Full Stack Voting Web App
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
controllers
css
js
models
public
routes
test
views
.babelrc
.eslintrc
.gitignore
README.md
_config.js
dummyData.js
package.json
server.js
webpack.config.js
webpack.production.config.js

README.md

1Vote

1Vote is a full-stack web app for creating and sharing live web polls. It features a lightning-fast front end with data visualizations, as well as an available full standalone API for leveraging the site as a back-end service.

I created 1Vote as part of the freeCodeCamp online self-study program.

Tech

Technologies used include:

  • React & Redux
  • MongoDB / Mongoose
  • Express.js
  • Node.js
  • D3
  • Webpack with Babel and Sass loaders
  • Passport

Building

Make sure mongod is installed and running. In a separate console window:

> npm install
> webpack
> npm start

(The final version will require ENV variables as well.)

API

Get all polls:

GET /api/getPolls

Add a poll:

POST /api/addPoll

Body should include the following JSON format:

{
    "poll":
    {
        "title": "What's your zodiac sign?",
        "choices": [{
            "title": "Wut"
        }, {
            "title": "Virgo"
        }],
        "owner": "Brap"
    }
}

Add a single vote to a poll's choice:

POST /api/addVote/[pollID]

Body should include the following JSON format:

{
        "choices":
        {
          "title": "Wut"
          }
}

Add a choice to an existing poll:

POST /api/addChoice/[pollID]

Body should include the following JSON format:

{
        "choices":
        {
          "title": "Jawn"
          }
}

Delete a poll:

DELETE /api/deletePoll/[pollID]