Skip to content

Conversation

@sydweisberg
Copy link

@sydweisberg sydweisberg commented Dec 9, 2024

VectorBike MVP by MMESS

Development Environment Setup

Some initial setup is required.

  • VectorBike requires Ruby 3.1.2 and Rails 7.0.3.1
  • This guide uses MySQL for database functionality. Set up and start a MySQL database on a socket connection with a username and password.
  • Create a .env file in the repository directory, add it to your .gitignore, and include the following:
    • MYSQL_USERNAME=<your_username>
    • MYSQL_PASSWORD=<your_password>
    • MYSQL_SOCKET=<path_to_socket>.sock
  • For access to the Stripe API, please reach out to Sydney Weisberg for the secret key. Store the key in your .env file as STRIPE_SECRET_KEY.
  • Execute the following commands from your repository directory:
    • bundle install
    • rails db:reset (reconfigures the database)
    • rails db:migrate (ensures schema is updated)
    • rake initial_import (loads CSV data, generates pseudo-random data for bike charge, bike status, and station capacity)
    • rails s (launches the web server)
  • Navigate to (http://localhost:3000/) in a browser.
    On each subsequent deployment, only rails s is required to launch the page. If changes to the schema, CSVs, or gems are made, perform all commands from bundle install onwards.

Functionality Description

Account Management

  • Users can create an account, sign in, and log out.
  • On the “Profile” page, users can view and edit their information or delete their account.
  • Users can add funds to their account via Stripe.
  • On the “Profile” page, the user’s ride history is displayed.

Site Navigation

  • Accessible via a top navigation bar.
  • Homepage includes an overview of VectorBike and a “Rent a Bike!” button linking to the rental page. “Rent” also links to the rental page.
  • “About” page provides detailed information about VectorBike and about the developers.
  • “Profile” page displays user-specific details.
  • Site features a footer with contact information.

Rental Process

  • Users can access the rental page via “Rent a Bike!” on the homepage or “Rent” in the navigation bar.
  • Stations are displayed in list or map view:
    • Map View: Shows station locations with clickable icons for station details and directions. Searchable dropdown allows station selection. The dropdown only shows stations with at least one available bike.
    • List View: Stations sortable by name, address, or available bikes.
  • Clicking a station opens a rental form to select an available bike (charged > 50%) and rental duration.

Rental Form

  • Options include “Return to Stations” to cancel or “Rent Now!” to complete the rental.
  • Invalid rentals (e.g., no bike selected) do not go through, and the user is shown an informative flash alert.
  • Non-logged-in users are redirected to the login page before proceeding.
  • If a rental is valid, and the user has enough funds, the rental goes through.

Rental Management

  • After a successful rental, users are brought to a success page with a countdown timer and options to return the bike or view all active rentals.
  • Users can have up to 5 active rentals.
  • The “View Bike Rentals” button lists all active rentals, with links to each rental’s countdown page.

Returning Bikes

  • Users select a return station from a dropdown in a pop-up.
  • Clicking “Return” processes the return, while “Close” cancels the action.
  • After returning a bike, users see a “thank you for returning your bike” screen.

Ride History and Metrics

  • The “Profile” page lists total biking hours, and the number of rides. Ride history is also displayed.
  • The top ten users with the most riding time have a badge displayed next to their name on the profile page.

Rental Limits

  • Users can have up to five active rentals.
  • With at least one active rental, users are routed to the “View Bike Rentals” page when they click “Rent” or “Rent a Bike!”.
  • Users with fewer than 5 rentals can rent additional bikes; users at the limit see a message indicating they have reached the maximum number of rentals.
  • Once all rentals are returned, users are routed to the stations list when they click “Rent” or “Rent a Bike!”.

Summary of Changes

  • Complete application styling overhaul
    • Extensive branding
    • Informative flash alerts have been added/styled
  • Users
    • Password validation
    • Account deletion
  • Stripe
    • Integration of Stripe API
    • Users can add funds to their accounts via STRIPE, and funds are deducted when rentals are made
  • Rentals
    • Users can now have up to active five rentals at one time
    • Current rentals table has been added
    • Bike return success screen has been added
    • Trip Tracking
    • Ride history is tracked and displayed
    • Top ten user badge has been added to profile page for users with the top ten most riding hours
  • Maps
    • Maps have station information embedded
  • Station Selection
    • Revamped station dropdown on map page including making elements clickable and filtering out stations without available bikes
    • Stations dropdown has been added to return bike popup
    • Stations are sortable by number of available bikes in list view

Recommended Walkthrough

  1. Navigate to the sign up page, and sign up for an account.
  2. Add funds to your account via the “Add Funds” button. We recommended putting at least $10.00 into your account. Use the card number “4242 4242 4242 4242” in the Stripe test API, provide a reasonable expiration date for the card (must not be expired), and fill all other fields with random data.
  3. Navigate to the rent page.
  4. Use the toggle at the top of the page to view the stations list and the embedded map/search function.
  5. Return to list view.
  6. Sort the list of stations by either name, address or number of available bikes by clicking on the corresponding part of the header.
  7. Select a station with at least one bike by clicking on its row (the number of available bikes is shown at the right end of each station’s row).
  8. In the rental form, select a bike and a duration.
  9. Press “Rent Now!”.
  10. Navigate away from the success page.
  11. Return to the rent page, observe it is the current rentals page rather than the station list.
  12. Click “Rent Another Bike” and repeat the rental process.
  13. Click “View Active Rentals” and observe that you now have two active rentals.
  14. Click on one of your rentals.
  15. Click the “Return Your Bike” button to start a bike return.
  16. Select the station you would like to return the bike to (We suggest Florence Bank station, the first station in the list when it refreshes).
  17. Click on “Rent” in the nav bar. Repeat the return steps to return your second rental.
  18. Click on a station you returned a bike to and confirm that it is once again listed in available bikes.
  19. Navigate to “Profile”.
  20. Observe that you now have two past rides.
  21. Click the “Delete Profile” button
  22. Confirm the deletion of your profile in the pop up.

Link to Application

Note: Users cannot add funds to their accounts on deployed site. For full functionality please follow the development environment instructions and visit http://localhost:3000/ in a browser.

https://vectorbike-ecfe326f48ab.herokuapp.com/

sydweisberg and others added 30 commits November 18, 2024 15:28
Made edit profile button link to profile edit page/form
…s and added an active boolean to the rental model.

Skye pls test I trust you to break this if it is possible.
Prevented users from accessing other profile pages
…yed. We can change this by removing the truncate.
…ntials. Also we had identical index.html.erb and new.html.erb pages, but we aren't routing to the index.html.erb page in sessions.
Tracking user hours and displaying them on profile page.
Flash alerts!!! They all need styling, but they are all showing up. I take that as a win.
Allow user to sort by number of available bikes.
Allow user to pick a station by name from dropdown when returning a bike.
SWorster and others added 30 commits December 7, 2024 15:52
Toggle map/list now has rounded interior corners
Fixed profile page layout and map spacing. Also changed size of rent a bike button and snail pic in header.
Reverted change to showing a user's balance in profile
changed stripe api instructions.
Fixed speech bubble overflowing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants