Skip to content
A Node.js web application in which polls can be created, voted, and graphed. Build a Voting App Dynamic Web Application Project for FreeCodeCamp.
Branch: master
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.
client
server
.babelrc
.eslintrc
.gitignore
Procfile
README.md
env-sample
package.json
setup.sql
yarn.lock

README.md

VoteLi

VoteLi is a Node.js web application in which polls can be created, voted, and graphed.

Check out VoteLi

Getting Started

Prerequisites

In order for the authorization component of this app to work, it needs to be registered with Twitter using Twitter Application Management.

The callback URL also needs to be provided in the format DOMAIN/login/twitter/return.
Example: http:127.0.0.1:5000/login/twitter/return.

Then the application will then be issued a consumer key and consumer secret.

Steps

  • Run npm run build or yarn run build.
  • Create a new database and run setup.sql to setup the tables needed.
  • In the root directory, create a .env file (or rename the env-sample file to .env) and place the following:
    • TWITTER_CONSUMER_KEY=CONSUMER KEY ASSIGNED BY TWIITER
    • TWITTER_CONSUMER_SECRET=CONSUMER SECRET ASSIGNED BY TWITTER
    • SESSION_SECRET=ANY RANDOM STRING OF CHARACTERS
    • DATABASE_URL=YOUR POSTGRES DATABASE URL
    • REDIRECT_DOMAIN=WEBSITE DOMAIN NAME
    • PORT=ANY PORT NUMBER FOR EXPRESS, EXCLUDING 3000
  • Make sure the new database with tables is running.
  • Run npm run dev or yarn run dev.
  • Navigate to localhost:3000 in your browser.

Available Scripts

In the project directory, the following commands are available:

npm run dev or yarn run dev

Builds the app for development. It is watched by webpack for any changes in the front end (React) and back end (Express).

npm run lint or yarn run lint

Lints both front end (React) and back end (Express).

User Stories

  • As an authenticated user, I can keep my polls and come back later to access them.
  • An as authenticated user, I can see the aggregate results of my polls.
  • As an authenticated user, I can delete polls that I decide I don't want anymore.
  • As an authenticated user, I can create a poll with any number of possible items.
  • As an unauthenticated or authenticated user, I can see and vote on everyone's polls.
  • As an unauthenticated or authenticated user, I can see the results of polls in chart form.
  • As an authenticated user, if I don't like the options on a poll, I can create a new option.

Libraries

  • Express.js
  • Massive
  • Passport Twitter
  • React using create-react-app
  • Redux
  • Redux Thunk
  • React Router v4
  • Axios
  • Semantic UI React
  • React Chartjs 2
  • Validator
You can’t perform that action at this time.