Skip to content

Calicoders MVP#265

Open
Sami-Aiyathurai wants to merge 186 commits intodeadroxy:masterfrom
meic-123:master
Open

Calicoders MVP#265
Sami-Aiyathurai wants to merge 186 commits intodeadroxy:masterfrom
meic-123:master

Conversation

@Sami-Aiyathurai
Copy link

Instructions for setting up the dev environment (e.g. installing gems, running rake tasks, or seeding the database)

Devise configuration(derived from configuration steps from this [tutorial](https://www.digitalocean.com/community/tutorials/how-to-set-up-user-authentication-with-devise-in-a-rails-7-application)):

  • Uncomment devise gem in gemfile, located at the end
  • Run bundle install
  • Run bundle exec rails g devise:install
  • Open config/initializers/devise.rb
  • Inside of the “Devise.setup do |config|” block, add the following line:
  • config.navigational_formats = ['/', :html, :turbo_stream]
  • Open app/views/layouts/application.html.erb
  • Inside the body tag, right above <%= yield %>, add the following lines:
  • <%= notice %>

  • <%= alert %>

  • Run bundle exec rails g devise user
  • Finally run bundle exec rails db:migrate.

Seeding the database with rake tasks:

  • Run rails db:migrate to set up the database
  • Run rake db:import_stations[stationdata_csv]
  • Run rake db:import_bikes[bike.csv]
  • Run rails assets:precompile

Set up Stripe in your computer references from (https://stripe.com/docs/stripe-cli) and (https://dashboard.stripe.com/test/webhooks/create?endpoint_location=local)

  1. Login to Stripe using team credentials:
  1. Install Stripe CLI
  • Add the path to the unzipped stripe.exe file to your Path environment variable.
  1. Login to Stripe CLI
  • Run stripe login and use the email and password from earlier
  1. Forward Events to the webhooks
  • Run stripe listen --forward-to http://127.0.0:3000/webhooks
  • Do not close this terminal when running application
  1. Trigger events with the CLI
    In a new terminal runstripe trigger payment_intent.succeeded

Complete description of the prototype's functionality

Our prototype opens to a Home Page, which welcomes the user to ValetBike. Within the header, there are links that take the user to different pages on our website. These links include: Home, About, How it Works, Map, Membership Plans, and Account. The logo on the left of the header can also be clicked to take the user to the Home Page.

Our Home Page currently has a bikeshare image and a brief welcome message.

The About Page provides a brief overview of ValetBike and it informs the users of ValetBike’s goals and missions. On this page, there is a button labeled “Discover Pricing Plans,” and it directs the user to the Membership Plans page when clicked.

The How It Works page shows a simple four step process for renting bikes with pictures.

The Map link displays a functional map that allows users to log in to rent bikes.

Membership Plans page displays three different pricing plans, weekly, monthly, and daily passes. If you click on any of the plans you will be redirected to a Stripe checkout page that allows you to buy the plan by entering your credit card information.

The Sign In page displays a functional sign in and sign up interface in which the user can input their email and password to log in. There is also an option to check the “remember me” box when signing in. If the password is forgotten, the user is able to click on “Forgot your Password?” to input their email for password reset instructions to be sent. After inputting their email, they can go to the “Log In” or “Sign Up” page. From the “Log In” page, if the user has not yet made an account, they are able click “Sign Up” to be taken to the signup page where they input an email, a password, and a password confirmation. From the “Sign Up” page, if the user already has an account, they can click the link to the “Log In” page.

The “Contact Page” in the footer contains information about how to contact Calicoders Valetbike

Once a user signs in, several things change.

The sign in button changes to say account. When the user hovers over Account, a drop down appears with a sign out button to sign out and a manage account button.

  • The manage account button takes the user to a page with an overview of their account, where they can view and edit their account

Additionally, the map button in the header is different depending on if the user has a bike checked out.

  • If the user has a bike currently checked out, then the header button says Return Bike and leads them to the Return Bike Map. If they do not have a bike checked out the button says Rent a Bike and leads the user to the Rent Bike Map.

The Rent Bike Map displays all of the stations with an available bike to rent. On the left, there is a list of those stations, that when clicked reveals more information about the station and a button to rent a bike.

  • After choosing a station to rent a bike from they are redirected to a page with all of the bikes available at that station so the user can choose the bike. When they click the bike number it redirects to a confirmation page with a rent button
  • If a user does not have an active membership, they are then redirected to the membership plans page where they are told to buy a membership before renting a bike.
  • If they do have an active membership then the user is redirected to a page that gives them a 5 digit alphanumeric code to input in the docking station to release the bike. Now they have a bike rented

The Return Bike button shows in the header when the user has a bike checked out. It redirects them to the Return Bike Map which is the same as the Rent Bike Map but displays all of the stations with an open slot to return the bikes, and contains a button to return a bike, which when clicked gives them a confirmation message.

Recommended walkthrough steps to observe key features

  • Run rails s from the valetbike directory to start the server.
  • Access the server using the following URL: http://localhost:3000/
  • You can click on any of the links in the header to access different pages.
  • The “About” page will introduce potential users to our team and product vision. You will also eventually be able to view pricing plans by clicking the button labeled “Discover Pricing plans”.
  • The “How it Works” page provides a simple tutorial on how to start renting bikes.
  • The “Map” page will allow users to view different bike stations, rent and return bikes depending on whether or not they are logged in and already have a bike checked out to them.
  • If logged in, the “Map” tab in the header becomes “Rent a Bike” and users will be shown a map of different stations with available bikes that they can rent by clicking the “rent a bike” button under their selected station and then by selecting which bike they want to rent. They will be shown a code that they could theoretically enter into the bike at the station they want to unlock it. The database will then be updated to reflect that they have an active trip.
  • If a user is logged in and already has a bike rented, the “map” tab becomes “Return Bike” and shows users available stations that have open slots. The user can click “return bike” and their bike will be returned. The database will be updated so they no longer have an active trip.
  • The “Membership Plans” page will allow users to view and select different membership types. Each membership type links to a stripe page to enter payment information and purchase a plan. To test stripe functionality, you can use the card number “4242 4242 4242 4242” with any expiration date and cv code. After purchasing, the chosen plan will be applied to the users account.
  • The “Sign in” link allows users to sign in or sign up for an account. All users must make an account to access our services. You can log in, sign up, or request a password reset.
  • The “Account” drop down allows users to edit their personal information and view their current membership plan.
  • The “Contact Us” link in the footer redirects users to a page which gives them our phone number and email address for contact.

Summary of changes made since the prototype:

  • Rental and return functionality
  • Finished howitworks and membership plan pages
  • Membership plan payment functionality
  • Tracking of active rentals
  • Changing of interface based on log in status and rental status
  • New page for editing and viewing user account details and membership details
  • Additional formatting and content added to most pages

Sami-Aiyathurai and others added 30 commits October 31, 2023 15:56
Added name
update bikes and stations
tables for users, memberships and transactions
finish print bikes and stations
Anhtran0208 and others added 30 commits December 10, 2023 01:51
Fixed database usage and worked on renting styling
finished styling for returning
removed:
accoutn_helper.rb
return.html.erb
payment_information_controller.erb
payment information folder + index
pay_information routes
active_trip/return routes
past_trips/index from routes
changed the styling on the membership buttons
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