New app: PrezPoll - Who would you like to see in the White House?

Like so many north eastern citizens my employer was closed for business in prep for and during the devastating storm Sandy. I was lounging around the house enjoying the family with the storm coverage on in the back ground. After sometime I noticed that all of the Presidential Election coverage was rightfully non-existent and for some reason that triggered a thought. I wanted to create an unbiased grass roots poll that would capture individuals picks for the 2012 U.S. Presidential Election. I wanted to gauge which candidate the public wants to see in the White House this term.

I've been learning Python for a few months now and I decided to build an application that could capture these presidential picks and publicly show the poll results. The end result of this application would be to tally the votes for each candidate and display those results to the public online. As I was designing the app and modeling the data I came to the conclusion that I only needed to capture the user's picks. I wasn't interested in identifying who and how these individuals voted. I was only interested in anonymously capturing their pick in the interest of protecting privacy.

Upon finalizing the requirements I started selecting the technologies to use for this project. As I previously mentioned, I've been working Python for months now so that was my clear choice and then I chose to the flask framework to enable the web functionality. I then decided to use MongoDB for the data repository layer. I had the web and database technologies picked for the project and the missing piece was how and where was this app going to be hosted.

I've been researching and using Red Hat's Platform as a Service (PaaS) OpenShift for almost a year now and it was a natural fit for this project. Firstly OpenShift has a free offering for customers which enables users to easily deploy host and maintain their apps online.  Secondly it supports the technologies that I intended to use for this project as well as most open source languages, database and frameworks available. OpenShift is a one stop shop so again my choice was clear here.

MongoDB is a great data repository. I really enjoy using it's document based schema but most of all its amazing speed in both reading and writing data.  The non-relational principals it's based on bring a huge smile to my face because it allows data to be stored, maintained and accessed dynamically and not bogged down with the many constraints of relational data models.  Now you can truly model your data as objects without having to go through what I like to call "relational hell".  You veteran engineers know what I'm talking about.  MongoDB is stable, fast and best of all open and free so use it!

Now that I settled on the project's tech I rolled up my sleeves and began coding. Python truly is a great language an I recommend that everyone learn it. The syntax is kool and easy to read. I decided the app would consist of 2 resources a voting page and a results page where the current poll results are displayed.  I coded the presentation and controller layers using flask and the Jinja2 template system. I also had to import the Flask-PyMongo packages in order for flask to speak with the MongoDB data layer. After approximately 4 hours of coding and tweaking the presentation details/functionality of the the prezpoll app I felt it was ready for the wild so did a quick git commit -mgit push and prezpoll was hot on the web.

Overall I'm satisfied with the app. It could def be prettified but I haven't played the web designer role in years. That aspect of web development is like fashion and changes so often that I truly have no interest in having to change styles and techniques as required when you're in the design game.

In any case it was fun developing this app and I hope that it gets lots of participation. I think it's a kool experiment and can reflect the general public's opinion. So be sure you pick your guy and encourage everyone you know to use the app too.

You can make your pick here and the poll results will be shown after your selection:

http://prezpoll.angelrivera.com

Enjoy - thx for reading

-A

Comments