Skip to content

sravan-kumar-ta/Flight-Routes-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Airport Route Manager

A Django-based web application for managing airport routes in a binary tree structure. This application allows users to create, visualize, and analyze routes between airports.

Features

  • Airport Management: Add airports as nodes in a binary tree structure
  • Tree Visualization: View the airport network as a binary tree
  • Route Analysis:
    • Find the shortest route between two airports
    • Find the longest route in the network
    • Calculate path lengths between airports

Project Structure

Airport/
├── config/              # Django project settings
│   ├── settings.py
│   ├── urls.py
│   └── wsgi.py
├── routes/              # Main application
│   ├── models.py       # AirportNode model
│   ├── views.py        # View functions
│   ├── forms.py        # Django forms
│   ├── urls.py         # URL routing
│   └── migrations/    # Database migrations
├── static/             # Static files (CSS, JS, images)
├── templates/          # HTML templates
│   ├── base.html
│   ├── home.html
│   ├── longest_route.html
│   ├── path_length.html
│   └── shortest_route.html
├── db.sqlite3          # SQLite database
└── manage.py           # Django management script

Technology Stack

  • Backend: Django 6.0.4
  • Database: SQLite3
  • Frontend: HTML, CSS, JavaScript
  • Python: 3.x

Installation

  1. Create a virtual environment:

    python -m venv venv
  2. Activate the virtual environment:

    • Windows: venv\Scripts\activate
    • Linux/Mac: source venv/bin/activate
  3. Install dependencies:

    pip install django
  4. Run migrations:

    python manage.py migrate
  5. Start the development server:

    python manage.py runserver
  6. Access the application: Open your browser and navigate to http://127.0.0.1:8000/

Usage

Adding Airports

  1. Navigate to the home page
  2. Use the airport form to add a new airport
  3. Specify:
    • Airport code (e.g., "JFK", "LAX")
    • Parent airport (if not root)
    • Position (Left or Right child)
    • Distance from parent (in KM)

Finding Routes

  • Shortest Route: Enter two airport codes to find the shortest path between them
  • Longest Route: View the longest route in the entire network
  • Path Length: Calculate the total distance between two airports

Database Model

AirportNode

Field Type Description
airport_code CharField Unique airport code (max 10 chars)
parent ForeignKey Self-referential parent node
position CharField ROOT, LEFT, or RIGHT
distance_from_parent PositiveIntegerField Distance in KM
created_at DateTimeField Auto-created timestamp

License

MIT License

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors