GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - EatMoreOranges/Flight-Engine: Mock flight data delivered simply and quickly without a database.

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

50 Commits
50 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
docs
docs
 
 
src
src
 
 
tests
tests
 
 
.babelrc
.babelrc
 
 
.env.sample
.env.sample
 
 
.eslintrc
.eslintrc
 
 
.gitignore
.gitignore
 
 
.prettierignore
.prettierignore
 
 
.prettierrc
.prettierrc
 
 
Authors.md
Authors.md
 
 
Flight Engine.postman_collection.json
Flight Engine.postman_collection.json
 
 
LICENSE.md
LICENSE.md
 
 
README.md
README.md
 
 
THIRD-PARTY-NOTICES.txt
THIRD-PARTY-NOTICES.txt
 
 
app.json
app.json
 
 
jest.config.js
jest.config.js
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
tsconfig.build.json
tsconfig.build.json
 
 
tsconfig.json
tsconfig.json
 
 

Repository files navigation

Flight Engine

Mock flight data delivered simply and quickly without a database.

Let's Get Started

👉 I just want flight data

👉 I want a backend that I can customize


Deploy Flight Engine and Use Now

If you would like to just use Flight Engine as we have designed it, deploy a copy to Heroku using the button below.

NOTE: If you go with this approach, you will not be able to customize Flight Engine.

Deploy


Retrieving Data

Once your app is up and running (either locally or hosted somewhere like Heroku), make HTTP requests to retrieve the data documented below.

Airport Information

Each endpoint displays information related to the airport whose IATA (Airport Code) is provided with the request:

Examples

Get the details of a given airport by its IATA (Airport Code)

URL : /airports?code=<IATA-CODE>

Method: GET

Auth required: No

Permissions required: None

Success Response:

Code: 200 OK

Respones

{
  "code": "DFW",
  "city": "Dallas-Fort Worth",
  "timezone": "America/Chicago",
  "location": {
    "latitude": 32.8998,
    "longitude": 97.0403
  }
}

404 Response

Airport not found

Malformed Request Response

Please enter a valid flight code i.e. DFW, GSO, ATL...

Get the details of all supported airports

URL : /airports/all

Method: GET

Auth required: No

Permissions required: None

Success Response:

Code: 200 OK

Respones

[
  {
    "code": "DFW",
    "city": "Dallas-Fort Worth",
    "timezone": "America/Chicago",
    "location": {
      "latitude": 32.8998,
      "longitude": 97.0403
    }
  },
  {
    "code": "JFK",
    "city": "New York City",
    "timezone": "America/New_York",
    "location": {
      "latitude": 40.6413,
      "longitude": 73.7781
    }
  }
  //...
]

Flight Information

Examples

Get the details of a given airport by its IATA (Airport Code)

Default Request

URL : /flights?date=YYYY-MM-DD

Method: GET

Auth required: No

Permissions required: None

Success Response

Code: 200 OK

[
  {
    "flightNumber": "0978",
    "origin": {
      "code": "DFW",
      "city": "Dallas-Fort Worth",
      "timezone": "America/Chicago",
      "location": {
        "latitude": 32.8998,
        "longitude": 97.0403
      }
    },
    "destination": {
      "code": "PHL",
      "city": "Philadelphia",
      "timezone": "America/New_York",
      "location": {
        "latitude": 39.8729,
        "longitude": -75.2437
      }
    },
    "distance": 7393,
    "duration": {
      "locale": "18h 36m",
      "hours": 18,
      "minutes": 36
    },
    "departureTime": "2017-08-29T02:36:00.000-05:00",
    "arrivalTime": "2017-08-29T22:12:00.000-04:00",
    "aircraft": {
      "model": "321",
      "passengerCapacity": {
        "total": 181,
        "main": 165,
        "first": 16
      },
      "speed": 400
    }
  },
  "..."
]

Flight Record From Specified Airport Destination Request

Will display flights filtered by airport destination

URL : /flights?date=YYYY-MM-DD&destination=<IATA-CODE>

Method: GET

Auth required: No

Permissions required: None

Success Response

Code: 200 OK

Examples

Flights by Destination

Sample Endpoint : /flights?date=YYYY-MM-DD&destination=GSO

[
  {
    "flightNumber": "8124",
    "origin": {
      "code": "DFW",
      "city": "Dallas-Fort Worth",
      "timezone": "America/Chicago",
      "location": {
        "latitude": 32.8998,
        "longitude": 97.0403
      }
    },
    "destination": {
      "code": "GSO",
      "city": "Greensboro",
      "timezone": "America/New_York",
      "location": {
        "latitude": 36.0726,
        "longitude": -79.792
      }
    },
    "distance": 7675,
    "duration": {
      "locale": "21h 46m",
      "hours": 21,
      "minutes": 46
    },
    "departureTime": "2021-08-29T05:10:00.000-05:00",
    "arrivalTime": "2021-08-30T03:56:00.000-04:00",
    "aircraft": {
      "model": "757",
      "passengerCapacity": {
        "total": 176,
        "main": 160,
        "first": 16
      },
      "speed": 380
    }
  },
  {
    "flightNumber": "1643",
    "origin": {
      "code": "DFW",
      "city": "Dallas-Fort Worth",
      "timezone": "America/Chicago",
      "location": {
        "latitude": 32.8998,
        "longitude": 97.0403
      }
    },
    "destination": {
      "code": "GSO",
      "city": "Greensboro",
      "timezone": "America/New_York",
      "location": {
        "latitude": 36.0726,
        "longitude": -79.792
      }
    },
    "distance": 7675,
    "duration": {
      "locale": "20h 50m",
      "hours": 20,
      "minutes": 50
    },
    "departureTime": "2021-08-29T09:25:00.000-05:00",
    "arrivalTime": "2021-08-30T07:15:00.000-04:00",
    "aircraft": {
      "model": "321",
      "passengerCapacity": {
        "total": 181,
        "main": 165,
        "first": 16
      },
      "speed": 400
    }
  },
  "..."
]

Flight Record From Specified Airport Origin Request

Will display flights filtered by airport destination

URL : /flights?date=YYYY-MM-DD&origin=IATA-CODE

Method: GET

Auth required: No

Permissions required: None

Success Response

Code: 200 OK

Examples

Flights by Origin

Sample Endpoint : /flights?date=YYYY-MM-DD&origin=PHL

[
  {
    "flightNumber": "0216",
    "origin": {
      "code": "PHL",
      "city": "Philadelphia",
      "timezone": "America/New_York",
      "location": {
        "latitude": 39.8729,
        "longitude": -75.2437
      }
    },
    "destination": {
      "code": "SAN",
      "city": "San Diego",
      "timezone": "America/Los_Angeles",
      "location": {
        "latitude": 32.7338,
        "longitude": -117.1933
      }
    },
    "distance": 2368,
    "duration": {
      "locale": "6h 38m",
      "hours": 6,
      "minutes": 38
    },
    "departureTime": "2021-08-29T02:18:00.000-04:00",
    "arrivalTime": "2021-08-29T05:56:00.000-07:00",
    "aircraft": {
      "model": "757",
      "passengerCapacity": {
        "total": 176,
        "main": 160,
        "first": 16
      },
      "speed": 380
    }
  },
  {
    "flightNumber": "3815",
    "origin": {
      "code": "PHL",
      "city": "Philadelphia",
      "timezone": "America/New_York",
      "location": {
        "latitude": 39.8729,
        "longitude": -75.2437
      }
    },
    "destination": {
      "code": "SAN",
      "city": "San Diego",
      "timezone": "America/Los_Angeles",
      "location": {
        "latitude": 32.7338,
        "longitude": -117.1933
      }
    },
    "distance": 2368,
    "duration": {
      "locale": "6h 1m",
      "hours": 6,
      "minutes": 1
    },
    "departureTime": "2021-08-29T03:48:00.000-04:00",
    "arrivalTime": "2021-08-29T06:49:00.000-07:00",
    "aircraft": {
      "model": "738",
      "passengerCapacity": {
        "total": 160,
        "main": 144,
        "first": 16
      },
      "speed": 400
    }
  },
  "..."
]


Malformed Request Response

'date' value (2017-08-299) is malformed; 'date' must use the following format: YYYY-MM-DD

Missing Date Response

'date' is a required parameter and must use the following format: YYYY-MM-DD

Testing

This project utilizes framework uses Facebook's Jest framework for testing.

Writing a test is as simple as creating a *.test.ts file in the ./src directory along with an associated describe() and it() function.

Simply run npm run test to run the existing test suite or use it to execute your own tests once you've created new ones.

Additional testing scripts:

  • test: runs all tests
  • test:changed: runs tests related to uncommited git changes only

Contributing

Interested in contributing to the project? Check out our Contributing Guidelines.

About

Mock flight data delivered simply and quickly without a database.

Resources

Readme
License

Contributing

Contributing
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.