Open Voters is an open source platform to build online voting services.
With Open Voters you can build an end-to-end service, from scratch, to post questions and collect answers for any poll you have in mind. Do you need to know more about the opinion of your customers? Would you like to make some instant polling on specific topics?
- voting intention
- customer satisfaction surveys
- opinion polls on hot topics (social, politics, sports)
- instant polling and voting in TV shows
Open Voters includes libraries you can use to build your polling/voting services: a server library and several libraries for mobile applications. iOS and Android libraries are ready for you to add voting/polling service to your apps or to build a new mobile application for your brand new polling service idea.
We have released the first two implemenations: votoio and papabili.
- Votoio is the voting service to share the intention of vote about the Italian Elections 2013. Users can share their preference and verify the results live.
- Papabili is the voting service to share the preference for the next Pope. It's available worldwide and people can choose a candidate (from a list of most recognized as “papabili” as reported on the Wikipedia page.
It's still a work in progress and we have just released the server APIs as an open source project at http://openvoters.org under the GNU Affero General Public License.
How It Works at a High Level
On the server side, Open Voters is a JavaEE application living in Jboss AS7 and on top of Infinispan. Infinispan provides the in-memory cache support to make easy and fast the collection of the votes and to quickly provide rankings to the client. Infinispan expose a set of REST APIs to allow different clients (iOS and Android at the moment) to interact with the server via http. MySQL is used as persistent cachestore to create the archive of votes and guarantee that votes are never lost.
On the client side Open Voters' libraries send user votes by providing key/value pair: device ID (key) and preferred candidate (value). This means that a vote is linked to a device and the user can change their view (and therefore vote) at any time. The vote is counted once per device, but users are free to change it. This way of working is the only way to guarantee that the votes are anonimous and that the user can vote just once.
This diagram shows the logical layers of the application.
The client-server communication uses http with REST APIs and JSON objects. For example, voting from the smartphone means sending a HTTP PUT REST request. The server handles the request and redirects it, using some filtering and logic, to Infinispan to store the data.
How OpenShift Benefitted My App Development Process
OpenShift gave me freedom to build my app without any constraints. I just used the Java programming skills I already had and without hvaing to learn any new skills or frameworks. Primarily, OpenShift gave me the chance launch this this project in my limited my spare time, allowing me to focus strictly on application development without worrying about the infrastructure. I used the time saved to focus on the business logic of the implementation and bug fixing. OpenShift provides the runtime JavaEE engines (Jboss AS7, Infinispan), the database (MySQL), and the Wordpress sites I'm using on the web for the projects. Therefore, with OpenShift I'm able to easily host my application and promote with very little administrative overhead.
We're planning to open source the client libraries for iOS and Android. We'll also review and enhance the REST APIs to provide more functionality and a more robust and consistent interface. We'll also add security and a redesigned architecture to let it scale out on multiple servers. Last, but not least, we're going to add support to allow expansion of the service from a voting service to a survey service that handles multiple choice questions on multiple topics.