GithubHelp home page GithubHelp logo

andrewetobin / bike-share Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mikecm1141/bike-share

1.0 1.0 0.0 12.46 MB

This application uses data provided by Kaggle to analyze bike share data in the San Francisco area. Also serves as a simple e-commerce engine to sell bike accessories.

Home Page: https://bike-share1141.herokuapp.com/

Ruby 74.46% JavaScript 0.50% CoffeeScript 0.34% CSS 1.39% HTML 23.31%

bike-share's Introduction

ruby 2.4.1 rails_ 5.1.6

Bike Share README Abstract This application uses Ruby on Rails and ActiveRecord to analyze data from a Bay Area bike share program. Data explored includes general stats along with usage stats. The usage stats will be particularly helpful in creating relationships with local business for mutual benefit. As well as showing financial impact for immediate communities near a proposed new bike docking station. Data also includes weather information for all days.

Also included is a bike shop where visitors are able to peruse bike accessories. Visitors are able to create an account in order to login and checkout their cart.

System Dependencies ;

  • Ruby Version > 2.4.0
  • Rails 5.1.6

Gems:

Testing:

  • Run rspec for the test suite
  • SimpleCov data

Initial Setup:

Database Initialization:

  • CSV files load random samples of data, with a cutoff at 5,000 lines to keep the app heroku deployable.
  • Default accounts for admin and user (like a demo)
  • Default admin account appears in the seed file, and will seed to the database:
# Create default admin
User.create!(
 full_name: 'Admin Admin',
 username: 'admin',
 password: 'password',
 password_confirmation: 'password',
 email: '[email protected]',
 role: 1
)

Business Analytics: Robust data collection, with data points ranging from daily, regional weather conditions, to trip minute by minute trip durations. Deep data analysis to help drive business growth. Track daily average rides:

  def self.avg_rides_breakdown(min, max, attribute)
   trip_count = Trip.select("start_date, count(trips.id) as count").joins("join conditions ON conditions.date=trips.start_date").where("#{attribute} between ? and ?", min, max).group(:start_date).length
   trip_total = Trip.select("start_date, count(trips.id) as count").joins("join conditions ON conditions.date=trips.start_date").where("#{attribute} between ? and ?", min, max).group(:start_date).size.values.sum
   if trip_total > 0 && trip_count > 0
     trip_total / trip_count.to_f
   else
     0
   end
 end

Track rides by weather condition:

  def self.precip_breakdown
    ranges = {'half'=>{min: 0, max: 0.49},'one'=>{min: 0.5, max: 0.99},'one_half'=>{min: 1, max: 1.49},'two'=>{min: 1.5, max: 1.99},'two_half'=>{min: 2, max: 2.49},'three'=>{min: 2.5, max: 2.99},'three_half'=>{min: 3, max: 3.49}}
    precipitation_values = Hash.new { |hash, key| hash[key] = Hash.new(&hash.default_proc) }
    ranges.each do |precip_range, min_max|
      precipitation_values['max_rides'][precip_range] = Condition.max_rides_breakdown(min_max[:min], min_max[:max], 'precipitation')
      precipitation_values['avg_rides'][precip_range] = Condition.avg_rides_breakdown(min_max[:min], min_max[:max], 'precipitation')
      precipitation_values['min_rides'][precip_range] = Condition.min_rides_breakdown(min_max[:min], min_max[:max], 'precipitation')
    end
    precipitation_values
  end

Pull Request Template/Fork Repository The repositiory comes with a a pull request template. If you'd like to demo the appliation, just fork a copy, take it for a ride, and leave us feedback in your pull request.

Contact Information Feel free to contact us with any questions, comments, or suggestions:

Abdulla: https://github.com/abdullaqudrat Andrew: https://github.com/andrewetobin Harper: https://github.com/hbellows Mike: https://github.com/mikecm1141

bike-share's People

Contributors

abdullaqudrat avatar andrewetobin avatar hbellows avatar mikecm1141 avatar

Stargazers

 avatar

Watchers

 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.