Skip to content

BitRxp/airport-api-service

Repository files navigation

Airport API Service

API service for managing flight bookings, built using Django REST Framework.


Installation from GitHub

  1. Clone the repository:

    git clone https://github.com/BitRxp/airport-api-service.git
  2. Navigate to the project directory:

    cd airport_api_service
  3. Create and activate a virtual environment:

    python -m venv venv
    source venv/bin/activate  # On Windows: `venv\Scripts\activate`
  4. Install the required dependencies:

    pip install -r requirements.txt
  5. Configure environment variables:

    SECRET_KEY=<your-secret-key>
    DEBUG=<True/False>
    ALLOWED_HOSTS=<comma-separated-allowed-hosts>
    POSTGRES_PASSWORD=<your-postgres-password>
    POSTGRES_USER=<your-postgres-username>
    POSTGRES_DB=<your-database-name>
    POSTGRES_HOST=<your-database-host>
    POSTGRES_PORT=<your-database-port>
    PGDATA=<path-to-postgresql-data>
  6. Apply the database migrations:

    python manage.py migrate
  7. Run the development server:

    python manage.py runserver

Running with Docker

  1. Build the Docker images:

    docker-compose build
  2. Start the Docker containers:

    docker-compose up

Access Management

Creating a Superuser

  • Locally: Create a superuser by running:

    python manage.py createsuperuser
  • From within a Docker container:

    1. Access the container shell:
      docker exec -it <container_name> bash
    2. Create a superuser:
      python manage.py createsuperuser

Registering Regular Users

  • To register, use the API endpoint at /api/user/register.
  • Obtain a JWT authentication token at /api/user/token.

Features

  • JWT-based authentication
  • Request throttling to prevent abuse
  • Interactive API documentation at /api/schema/swagger-ui
  • Manage bookings, tickets, and associated data
  • Admin-only endpoints for creating airports, routes, crew members, airplanes, flight types, and schedules
  • Advanced filtering for routes and flights

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published