Stuck on the Voting App

I’m on the Back End Webdev Certification and I’ve been stuck on the Voting App for about 5 days now, so I have decided to build a quite dumbed down prototype of the app.

the app: https://understood-novel.glitch.me/
source code: https://glitch.com/~understood-novel

Basically, the app allows you to create a poll, which creates a JSON object when the ‘submit’ button is clicked, then the poll appears on the right side, based on the JSON object, which you can vote on. Then the poll results appear on the bottom, which practically is the same JSON object passed during the creation of the poll, which updates as you vote.

The JSON object kinda looks like this:

newPoll= {
title: ‘poll title’,
choices: {
firstChoice: 0,
secondChoice: 0,
thirdChoice: 0
}
}

I just wanna know what you guys think, whether i’m on the right track, way off, etc.
Thanks!

p.s. this involves only the front end functionality and i am aware this lacks a lot of stuff.

Ok, so a couple of things.
To create a poll you should be logged in.
After I created a poll I could not see the options, only the title.
I personally have created separate views to show the poll creation, poll voting and all polls.
In a normal app this would be 3 separate pages but as it is REACT I used REACT-ROUTER.

1 Like

will definitely build the authentication/routes/proper views next. thanks for the feedback!