Voting App - Feedback?

Hi Freecodecampers!

It took me more than a month (I was learning Angular JS along the way to make this), but just finished a first version of my Voting App!:

Build with Angular, Node, Express, Passport and Chart JS. Let me know when you have feedback! Thanks :slight_smile:

BTW: i need to do something about the New Poll form that requires spaces between the options, meaning every option can only be 1 word. Should change that to separating by comma’s or something.

Awesome & brillant application. How long did it take you to code the application?

Thanks!! It took me a month. But I was learning Angular JS along the way, because I wanted to learn it to do the front-end. It also took me a while to understand how to secure API endpoints + validation of the form in the front-end with Angular. Hope it will help me start faster with the other full stack projects. Chart JS was very easy to implement though.

I must confess that is very very awesome (1 month) good work. I think you need to create more awesome applications and whatever you do don’t stop. More more more apps :sunglasses:

Did you implement the user story that lets users add additional poll options if they don’t like those provided?

I didn’t like that user story personally but added it just for the sake of completion. Did you decide against? I couldn’t see a way to do it in yours.

yeah, but you need to login before you can add an option. And it checks if the poll belongs to you. If the poll is yours (by comparing with the id in the database) it adds a checkbox that opens an input field for a new option.

have a link to your voting app to check it out?

Oh, so general authenticated users can’t add options, you can only add an option if your were the creator?

yep thats right, i followed the instructions by FCC actually. It said need to be authenticated to add options.

Nice, used the Passport Local strategy?

No, it’s not passport, I used Passwordless instead.

interesting, never heard of that before

This medium article discusses why passwords are a bad idea:

Great App! I’m just starting and right about now a month seems pretty optimistic!! Lol!

Now that you’ve done it, do you recommend learning Angular? Did it help significantly? I suppose learning Angular is inevitable if I plan on working with Node and Express…

Also, I interpreted the ‘add options’ user story different than you. I was under the impression that you needed to be an authenticated user, but the poll didn’t particularly need to be yours. That way, if you weren’t happy with the options, you could add your own… Some of these user stories are pretty loosely defined…

Anyway, that’s a long way off for me. Right now, I’m trying to implement passport authentication…

There’s 6 hours of my life I’ll never get back!

It took me forever to understand how the authentication worked. Passport makes it pretty simple, and the docs are great, but I had no idea why I was using bodyparser, what sessions are etc.

That being said, I don’t regret those hours I spent getting how it worked, but it definitely was the most frustrating/time consuming bit of making the voting app. There’s actually a great article on that helped a ton:

Note that some of the methods may be slightly outdated, but it’s great to get started with passport.

@JacksonBates - 6 hours!! You’re a hell of a lot better than I am… Maybe I’m just thick, but I’m really struggling with getting passport to work. The problem (well maybe not a problem in the long run, but definitely why this is taking me so long) is that I need to understand what every bit of code is doing and why it’s there… I haven’t found any great resources and the passport docs don’t explain it on a level I understand… Like what the hell is serializeUser and deserializeUser?

@imtoobose thanks for the link. I’ll work through that tonight, hopefully that’ll help…

You might find these useful: