markyv18 / bike-share

1 stars 0 forks source link

Bike Share

Abstract

In this project you'll use Ruby, Sinatra, and Activerecord to build a site that analyzes bike share usage in San Francisco.

This application will collect data in two ways: 1) through web forms allowing users to enter trip/station/weather information, and 2) by consuming CSV files with historical information for stations, trips, and weather. In addition to creating and storing this information for viewing at a later date, this application will provide a number of user dashboards with higher level analysis of trends in bike share usage.

At a high level, this project will develop along the following path:

Learning Goals

ActiveRecord

User Experience and Conventions

Code Organization/Quality

Testing

Working Collaboratively

Getting Started

Define the Relationship with Your Group

DTR with your group here. One group member should send a link of the forked gist to your anchor as soon as it's complete.

Clone the Project

  1. One team member forks this skeleton repository.
  2. Add the other team members as collaborators.
  3. Add instructors as collaborators.

Requirements

This project must use:

You'll want to set up the DatabaseCleaner gem in order to have a clean database each time you run tests. Follow the instructions for setting up the gem. Due to a bug in the most recent version of the gem, you'll need to use this line when you set the strategy in your test helper file:

  DatabaseCleaner.strategy = :truncation

See the "Resources" section at the bottom of this page for additional helpful documentation.

Before starting, make sure you have the Postgres App installed.

Restrictions

The project may not use:

Instructions

Iterations 0-9 must be completed in order to consider the project complete. Please use TDD throughout. Tests are expected for all features and all models.

Base Expectations

Iteration 1

Create full CRUD functionality for a station with the following characteristics:

Once you have the Station model started, finish it off by creating validations for the Station attributes.

You can use ActiveRecord's validations feature to make sure no record is saved without having all attributes present.

Be sure to have a test for each individual validation.

Also, be sure to normalize the table(s) that you build to hold this information, and to use restful routes. What's normalization you ask? Check out the homework assignments for Day 4 here and this overview.

Hint: Any data that will be repeated in a significant amount of rows in your stations table should probably be extracted to its own table.

At the end of this iteration, you should be able to view an index of all stations, view a page for a single station, create a station, edit a station, and delete a station from either the index or the show pages.

Iteration 2

Download the dataset available here. This will include all of the CSV files that you will be using in this project. Since these files are large, we have set up your project directory structure and .gitignore so that when you add these files to the /db/csv/ directory they will not be pushed up to GitHub. However, this also means that each of the members of your team will need to download these files independently. Please note that there are idiosyncracies in the data that are outlined in some detail here. These may not be important to you at this moment, but this will be an important reference as you move through future iterations.

Update the seed file in your /db directory and add the station.csv file to your /db/csv/ directory. When you run ruby db/seed.rb your development database should be populated with the information from the station.csv file. Your index should include a total of seventy stations.

Iteration 3

Create a station dashboard route. When you visit /station-dashboard you should be shown a page with the following information:

Iteration 4

Create full CRUD functionality for a trip with the following characteristics:

Note: Zip Code is a user-provided field, and may not be present on all records. Otherwise, as with Station's, all attributes of a Trip need to be present to ensure data integrity. Don't forget your validations and tests for each validation.

As with Iteration 1, be sure that you are working to normalize your database. This may mean using references to existing tables. At the end of this iteration users should be able to visit the following routes:

When a user visits the /trips path, they should only see the first thirty trips taken organized by date. On that page, there should also be a button to see the next thirty trips. Once a user visits a second page, there should be buttons to move both forward and backward in time.

Additionally, users should be able to delete a trip from the views rendered at both /trips/:id and /trips.

Iteration 5

Add the trip.csv file to your db/csv directory, and update your seed.rb file so that it also imports the information in trip.csv. Be sure to adjust your seed file so that when it is run it does not create duplicate data.

Iteration 6

Create a trips dashbord route. When you visit /trips-dashboard users should be shown a page with the following information:

On an individual station show page add the following information:

Iteration 7

Create full CRUD functionality for a day's weather conditions with the following characteristics:

At the end of this iteration users should be able to visit the following routes:

As with /trips, users should only be shown the weather conditions for thirty days when they visit /conditions and should be able to navigate to other pages with forward/backward buttons.

Additionally, users should be able to delete a the weather conditions for a particular date from the views rendered at both /conditions/:id and /conditions.

Iteration 8

Add the weather.csv file to your db/csv directory, and update your seed.rb file so that it also imports the information in weather.csv. Be sure to adjust your seed file so that when it is run it does not create duplicate data.

Iteration 9

Create a weather dashboard available at /weather-dashboard that includes the following information:

Add the following information to your trip dashboard:

Extensions

Evaluation Rubric

The project will be assessed with the following rubric:

1. Functional Expectations

2. ActiveRecord

3. User Experience and Conventions

4. Code Organization/Quality

5. Testing

6. Working Collaboratively