Skip to content

Latest commit

 

History

History
164 lines (108 loc) · 6.62 KB

README.md

File metadata and controls

164 lines (108 loc) · 6.62 KB

README

GTFO-BE

image

Table of Contents

What it does

This project part of a Service-Oriented Architecture (SOA) application that provides users with flight and weather information based on search parameters that the user provides. The GTFO-BE serves as an intermediary from the GTFO-FE repo and the Weather-API and Flight-API repos. This service collects data from both the Weather and Flight APIs and compiles the data into one service that the front end can call.

To view the production site, please visit the GTFO link.

To view the other components of the application please visit the Github Project Organization.

How to Install GTFO-BE

For usage on your local machine follow the instructions listed below:

git clone [email protected]:GetThatFlightOut/GTFO-BE.git
cd GTFO-BE
bundle install
rake db:{create,migrate}
figaro install
  #setup ENV variables in application.yml
    #FLIGHT_API_HOST: "https://flight-api-service.herokuapp.com/"
    #WEATHER_API_HOST: "https://gtfo-weather-api.herokuapp.com/"
rails s
get calls to: localhost:3000 in your web browser

API Contract

To see an example response like that below you can use Postman to send a GET request to our BE hosted on Heroku here: https://gtfo-be.herokuapp.com/api/v1/search

Required parameters:

:departure_airport - (string) - the IATA code of the origin airport

:departure_date - (string) - %d/%m/%y - the earliest date considered for departing flight

:trip_duration - (integer) - the number of days planned for the round trip

:limit - (integer) - the maximum number of results to be returned (default is currently 20 fo the index page)

Sample view of an API call in Postman: trips_call

This is an example of an error response for Invalid Data (Missing/Incorrect)

{
"error": "Invalid Data",
"status": 400
}

Asynchronous API Calls

Due to the sheer amount of data returned from the two APIs, our team decided to implement asynchronous threads with the Rails Executor. This operation allows GTFO to handle multiple HTTP requests simultaneously by running multiple threads, up to 20, to reduce response time by 50%.

Schema

Dependencies

  • figaro
  • faraday
  • fast_jsonapi
  • travis
  • webmock
  • vcr
  • shoulda-matchers
  • simplecov

Testing

  • For testing our team implemented Travis CI with RSpec

Travis CI is cloud based and when we submit a pull request, Travis will attempt to build our project and run the tests to ensure everything is working as expected.

RSpec is a tool for unit testing that will ensure we have the intended functionality at each level of our code.

  • In order to run the tests, run bundle exec rspec in the command line and you should have all passing tests.

Learning Goals

  • Consume two external APIs

  • Build API's that return JSON responses

  • Refactor code for better code for improved organization/readability

  • Practice project management with project boards/daily standups/group retros

  • Utilize workflow: small commits, descriptive pull requests and code review

  • Write thorough and understandable documentation

  • Utilize a Service-Oriented Architecture with a front-end, a back-end, and at least one micro-service

Licenses

  • Ruby 2.5.3
  • Rails 2.5.4.3
  • Travis CI Enterprise

Contact

Todd Estes: LinkedIn, Email, GitHub

Connor Ferguson: LinkedIn, Email, GitHub

George Soderholm: LinkedIn, Email, GitHub

Sage Freeman-Gonzales: LinkedIn, Email, GitHub

Sheryl Stillman: LinkedIn, Email, GitHub

Aidan Murray: LinkedIn, Email, GitHub

Jesse Mellinger: LinkedIn, Email, GitHub

Nick King: LinkedIn, Email, GitHub

Brian Liu: LinkedIn, Email, GitHub

Will Dunlap: LinkedIn, Email, GitHub

Acknowledgments

Thank you to Ian Douglas and Dione Wilson for being such amazing instructors and guiding us through this project!