Giter Site home page Giter Site logo

neckersbox / votingapp Goto Github PK

View Code? Open in Web Editor NEW
6.0 1.0 6.0 1.04 MB

Voting App - freeCodeCamp Challenge - This app was built in MERN stack. It uses: MongoDB, Node, Express, React, React Router, Redux, Socket.IO, Material-UI and Google Charts.

JavaScript 98.01% HTML 0.73% CSS 1.26%
freecodecamp poll google-charts mongodb material-ui socket-io node react redux isomorphic

votingapp's Introduction

Vote App

Build Passed Status Beta

Free Code Camp Challenge

HEROKU APP - https://neckers-voteapp.herokuapp.com

This app was built in MERN stack. It uses: MongoDB, Node, Express, React, React Router, Redux, Socket.IO, Material-UI and Google Charts. The UI can be used on mobile, tablet and desktop.

Note:

  • Server and client components are isomorphic.
  • Authentication doesn't use cookie but a mix in client ( in localStorage/Redux store ) and server, by Socket.IO, check.
  • Already voted polls are saved in localStorage

User Stories

  • As an authenticated user, I can keep my polls and come back later to access them.
  • As an authenticated user, I can share my polls with my friends.
  • As an 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. (This could be implemented using Chart.js or Google Charts.)
  • As an authenticated user, if I don't like the options on a poll, I can create a new option.

It's a bug? No, it's a feature!

Ok, they aren't really features, but there are some actions not really good but ,for this challenge, I don't mind.

  • I can vote multiple times if I clear my local storage or I do an access from another device ( or I go in incognito mode, etc.. ).
  • Yeah, because to get track of the votes I have to save some informations in server side and, with users without login, I've to do a really hard work to check them. So.. the DB is in a sandbox powered by mlab and I don't want to stress it more.
  • I can't edit or remove options after the poll publish.
  • No, you can't. These actions weren't in the user stories.
  • I can't have multiple logins.
    • Yep, everytime you do a login you get a different session_id in both side: client and server.
  • I can't edit my personal data, like e-mail, nick or password
    • No, you can't. These actions weren't in the user stories.
  • I can't change my preferences
    • Yes, I don't like this feature in special way but I've decided to not implement an UNDO action for some security reasons.

process.env

  • MONGOURI: your query to authenticate in mongodb server mongodb://<dbuser>:<dbpassword>@ds119508.mlab.com:19508/neckersbox
  • NODE_ENV: for example production. Note: this must be the same between server and client.

Scripts

To compile or run this app use gulp and/or npm.

  • Build: gulp build
  • Watch: gulp watch or npm run watch
  • Clean: gulp clean
  • Start Server: gulp start or npm run start-server Note: normally start-server hide console messages, to show them you should exec npm run start-server-debug

MongoDB configuration

To properly works this application need a MongoDB database with two collections:

  • vote_users To save signed users
  • vote_polls To save users polls

votingapp's People

Contributors

neckersbox avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

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.