Code Monkey home page Code Monkey logo

sms_voting_app's Introduction

Voting App README:

Environment requirements:
rails: 3.0.9
mysql2: 0.2.11

Setup:
rake db:create - creates mig_voting_development database
rake db:migrate - creates the tables as per migrations in db/migrate
rake import:data - import vote data into the database from votes.txt log file

Running the rails app as 'rails s' should run it on port 3000.

1) localhost:3000 - lists all the campaigns imported
2) Clicking on Show details shows the campaign details:
	a) campaign name
	b) candidates with their score (valid votes)
	c) invalid vote count (depending on validity)

Description:

For keeping the application and data simple and clear, three main data models
were created.

1) vote
2) campaign
3) candidate

Vote model is the most important entity and serves two purposes:
1) it holds the voting data
2) it acts as a join model between campaign and candidate

So using the join model vote, we can find the candidates for a given campaign and thus can
calculate valid and invalid votes.

Every vote belongs to a candidate and a campaign. Votes with valid validity 
(validity = 'during') are considered for campaign score. Invalid votes are calculated
per campaign depending upon their invalid validity.

Script for loading the log file data into database is the rake file under lib/tasks/ named import.rake
On command line, running rake import:data imports the data into the database.


Application documentation can be found in doc/app/index.html

sms_voting_app's People

Stargazers

 avatar Andrew NS Yeow avatar

Watchers

GIJoe avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.