Skip to content

Airport-API is an API designed to manage and provide airport-related information.

Notifications You must be signed in to change notification settings

Sparix/Airport-API

Repository files navigation

Airport-API

The Airport API service, built on Django REST, is specifically crafted to monitor flights originating from airports globally. Providing comprehensive details on airports, planes, flights, routes, and beyond, this API functions as a powerful tool for effectively managing and analyzing data associated with air travel.

Installing using GitHub

Before you begin, ensure you have met the following requirements:

  • Install PostgresSQL and create db
  • Python3 must be already installed.

Run the project locally without Docker

Installed

  1. Clone the repository:
git clone https://github.com/Sparix/Airport-API
  1. Go to the project directory:
cd Airport_API
  1. Create a virtual Python engine and activate it:
python -m venv venv 
source venv/bin/activate(on macOS)
venv\Scripts\activate(on Windows)
  1. Set the project assignments:
pip install -r requirements.txt

Configuration Environment Variables:

  • Create a file named .env, using .env.sample as an example.
  • Make sure you have replaced all the dummy keys with your actual data.
set SECRET_KEY=< secret_key >
set POSTGRES_HOST=< db_host_name >
set POSTGRES_DB=< db_name >
set POSTGRES_USER=< db_username >
set POSTGRES_PASSWORD=< password_db >

Starting the server

  1. Create database migrations:
python maange.py makemigrations
python manage.py migrate
  1. Load data to db:
python manage.py loaddata data_base.json
  1. Start the development server:
python manage.py runserver

The API should now be accessible at http://localhost:8000/

RUN with Docker

Docker should bу installed

docker-compose build
docker-compose up

Getting access

  • create user api/user/register/

  • get access token api/user/token/

  • To authenticate, include the obtained token in your request headers with the format:

 - Authorization: Bearer <your-token>

API Documentation

Features of the project:

  • Information Restriction: Communication between administrators and regular users is limited, ensuring users access only entitled information.

  • Airport Details: Retrieve comprehensive data on global airports, including names, airport codes, and proximity to major cities and countries.

  • Route Insights: Access details about different routes, encompassing departure and destination airport names along with the distance between them.

  • Airplane Details: Retrieve information about airplane, such as their names, types, passenger row counts, and seat numbers per row. The system includes a built-in function for downloading and storing airplane images.

  • Flight Overview: Obtain detailed flight information, including route specifics, departure and arrival times, aircraft details, and seat availability. Filter the flight list by departure and arrival dates for added convenience.

  • Order Status: Authenticated users can review their order information.

  • Ticket Details: Facilitates the addition of flight tickets, allowing users to specify row and seat numbers for the order.

  • Authentication Mechanism: Users can create profiles by providing an email address and password. The API employs JWT (JSON Web Tokens) authentication to safeguard sensitive flight data.

About

Airport-API is an API designed to manage and provide airport-related information.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages