brunetsimon / live-poll Goto Github PK
View Code? Open in Web Editor NEWLive voting app created using React and firebase
License: MIT License
Live voting app created using React and firebase
License: MIT License
We need to add a homepage when the URL path is "/".
It could say something like welcome and then 2 possible buttons.
Check out this link to know how to create buttons.
The link can be done using the "to" attribute described here
A button that says "start voting" with a link to "/client"
A button that says "display a voting graph" with a link to "/server"
This task is to handle the page that will display the graph showing the total vote result.
It shall listen for changes in the database and update a graph every time a new vote is received.
It has thus two modules:
To implement the function listening to the database changes, look at this part of the documentation on how to continuously listen to value and update a local variable with the result.
The snapshot value shall be stored locally in the state countArray.
The graph could be done using this library. Why not use the BarChart?
You need to update the component VotingClientPage.jsx
It is a router with a Switch and 2 routes.
You need the router to:
Note: :pollId means any ID. For example /client/1 the pollId is 1 and /client/IFG the pollId is IFG
You can test your implementation here:
Don't forget to navigate to the correct URL!
When this is done, do the same but for the server to be able to choose which graph poll to display. Simple copy paste can be done! Replace all "client" with "server".
The user votes by clicking on an smiley.
This task is to create a list of all the icons so that the user can click on one of them to vote.
To do:
Display all smiley icons used to vote. Hint, use IconButton and Icon.
When the user click on the icon, the function this.props.callbackVote shall get the corresponding rating id.
Hints:
Extra fun: Try to avoid to copy paste the same code for each icon. Have a look at the map function.
You can test your code before pushing your task here in the file Vote.js:
The polls shall be able to be closed to prevent further voting.
Manually from the dashboard and automatically after x days.
You will be working in Main.jsx
This component is mainly a router with a Switch, meaning that it will choose which page to display based on the URL we are at.
It shall do following:
Note: :pollId means any ID. For example /client/1 the pollId is 1 and /client/IFG the pollId is IFG. This is how we know which poll the user would like to display.
You can test your implementation here:
Don't forget to navigate to the correct URL!
A user could want to add a message to its rating.
Create a navigation for our App!
Requirement: We need an AppBar with a Title and at least 3 buttons.
Suggestion: Have a look here https://material-ui.com/demos/app-bar/ to find out how to use components like AppBar, Toolbar, Button, etc...
The link can be done using the "to" attribute described here
You can test it here before pushing your changes (file Navigation.js) :
Modify the file Result.jsx to display to the user which rating they selected and to inform that everything went well.
A sort of "thank you for voting. Here is your rating: Great".
Hints:
Before pushing your task, you can test it here in the file Result.jsx:
Note: You can change the value of the rating in the file App.js
To help track which admin creates/closes which poll, shall be nice to display a basic activity feed.
To increase the confidentiality, only users with verified email shall be able to be "admin"
Can we make it a Progressive Web App? So that the user could install the app like a native app.
While listing all the polls from the admin dashboard it shall be possible to select to only display the one that are opened and/or "my polls"
This task is to work with the file VotingClientSelector.jsx and VotingServerSelector.jsx
This file controls the page where the user has to enter which vote he/she wants to select.
You need to implement the following features:
A form for the user to enter the poll id. Use the form element and style it using FormControl, Input, FormHelperText and Button.
The form shall take the poll/vote Id and save it locally in this.state.pollId. Hint: Create an "onChange" function on the Input element. (Look at the source code examples here.)
When the user click the submit button the "handleSubmit" function will be called. It does 2 things: Check in the database if the pollId exists. If it does then navigate to the pollId URL (/client/ID or /server/ID) using history.push. If it doesn't then display an error (this..state.errorMsg and this.state.showError)
You will have to implement the VotingClient.jsx page.
This page has 2 functions:
Hints:
You can test your code here (Not the push to firebase though... But that's a simple one :) )
Instead of checking if a poll exists in the client, allowing quering of all info, check it on the server and return a bool to the client.
Avoid that everyone create an account.
Check that the email address is a work email.
Add a rechaptcha.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.