In this project you will build a website to model a small community ridesharing app.
This is a stage 2 pair project.
There will be two main pieces of functionality:
- New passengers and drivers can sign up for the service and review their information
- Passengers can request and rate trips, and drivers can see their aggregated statistics
This project is meant to be exploratory. Take time to try to dive into each piece of Rails (routes, controllers, models, views). This project is built so that you and your partner can create the waves yourself based on the dependencies of the requirements given.
This project should demonstrate you ability to:
- Create multiple related Active Record Models
- Create models with validations and methods performing business logic
- Craft effective RESTful routing
- Work with a partner to create an attractive and functional Rails site
- Practice Agile methodology
- Work with a large amount of existing data in a rails app
Before you start writing any code:
- Review the requirements with your partner
- Create a Trello board
- Organize your tasks/stories
- Discuss who will do which tasks and when you will target completion
- What things should be done together as pairs vs individually?
- Organize your tasks/stories into iterations (a.k.a waves)
- Create a data diagram based on the data in the CSV files
Once the above is complete, this project:
- Requires a shared repo with your partner as a collaborator
- Requires you to create a Rails application which
- Conforms to Rails conventions on naming and inflection
- Is created by using
rails new .
you will create a new rails app inside of the fork folder instead of creating a new folder for your rails apprails new
will ask if you want to overwrite the existing filesREADME.md
anddb/seeds.rb
. Answern
to both of these (keep the existing file)
- Uses Postgresql as its database.
Your team shall submit a pull request with a link to your Trello board once you are done with this initial setup. This must be reviewed by an instructor before you may begin implementing the requirements.
However far you and your partner get, the application should have, at a minimum, the following features:
- Seeded data in your database from the original CSV files (see below)
- Multiple related Active Record models
- RESTful routing
- Deployed application to Heroku
- A "look and feel" that will make you and your partner happy!
We have provided sample data for your site in the form of CSV files. These files are located in the directory db/seed_data/
. We have also provided a seed script, db/seeds.rb
, to load these files into your database.
db/seeds.rb
assumes a few things about how your database is set up:
- There are
Driver
,Passenger
andTrip
models - These models are related in a certain way
- The field names of these models match the column names in the CSV files
This is the recommended way to configure this project, but not a hard requirement. If you've got a good reason to change the setup, feel free to edit db/seeds.rb
accordingly.
- Use git relentlessly
- Pair program on difficult problems and to share learning experiences
- Deploy early (two days before submission), deploy often.
- Business logic should be implemented in the model
- You will probably need nested routes, but avoid routes that are more than 2 levels deep
- Use Semantic HTML
- Make good use of partial views
- Regarding validations:
- Validations are useful for making sure your database records are sane, and you should make use of them on this project
- It is easy to validate too much! If it's not a hard requirement for your app to function, it probably shouldn't be a validation.
- If validations fail, let the user know why
This project has a lot of user stories, and it is likely you and your partner won't get to all of them. Here is our prioritized list of what's important for this project, based on this week's learning goals:
- CRUD operations on models with relations
- Creating new trips
- Model validations and reporting errors to the user
- Basic structure of a complex Rails app
- Deployment
- Complex business logic
- Driver earning and average rating
- Styling and design
Please use this list as you decide what to work on (or at the end of the week as you decide what features to cut).
- From any page, I can click a menu entry to...
- View a list of all passengers
- View a list of all drivers
- Create a new passenger
- Create a new driver
- From any form in the site, if processing the form submission fails, the user should be politely informed of what went wrong and how they can correct it
- On the passenger list page I can click on a passenger to see that passenger's details
- On the passenger's details page I can...
- See the total amount the passenger has been charged
- See a list of trips that passenger went on
- Clicking on a trip from the list will take me to a detail page for that trip
- Click links to edit and delete that passenger
- Add a new trip for this passenger
- An available driver is selected by the server
- The trip starts with no rating
- When adding a new passenger:
- The user must provide a name and phone number
- Don't worry about how the phone number is formatted
- On the driver list page I can click on a driver to see that driver's details
- On the driver's details page I can...
- See the driver's total earnings (total of each trip minus 15%)
- See the driver's average rating
- See a list of trips this driver has driven
- Clicking on a trip from the list will take me to a detail page for that trip
- Click links to edit and delete that driver
- When creating a new driver:
- The user must provide a name and VIN
- Don't worry about how the VIN is formatted
On the trip details page I can...
- View details of the trip
- Assign a rating (1-5) to the trip, if it does not already have one
- Click links to detail pages for the trip's driver and passenger
- Click links to edit and delete the trip