Coder Social home page Coder Social logo

shriniketsarkar / would-you-rather Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1.29 MB

Application for doing user polls developed using react, redux. - Allows for user profile - login/logout, polls taken, polls created, leaderboard.

JavaScript 78.94% HTML 0.60% CSS 20.46%

would-you-rather's Introduction

Would You Rather

Would You Rather is a website which allows the user to login, create questions, answer question and check out a leaderboard. The Leaderboard gives a view of all the other users who are answering the same questions. You can respond to other user's questions by selecting one of the two options provided in the question poll.

The questions are displayed to the user on their Home page sorted by timestamp of when the question was created. The user can see the list of questions they have answered and the ones which they are yet to respond to. There is a Results page for every question poll which indicates the votes and percentages of the responses.

Authors

Shriniket Sarkar

Installation and Launch Instructions

To get started developing right away:

  • Install all project dependencies with npm install
  • Start the development server with npm start
  • Visit localhost:3000 on web-browser of your choice.

Project Structure for better understanding

├── README.md - This file.
├── SEARCH_TERMS.md # The whitelisted short collection of available search terms for you to use with your app.
├── package.json # npm package manager file used to build and run the application.
├── public
│   ├── empty-avatar.png # This avatar is used when the user does not have an avatarURL
|   |── john-doe.png # These are other avatars being used with the existing users.
|   |── sara.png
|   |── tyler.png
│   └── index.html
└── src
    ├── actions # These are redux actions that the site uses to manage state
    │   ├── Files : loggedInUser, questions, users, shared.
    ├── assets # Static assets such as logos used in the app.
    │   ├── Files : logo.png and your-vote.png
    ├── components # React components used in the site.
    │   ├── These handle Home, Leaderboard, Login, Navigation, NewQuestion, Question Results, User Score, etc
    ├── middlewares # Middlewares used in the site with React-Redux
    │   ├── logger # Middleware to handle console logging of Redux actions.
    ├── reducers # These are redux reducers that the site uses to manage state
    │   ├── Files : loggedInUser, questions, users.
    ├── utils # This folder includes all the DATA api needed for the site
    │   ├── _DATA.js : Initial design provided by Udacity to use as a database.
    │   ├── dataAPI.js : APIs wrapped around the DATA to consume it efficiently.
    ├── App.css # Styles for the Would You Rather app.
    ├── App.js # This is the root of the Would You Rather app.
    ├── App.test.js # Used for testing. But not implemented yet.
    ├── index.css # Global styles.
    └── index.js # Main render point for our application. Wraps the app with our Redux store provider for easier usage withing the application.

Backend Server

The provided file dataAPI.js contains the methods for performing necessary operations on the backend:

getDataForInitialLoad

Method Signature:

getDataForInitialLoad()
  • Returns a Promise which resolves to a JSON object containing a collection of users and questions for the site.

saveQuestion

Method Signature:

saveQuestion(question)
  • question: <Object> containing necessary data to store the question in our store.

saveQuestionAnswer

Method Signature:

saveQuestionAnswer(answer)
  • answer: <Object> container necessary data to store as an answer for a question in the store.
  • This operation handles storing the answer for the respective user and updating the question in the questions store.

would-you-rather's People

Contributors

shriniketsarkar avatar veronikabenkeser 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.