Giter Club home page Giter Club logo

escape_app's Introduction

About Escape

Escape is an interactive application that allows couples and groups to search for climbing and hiking routes near a travel destination. Start by signing in with Google, then pick a destination (i.e. city, hotel, spa, tourist attraction) and first activity (climbing or hiking). Choose your preferences for the activity, such as climb difficulty, type of climbing (Trad or Sport), distance you are willing to travel from the original destination, and minimum star rating. Save the hikes or climbs you are interested in from the results page and land on a page that includes your Trip's information and an interactive map with all the hikes and/or climbs you added to the trip. You can add more hikes and climbs from the Trip's show page at any time.

Ready to plan your trip? Head over to Escape's production page at escape-app!

Purpose Behind the Build

This ten-day group project focused on test-driven development in Ruby on Rails and Sinatra. It also served as a place to practice the skills we have been learning over the past four weeks including OAuth, consuming third-party APIs, exposing custom API endpoints, continuious integration/delivery and dividing monolithic applications into microservices.

Installation

Access Locally

This app is intended to work with a Sinatra microservice we developed, escape-microservice. Please reference the escape-microservice for installation instructions and endpoint details.

Clone the Rails app by running:

git clone [email protected]:mintona/escape_app.git

cd escape-app

bundle install

brew tap homebrew/cask && brew cask install chromedriver (to install Chromedriver for testing)

rake db:{create,migrate}

API Keys Required:

For authentication through Google OAuth: Google Client Id and Google Client Secret

For interactive maps on trip show pages: Google Maps API

Gems Used:

In Production:

  • Faraday
  • Figaro
  • Omniauth Google OAuth2

For Testing and Development:

  • pry
  • Capybara
  • factory_bot_rails
  • launchy
  • simplecov
  • shoulda-matchers
  • vcr
  • webmock
  • database cleaner active record
  • selenium-webdriver

Ruby and Rails Versions

  • Ruby 2.6.3
  • Rails 6.0.2.1

Database and Schema design

Schema Description

Testing

Our test suite is built in RSpecutilizing Capybara and Selenium for feature testing. The test coverage is 99%.

To run the full test suite, run bundle exec rspec

In order to view test coverage, run open coverage/index.html

Future Iterations

In future iterations, the dev team is hoping to include CRUD functionality for trips so users can edit trip names and delete trips. We would also like to add the ability to add campgrounds and other activities, such as mountain biking and running, to trips. Including these activities would enhance the user experience, making it a one stop shop for planning the adventurous side of a vacation.

Contributors

escape_app's People

Contributors

mintona avatar madelynrr avatar tyladevon avatar rallen20 avatar dependabot[bot] avatar

Watchers

James Cloos avatar  avatar

Forkers

madelynrr

escape_app's Issues

User Clicks Search Button - Sad Path

As a user
when I visit /search
if I do not enter a destination AND/OR
I do not enter an activity,
and click Search
a flash message is displayed alerting me to enter a destination
and I can try again

Subtasks:

  • Ideally, if they entered any additional information before pressing search, it should persist on the page

Image from iOS

User can login with Google OAuth

As a user,
when I visit the root page,
I want to click the Login with Google button so that I can login to the application using my google account.
I am redirected to /profile
Where I see text that says "Hello, <first_name>!"
And I see "Hi, <first_name" in the nav bar

  • test for brand new user
  • test for returning user
  • if i go back to the root page, I don't see the login button and I see text alerting me I'm already logged in

22EF05F4-E7DF-4EFA-9503-875B90EC845C_1_105_c

Root/Welcome Page

As a visitor
When I visit /
I see:

  • a button that says 'Sign-in with Google'
  • a nav bar (about)
  • text instructing me I must sign in with google to register and have access to the rest of the app

22EF05F4-E7DF-4EFA-9503-875B90EC845C_1_105_c

User can view details about a Route

As a logged in User,
when I see the results page,
I can click on a route name,
which is a link,
and am redirected to an external page (in a new tab) with more detailed information about that route.

B7F5DB18-C6B7-42A5-93F5-31B74793689A_1_105_c
1BD87F23-5C70-4430-BE4B-FC18287B914C_1_105_c

User Navigation

As you think of navigations, please add to the list

  • nav bar has link "About" which goes to /about
  • as a logged in user, i see my profile picture in the nav bar near my name (if i have one, if not, no image)
  • user home page needs a button to start a trip
    -[ ] logged in user should have a link to their profile in nav bar
  • logo should return home
  • logged in use who visits root needs to be taken care of
  • non logged in users should be shown errors for any path except welcome and about. right now they can access everything

User Can Search for Hikes

As a logged in user
When I visit "/search"
I enter my destination
I choose climbing
I am taken to /search/climbs/new
I can fill in:

  • distance (max distance from location)
  • max_results (how many hikes you want back)
  • min_stars (the lowest number of stars i want back)

I click Find Hikes!
I am on hikes/trips/new
I see the number of results found
I see a list of all the hiking results and the hike info:

  • name
  • summary
  • difficulty
  • stars
  • distance
  • elevation gain
  • max elevation
  • location

Each hike has a check box
I can select the hikes I want to add to my trip
I click on Save Selected Hikes
I am now on my trip show page
I see my hike titles as links (that go to hiking project) with the hikes:

  • name
  • summary
  • difficulty
  • stars
  • distance
  • elevation gain
  • max elevation
  • location
    I see my hikes on the map as green dots
    When I click the green dot
    I see the hikes:
  • name
  • difficulty
  • stars
  • length

User Clicks Search Button - Happy Path

As a user
when I am on /climbing
fill out all required fields*,
and click Continue
I am redirected to /results
where I see my search results

Subtasks:

  • There should instructions for user as to what is required and what is the default if they don't input anything
  • GooglePlaces and Mountain project API services should be set-up from 2 previous user stories

  • Clicking the Continue button:

  • Coordinates are combined with min/max difficulty & max distance to be used as search params for mountain project

  • climb type and rating are saved in a session(?)to be used to sort the returned climbs on the next page

Image from iOS (3)
Image from iOS (4)

Refactor Hikes

  • Add facade to remove calls to escape API from controllers

User Can Enter Search Params for Climbs

As a user
after I have chosen climbing as my activity
I am on / climbing
I choose from the following, which will be part of my search criteria:

  • minimum climb difficulty
  • maximum climb difficulty
  • max distance from destination (miles)
  • type of climb (trad or sport)
  • climb rating
  • Clicking the submit button will happen in the next story

Subtasks:

  • Create a list of difficulties for a drop-down to be used in both min and max difficulty: [5.4, 5.5, 5.6, 5.7, 5.8, 5.9, 5.10, 5.11, 5.12, 5.13, 5.14, 5.15]
  • There should be a validation that the minimum difficulty occurs earlier in the array than the max difficulty, either before the search button is clicked or upon clicking it
  • Set-up Mountain Project service/retrieval of data
  • Lat/lng from the destination will be used in the API call as lat and lon (should be in a session)
  • Limit the search results to 50 climbs (for now)
  • Be ready to take min and max difficulty and max distance from the destination as search params that will go in MP query
  • Type of climb (trade or sport) and climb rating will be used to sort in a Poro

Image from iOS (3)

User can view profile with index of saved trips.

  • As a user, when I visit /profile, I can see all of my saved trips and all account details for my account.

Sad:

  • If i have no saved trips
    I see text saying "You have no saved trips. Start a new trip!"

370A3818-44A9-4414-8273-C86827EBDE0B_1_105_c

User Can Select 1st Acvitiy

As a user
after I entered my destination and clicked 'Continue'
I am on /activity
I see a button for 'Climbing'
I see a button for 'Hiking'
When I click "Climbing",
I'm taken to to /climbing
When I click 'Hiking'
I'm taken to /hiking

Image from iOS (2)

User Sees Profile

As a user
When I have logged in successfully
I am on /profile
I see a button called Start a New Trip
I click the button and am on /search

Sad path:

  • visitor tries to visit /profile

370A3818-44A9-4414-8273-C86827EBDE0B_1_105_c

User can name trips

Spit this into 2 stories

  • As a user, when I create a new trip, I can change the name of the trip from the autogenerated name before clicking Save Trip.

  • As a user, when I visit a trip show page, I can change the name of the trip and then save my changes.

57639A0D-CC1B-40BD-909F-81AB32117ADE_1_105_c

Search Fields are Repopulated After Error

As a user
When I enter a location that doesn't exist on /search
But I have selected an activity
The activity I selected is still checked when the page renders

AND

As a user
When I enter a vaild location
but do not select an activity
my location is auto populated in the location field
when the page renders

User Can Add Another Activity

As a user
After I have saved my trip with climbing routes
I will be on the trip show page
I can click the button "Add Activity"
I will be on /activity
And can choose my next activity to go through that activity's search process

1BD87F23-5C70-4430-BE4B-FC18287B914C_1_105_c
Image from iOS (2)

View Search Results

As a logged in User, after filling in the search preferences including activity preferences, I am redirected to a results page, where I can view the results of that search. The results I see include:

  • Destination location
  • A section for Climbing route results and/or a section for Hiking route results(based on User input for search)
  • A name and information about each route

57639A0D-CC1B-40BD-909F-81AB32117ADE_1_105_c

User can delete routes from 'My Trip' show page

As a logged in User, when I visit 'My Trip' show page, I see a Destination, along with a list of routes in the Climbing and/or Hiking sections. Next to each route, I see a 'delete' button, where I can delete a route from the trip.

B7F5DB18-C6B7-42A5-93F5-31B74793689A_1_105_c

User can view climb details from Trip Show

  • done

As a logged in User,
when I visit 'My Trip' show page,
I click on a route name,
which is a link,
and am redirected to an external page with more detailed information about that route.

And I see each routes:

  • name
  • rating
  • type
  • stars

User can save trip

  • As a user, I search for a location and then once I select my route choices and click Save Trip, I am redirected to the newly created trip show page and I can see all details of that Trip.

Activity Page when adding to a trip

As a user
when I am adding activities to an existing trip
I am on /activity
I see the text "Choose an activity to add to your trip:"
I see a button for 'Climbing'
I see a button for 'Hiking'
When I click "Climbing",
I'm taken to to /climbing
When I click 'Hiking'
I'm taken to /hiking

Subtask:

  • current_trip method to know if there is a trip being edited?
  • will need to display different text than #30, as this is not the first activity

Image from iOS (2)

Navigation Refactor - Code Fair feedback

  • Add Log In button to help redirect a visitor away from the about page back to the log in with Google 2.0 OAuth page.

  • Add additional tool tips to display possible number input on all forms. Update PR with each change that was made.

User can logout

  • done

As a User
After I have logged in
I see a /logout link in the nav bar
I click on /logout
I see a flash message alerting me I have logged out
I am back on the welcome page
I no longer see my name in the nav bar

User can add Activity Routes to Trip and Save

As a logged in User, after I fill in the search information and I am redirected to the results page, I see a check box next to each Activity route in the results list. I can check as many boxes as I would like to add to my trip. At the bottom of the page, when I click 'save', a trip is created containing my destination and activity routes I selected with the check boxes. I am redirected to a 'My Trip' show page, where I can see the details of the Trip.

57639A0D-CC1B-40BD-909F-81AB32117ADE_1_105_c

User can Create a Trip

As a logged-in user, after I begin my search for a destination and activity, I am on the results ('/trip/new') page and can select routes to add to my trip. At the bottom of the page, I can click on 'Save Trip'. I am then redirected to the new Trip show page ("/trip/#{trip.id}"), where I see the activities sections (currently Climbing) with a list of the routes I selected for my trip on the previous page.

B7F5DB18-C6B7-42A5-93F5-31B74793689A_1_105_c

User Can Search by Location

As a logged in user
When I visit "/search"
I can enter a specific location
And find hiking trails nearby.

Render map on trip show page

  • As a user, when I visit a trip show page, I see a map with pins for all route locations and I see a pen of the original location that was searched.

  • As a user, when I visit a trip show page, I can click on a pin in the map and the associated route will be highlighted and/or focused.

User can start Search Over on Results page

As a logged in User, when I am on the Results page, I see a button at the bottom of the page called 'Start Search Over'. If I click this button, I am redirected to the Search page, where I can begin again with a Destination,

1BD87F23-5C70-4430-BE4B-FC18287B914C_1_105_c

User Can Enter Location

As a user
when I visit /search
I see the following:

  • a field to enter a destination
  • check boxes to choose climbing or hiking
  • a button "Continue"
    When I enter my destination properly
    And click "Continue"
    I am on /search/climbs

Sad:
If I fail to enter a destination
I am alerted via a flash message 'You must enter a destination'
And can try again

Sad:
If i fail to pick an activity
I am alerted via a flash message
I can try again

Subtasks:

  • set-up GooglePlaces Service to retrieve coordinates of the place
  • plan to save coordinates in session lat = json["candidates"][0]["geometry"]["location"]["lat"]
    lng = lat = json["candidates"][0]["geometry"]["location"]["lat"]
  • plan to save name `name = json["candidates"][0]["name"]
  • There is also a photoreference string that could be saved
  • This page should contain clues for searching ie "Enter the name of a destination. It be a city or an attraction, i.e. Los Angeles, Eiffel Tower"
  • Test for putting in an address

Image from iOS (1)

About Page

As a visitor or user
When I click on "About" from the nav bar
I am taken to the /about
Which has:

  • information on the app
  • developer info

Rails DB Setup

Trips table: (user has many trips, trip belongs to a user, has many trip_climbs, has many climbs through trip_climbs)

  • name (string)
  • destination_name (string)
  • destination_address (string)
  • lat (float)
  • lng (float)
  • user_id (foreign key)
  • Questions:
  • save max distance from location used in search?

Climbs table:(has many trip_climbs, has many trips through trip_climbs)

  • route_id (big int)
  • name (string)
  • climb_type (string... sport/trad)
  • rating (string, this is actually the difficulty of the climb)
  • stars (float)
  • pitches (int)
  • lat (float)
  • lng (float)
  • url (string)

Trip Cimbs table:(belongs to climb, belongs to trip)

  • trip_id (foreign key)
  • climb_id (foreign key)

Hikes

  • When we add hikes, we will need:
  • Hikes table
  • Trip hikes table

Screen Shot 2020-02-23 at 4 05 04 PM

User Clicks Button - Sad/Default

As a user
when I am on '/search/climbs' and
fail to fill out any of the required fields*, OR
I put in a value not supported by the api
and click Continue,
I am redirected to '/search/climbs' and
I am alerted of the error I need to fix
and I can re-fill in the climb preferences

If i leave optional fields blank, search will use defaults

Subtasks:

  • Ideally, anything entered by user should persist on the page.
  • Default settings for Mtn Project API should follow the documentation:
  • maxDistance = 30 miles
  • no difficulty params included
  • display all types of routes
  • no sorting by rating

Image from iOS (3)

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.