The starter code for the final assessment project for Udacity's React & Redux course

Last update: May 23, 2022

Employee Polls Project

This is the starter code for the final assessment project for Udacity's React & Redux course.

The _DATA.js file represents a fake database and methods that let you access the data. The only thing you need to edit in the _DATA.js file is the value of avatarURL. Each user should have an avatar, so you’ll need to add the path to each user’s avatar.

Using the provided starter code, you'll build a React/Redux front end for the application. We recommend using the Create React App to bootstrap the project.

Data

There are two types of objects stored in our database:

  • Users
  • Questions

Users

Users include:

Attribute Type Description
id String The user’s unique identifier
password String The user’s password in order to log in the application
name String The user’s first name and last name
avatarURL String The path to the image file
questions Array A list of ids of the polling questions this user created
answers Object The object's keys are the ids of each question this user answered. The value of each key is the answer the user selected. It can be either 'optionOne' or 'optionTwo' since each question has two options.

Questions

Questions include:

Attribute Type Description
id String The question’s unique identifier
author String The author’s unique identifier
timestamp String The time when the question was created
optionOne Object The first voting option
optionTwo Object The second voting option

Voting Options

Voting options are attached to questions. They include:

Attribute Type Description
votes Array A list that contains the id of each user who voted for that option
text String The text of the option

Your code will talk to the database via 4 methods:

  • _getUsers()
  • _getQuestions()
  • _saveQuestion(question)
  • _saveQuestionAnswer(object)
  1. _getUsers() Method

Description: Get all of the existing users from the database.
Return Value: Object where the key is the user’s id and the value is the user object.

  1. _getQuestions() Method

Description: Get all of the existing questions from the database.
Return Value: Object where the key is the question’s id and the value is the question object.

  1. _saveQuestion(question) Method

Description: Save the polling question in the database. If one of the parameters are missing, an error is thrown. Parameters: Object that includes the following properties: author, optionOneText, and optionTwoText. More details about these properties:

Attribute Type Description
author String The id of the user who posted the question
optionOneText String The text of the first option
optionTwoText String The text of the second option

Return Value: An object that has the following properties: id, author, optionOne, optionTwo, timestamp. More details about these properties:

Attribute Type Description
id String The id of the question that was posted
author String The id of the user who posted the question
optionOne Object The object has a text property and a votes property, which stores an array of the ids of the users who voted for that option
optionTwo Object The object has a text property and a votes property, which stores an array of the ids of the users who voted for that option
timestamp String The time when the question was created
  1. _saveQuestionAnswer(object) Method

Description: Save the answer to a particular polling question in the database. If one of the parameters are missing, an error is thrown. Parameters: Object that contains the following properties: authedUser, qid, and answer. More details about these properties:

Attribute Type Description
authedUser String The id of the user who answered the question
qid String The id of the question that was answered
answer String The option the user selected. The value should be either "optionOne" or "optionTwo"

GitHub

https://github.com/erdemkeren/react-employee-polls-udacity
You might also like...

React Package Starter - a simple and slightly opinionated starter kit for developing and publishing React packages

React Package Starter This is a simple and slightly opinionated starter kit for developing and publishing React packages. It comes with a several pre-

Jun 21, 2022

Nextjs-ts-mui5-scss-storybook-starter - Next.js + TypeScript + Material UI v5 + Sass + Storybook starter

Nextjs-ts-mui5-scss-storybook-starter - Next.js + TypeScript + Material UI v5 + Sass + Storybook starter

nextjs-ts-mui5-scss-storybook-starter 📕 Next.js + TypeScript + Material UI v5 +

Jun 16, 2022

Nextjs-starter - A TypeScript starter for Next.js

Next.js TypeScript Starter Features ⚡️ Next.js 12 ⚛️ React 17 ⛑ TypeScript 📏 ES

May 23, 2022

Basic React+Django application for the game 'Tombola'. The code has been rushed for Christmas eve, you will not find efficient nor optized code.

Tombola Basic React+Django application for the game 'Tombola'. The code has been rushed for Christmas eve, you will not find efficient nor optimized c

Dec 30, 2021

spring springMVC Hadoop HBase React AntUI course manage system

CourseManageService Spring、SpringMVC + Hasdoop HBase Course Manage System Quick Start 1 change your hBase service adress:site.linkway.core.dao.HbaseUt

Nov 6, 2021

A Next.js boilerplate to be used in a course called React Avançado

This is a Next.js boilerplate to be used in a course called React Avançado. What is inside? This project uses lot of stuff as: TypeScript NextJS Style

Jun 9, 2022

A starter project for React-Three-Fiber bootstrapped with Create-React-App and some useful packages

A starter project for React-Three-Fiber bootstrapped with Create-React-App and some useful packages

A starter project for React-Three-Fiber bootstrapped with Create-React-App and some useful packages

Jan 16, 2022

⭐ Starter project for React Js. ✍️ Developed by Gentrit Halili.

The project is helpful to start your next project, as it provides a lot of the common tools you may reach for, all ready to go.

May 31, 2022

Starter project for firebase web with React, Chakra UI and auth pages added

Starter project for firebase web with React, Chakra UI and auth pages added

Firebase React Chakra UI Starter A starter project for Firebase web. Installation Clone the repository git clone [email protected]:stephenbaidu/firebase-

Jun 2, 2022
Javascript-testing-practical-approach-2021-course-v3 - Javascript Testing, a Practical Approach Course
Javascript-testing-practical-approach-2021-course-v3 - Javascript Testing, a Practical Approach Course

Javascript Testing, a Practical Approach Description This is the reference repos

Jan 8, 2022
Next course starter

next-course-starter A NextJS starter to get you started creating educational materials using Markdown Get Started Set up Node.js v14+ Clone this repo

Jun 19, 2022
Code snapshots and materials for our "React - The Complete Guide" course
Code snapshots and materials for our

Code snapshots and materials for our "React - The Complete Guide" course

Jun 19, 2022
A starter code to start the project built with Laravel 9 + InertiaJs + ReactJs
A starter code to start the project built with Laravel 9 + InertiaJs + ReactJs

This is a starter code to start the project built with Laravel 9 + InertiaJs + ReactJs, which already includes multiple layout admin templates with login for authentication

May 30, 2022
In this React JS course, create-react-app was used to create the project using typescript as the standard language for development

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

Jan 7, 2022
CLI, Local API and Local client for React and Typescript: Build a Portfolio Project course.

?? JBook (CLI, Local API, Local Client) Complete project of React and Typescript: Build a Portfolio Project course. You can find the whole repo at Git

Oct 30, 2021
This project is my ReactJS course on Udemy.com

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

Jan 6, 2022
A universal Javascript starter kit inc. React, Redux, Redux Dev Tools, Universal Redux Router, CSS Modules, hot module reloading, Babel for ES2015+ and ESLint

UniversalJS A universal Javascript starter kit inc. React, Redux, Redux Dev Tools, Universal Redux Router, CSS Modules, hot module reloading, Babel fo

Jul 1, 2020
Simple React-Native boilerplate code in Typescript for getting started with a new project quickly. It has all the essentials that one would require in a project.

react-native-boilerplate-typescript Simple React-Native boilerplate code in Typescript for getting started with a new project quickly. It has all the

Feb 25, 2022
A starter project for modern React apps with Redux

React + Redux w/ ES6 Starter Project ?? A Completely updated version of my initial boilerplate ?? Note: If you still want to use a previous version, p

Apr 22, 2022