- 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
- β€ Technical Requirements
- β€ Project Files Description
- β€ Routes
- β€ Database Schema
- β€ Getting Started
- β€ Test Suite
- β€ Scenario 1: Login
- β€ Scenario 2: Search for a Destination
- β€ Scenario 3: View Additional Trail Details
- β€ Scenario 4: View Additional Restaurant Details
- β€ Scenario 5: Save Itinerary or Search Again
- β€ Scenario 6: Saved Itinerary
- β€ Credits
- 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
- app/controllers/application_controller
- Application controller which includes helper method to account for current user
- Directs rendering of several elements based on whether a user has logged in
- app/controllers/welcome_controller.rb
- Welcome page controller that initiates login via Google OAuth v2
- app/controllers/sessions_controller.rb
- Sessions controller that checks for OmniAuth authentication and creates a new session for user if authentication is successful
- app/controllers/dashboard_controller.rb
- Dashboard controller that creates user dashboard view which provides destination search functionality
- app/controllers/itineraries_controller.rb
- 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
- User model that finds or creates a user after successful OAuth authentication for
- app/models/itinerary.rb
- Itinerary model which references park and restaraunt objects created from API calls for
- app/views/..
- Dynamic pages built in HTML and CSS using Bootstrap
- spec
- Contains test suite files
- spec/fixtures/vcr_cassettes
- Subfolder that contains mocked data used in tests to prevent API endpoint calls every time testing suite is run
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] |
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).
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
bundle exec rspec
a. The user logs in using Google OAuth Services
a. A user can search for a destination:
b. The user receives an itinerary with three nearby hiking trails and restaraunts:
a. A user can visit the trail's website to view more information:
a. A user can visit the restaurant's website to view more information:
A user has the option to save an itinerary or search again:
a. User receives confirmation an itinerary has been saved:
b. User can delete a saved itinerary:
c. User can view saved itineraries:
d. Saved itineraries include a link to each itinerary:
Project built as part of Turing School of Software and Design's Consultancy Competition.