GithubHelp home page GithubHelp logo

dennmart / airport_gap Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 1.0 4.95 MB

A fully-functional API to help you improve your test automation skills.

Home Page: https://airportgap.com/

License: MIT License

Ruby 34.81% JavaScript 2.74% CSS 1.25% HTML 58.98% Procfile 0.06% Shell 1.15% Dockerfile 1.01%

airport_gap's Introduction

Airport Gap

Airport Gap is a RESTful API to help you improve your API automation testing skills. It provides access to a database of airports, calculate distances between airports, and allows you to save your favorite airports.

You can create a free Airport Gap account at https://airportgap.com/.

Airport data is provided by OpenFlights.org under the Open Database License.

Airport Gap is provided by Dev Tester - articles and tips to help you improve your test automation skills as a developer.

QuickStart: Setting up and running the application locally

Airport Gap is a Rails 7 application. You need the following dependencies installed to run the application:

  • Ruby (current version: 3.3.4)
  • Bundler (current stable 2.x version)
  • Yarn (current stable version)
  • PostgreSQL (version 12.0 or greater)
  • Foreman (current version)

Once the dependencies are installed, run ./bin/setup to set up the application. The script will perform the following steps automatically:

  • Install Ruby dependencies (bundle install)
  • Install Javascript dependencies (yarn install)
  • Set up the database with seed data (rails db:prepare)

When everything is installed, run ./bin/dev to start all the required processes to build the CSS and JavaScript and start the application server. The application will be accessible at http://localhost:5000/.

Automated tests

The Airport Gap application has a suite of automated tests to help during development.

Unit tests are set up with RSpec. To run the tests, set up the application's Ruby dependencies (bundle install) and a test database, and run rails spec.

End-to-end tests for the API are covered with APId. To run the tests, download the APId binary, set it up in your PATH, and run apid check. The tests require the following environment variables:

  • AIRPORT_GAP_API_URL: The URL of the API endpoints. If you're running the application locally, the URL is http://localhost:5000/api.
  • AIRPORT_GAP_EMAIL: The email address for a valid Airport Gap account in the application.
  • AIRPORT_GAP_PASSWORD: The password for the Airport Gap account in the application.

Docker

A Dockerfile is provided to run the application in a Docker container. You can build the container locally with docker build -t airport-gap ..

To run Airport Gap using a built Docker image, you can use Docker Compose to spin up the application and its required services. The example docker-compose.yml file below starts a PostgreSQL database, a Redis server, and the Airport Gap application.

version: "3.9"
services:
  web:
    image: airportgap:latest
    ports:
      - 3000:3000
    links:
      - postgres
      - redis
    environment:
      - RAILS_ENV=production
      - RACK_ENV=production
      - PGHOST=postgres
      - PGUSER=airport_gap_user
      - PGPASSWORD=airport_gap
      - DATABASE_URL=postgres://airport_gap_user:airport_gap@postgres:5432/airport_gap_db
      - REDIS_URL=redis://redis:6379/0
      - RAILS_SERVE_STATIC_FILES=true
      - RAILS_LOG_TO_STDOUT=true
      - SECRET_KEY_BASE=dsjkfhsdjfhsdjk
    depends_on:
      - postgres
      - redis
  postgres:
    image: postgres:15.2
    expose:
      - 5432
    environment:
      - POSTGRES_DB=airport_gap_db
      - POSTGRES_USER=airport_gap_user
      - POSTGRES_PASSWORD=airport_gap
  redis:
    image: redis:7.0.11
    expose:
      - 6379

To seed the database with data, run docker-compose exec web bundle exec rails db:setup. You can then access the application at http://localhost:3000/.

Kamal

This repo contains the necessary configuration for Kamal deployments. The config/deploy.yml file contains an example configuration file for deploying Airport Gap to a remote server.

For more details on deploying a Rails application using Kamal using Airport Gap as an example, check out the video "Rails Deployments Made Easy with Terraform and Kamal" on YouTube.

airport_gap's People

Contributors

dennmart avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

mario-bros

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.