/skedaddle-fe

Skedaddle is a SOA-inspired Rails application. The frontend consumes API endpoints exposed by a backend consuming data from TrailAPI and Yelp Fusion API.

Primary LanguageRuby

Skedaddle

image

  • Skedaddle is a Rails application that has both frontend and backend repositories.
  • The frontend consumes API endpoints exposed by the backend, which is consuming data from TrailAPI and Yelp Fusion API.
  • This app creates a custom itinerary with three trails and three restaurants based on geodata.
  • This application utilizes a relational database to store user and itinerary data.
  • Google OAuth 2.0 is used to authenticate and authorize users
  • The application was deployed using CI/CircleCI on Heroku but can also be viewed on a local server.

📖 Table of Contents

Table of Contents
  1. ➤ Technical Requirements
  2. ➤ Project Files Description
  3. ➤ Routes
  4. ➤ Database Schema
  5. ➤ Getting Started
  6. ➤ Test Suite
  7. ➤ Scenario 1: Login
  8. ➤ Scenario 2: Search for a Destination
  9. ➤ Scenario 3: View Additional Trail Details
  10. ➤ Scenario 4: View Additional Restaurant Details
  11. ➤ Scenario 5: Save Itinerary or Search Again
  12. ➤ Scenario 6: Saved Itinerary
  13. ➤ Credits

💻 Technical Requirements

  • Ruby 2.7.4
  • Rails 5.2.6
  • RSpec-Rails 4.0.1
  • Bootstrap 4
  • Faraday
  • Figaro
  • Webmock
  • VCR
  • Capybara
  • SimpleCov
  • Launchy
  • Factory Bot
  • Faker
  • JSON API Serializer
  • Postman
  • Shoulda-Matchers

Installation instructions found in ➤ Getting Started

💾 Project Files Description

  • app/controllers/application_controller
    1. Application controller which includes helper method to account for current user
    2. Directs rendering of several elements based on whether a user has logged in

  • app/controllers/welcome_controller.rb
    1. Welcome page controller that initiates login via Google OAuth v2

  • app/controllers/sessions_controller.rb
    1. Sessions controller that checks for OmniAuth authentication and creates a new session for user if authentication is successful

  • app/controllers/dashboard_controller.rb
    1. Dashboard controller that creates user dashboard view which provides destination search functionality

  • app/controllers/itineraries_controller.rb
    1. Uses before_action to call backend API in order to receive data on trails and restaraunts based on the destination the user has searched for

  • app/models/user.rb
    1. User model that finds or creates a user after successful OAuth authentication for

  • app/models/itinerary.rb
    1. Itinerary model which references park and restaraunt objects created from API calls for

  • app/views/..
    1. Dynamic pages built in HTML and CSS using Bootstrap

Some other supporting files

  • spec
    1. Contains test suite files
    2. spec/fixtures/vcr_cassettes
      1. Subfolder that contains mocked data used in tests to prevent API endpoint calls every time testing suite is run

📂 Routes

Rails Routes
root welcome#index goes to welcome index page
get '/auth/:provider/callback' 'sessions#omniauth'
get '/dashboard' 'dashboard#show'
delete '/sessions' 'sessions#destroy'
get '/about' 'about_us_contact#about_us'
get '/contact' 'about_us_contact#contact'
resources '/itineraries' except: %i[edit update]

🖥️ Database Schema

image

📖 Getting Started

1. Create a new directory on your computer where you'd like the program to live.

$ mkdir /your_folder/skedaddle-fe

2. Navigate into the recently created directory.

$ cd /your_folder/skedaddle-fe

3. Copy the repository by clicking on the code button on Github repo page (using SSH).

183747041-40f47875-442e-4008-8d00-8c45bf2731fe

4. Clone the recently copied repository information into your currenty directory.

$ git clone git@github.com:JohnSantosuosso/skedaddle-fe.git

5. Open the repository in your preferred IDE. If you are using VSCode, use the code command shown below:

$ code .

6. Install dependencies found in Gemfile.

$ bundle install

10. Run migrations

$ rails db:{create,migrate,seed}

11. Initiate the application on your local server.

$ rails s

12. Open your favorite web browser and enter the URL in the address bar:

localhost:3000

✔️ Test Suite

To run the test suite, make sure you are in the root of the project and run:
bundle exec rspec

🔸 Scenario 1: Login

a. The user logs in using Google OAuth Services

ezgif com-gif-maker


🔸 Scenario 2: Search for a Destination

a. A user can search for a destination:

ezgif com-gif-maker-3

b. The user receives an itinerary with three nearby hiking trails and restaraunts:

ezgif com-gif-maker-4


🔸 Scenario 3: View Additional Trail Details

a. A user can visit the trail's website to view more information:

ezgif com-gif-maker-5


🔸 Scenario 4: View Additional Restaurant Details

a. A user can visit the restaurant's website to view more information:

ezgif com-gif-maker-6


🔸 Scenario 5: Save Itinerary or Search Again

A user has the option to save an itinerary or search again:

Screen Shot 2022-09-20 at 10 18 33 PM


🔸 Scenario 6: Saved Itinerary

a. User receives confirmation an itinerary has been saved:

image

b. User can delete a saved itinerary:

image



c. User can view saved itineraries:

image



d. Saved itineraries include a link to each itinerary:

image

📜 Credits

Nick Jones

GitHub Badge LinkedIn Badge

Drew MacNicholas

GitHub Badge LinkedIn Badge

Wes Miranda

GitHub Badge LinkedIn Badge

Eli Sachs

GitHub Badge LinkedIn Badge

John Santosuosso

GitHub Badge LinkedIn Badge

Project built as part of Turing School of Software and Design's Consultancy Competition.