This project is my variant of the Employee Polls project created for Udacity's React course. This is an application that allows users to vote via polls which answer they would rather do in a "Would you rather" question scenario.
How to start the application:
- Install all required project dependencies
npm i
- Start the Development Server
npm start
- Navigate to the correct folder
npm test
Please log in with the data from the _DATA.js
If you have not answered a question yet, it will be displayed on the yet-to-be-answered page.
Once the question is answered, it will be displayed on the answered page. Use the slider on the right to get there
If a question has not yet been answered, you must answer it first.
After that you can see how many people have also voted like this
Of course there is also a leader board where you can see who has asked and answered how many questions.
If you want to ask your own questions then please use the question adding page
├── App.css
├── App.js
├── App.test.js
├── __snapshots__
│ └── App.test.js.snap
├── actions
│ ├── authedUser.js
│ ├── questions.js
│ ├── shared.js
│ └── users.js
├── components
│ ├── dashboard
│ │ ├── Dashboard.js
│ │ └── dashboard.css
│ ├── leader-board
│ │ ├── LeaderBoard.js
│ │ └── leaderboard.css
│ ├── login
│ │ ├── LoginScreen.js
│ │ ├── LoginScreen.test.js
│ │ └── __snapshots__
│ │ └── LoginScreen.test.js.snap
│ ├── navbar
│ │ ├── Navbar.js
│ │ ├── Navbar.test.js
│ │ ├── __snapshots__
│ │ │ └── Navbar.test.js.snap
│ │ └── navbar.css
│ ├── privateroute
│ │ └── PrivateRoutes.js
│ ├── question-adding-page
│ │ ├── QuestionAddingPage.js
│ │ ├── QuestionAddingPage.test.js
│ │ ├── __snapshots__
│ │ │ └── QuestionAddingPage.test.js.snap
│ │ └── questionaddingpage.css
│ ├── question-card
│ │ ├── QuestionCard.js
│ │ └── question-card.css
│ └── question-poll-page
│ ├── QuestionPollPage.js
│ └── question-poll-page.css
├── data
│ ├── _DATA.js
│ └── _DATA.test.js
├── index.css
├── index.js
├── middleware
│ ├── index.js
│ └── logger.js
├── reducers
│ ├── authedUser.js
│ ├── index.js
│ ├── questions.js
│ └── users.js
├── reportWebVitals.js
├── setupTests.js
└── utils
├── api.js
└── helper.js
Udacity has provided a _DATA.js
file, which contains not only exemplary user and question data, but also the possibility to modify them with the following functions
There are 4 possible requests:
- 1️⃣
_getUsers
- 2️⃣
_getQuestions
- 3️⃣
_saveQuestion
- 4️⃣
_saveQuestionAnswer
Method Signature:
_getUsers();
Method Signature:
_getQuestions();
Method Signature:
_saveQuestion(question);
Method Signature:
_saveQuestionAnswer({ authedUser, qid, answer })
Creating new questions or answering questions does not directly change _DATA.js. Therefore the page resets itself when the page is reloaded.
This project was bootstrapped with Create React App. You can find more information on how to perform common tasks here.
This repository was created based on the entry code for all Udacity students.
For details, check out CONTRIBUTING.md.