Code Monkey home page Code Monkey logo

praneethravuri / horizon-airlines-bookings Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 20.22 MB

Horizon Airlines Bookings is a Flask and MongoDB web app that streamlines flight bookings and management. Users can view flights, apply promo codes, and update personal info. The site has login authentication and account deletion options. This project is for the INFS 740 course at George Mason University, Spring 2023.

Python 39.00% HTML 37.16% CSS 17.93% JavaScript 5.92%
css flask html javascript jinja2 mongodb python jquery pymongo ajax

horizon-airlines-bookings's Introduction

INFS 740 Project (Spring 2023) - Horizon Airlines Bookings

George Mason University - MSCS

Project Installation (Docker)

  1. Pulling the Docker Image

docker pull praneeth2510/horizon-airlines-bookings

  1. Running the application

docker run -p 8080:8080 praneeth2510/horizon-airlines-bookings

Project Description

Horizon Airlines Bookings is a web application built with Flask and MongoDB, enabling users to easily book and manage flights. Users can view available flights, apply promo codes, and update their personal information, including email, name, and password. The site features a login authentication system and allows users to delete their account. The efficient booking system streamlines the process by only requiring payment information. In summary, Horizon Airlines Bookings offers a comprehensive airline management system with all essential features for an efficient booking experience.

Technologies

  • Frontend - Html, CSS, Javascript, JQuery
  • Backend - Flask, Javascript, Jquery
  • Database - MongoDB

Collections

  • Users
  • Flights
  • Bookings
  • Discount

Basic Queries (CRUD Operations)

  • Create a new account
  • Update name, email, and password of the user
  • Cancel flights
  • Check duplicate flight booking
  • Check pre-existing users in the database
  • Delete account of the user

Complex Queries

  1. Collections used - Users, Flights, Bookings

In the login.html form, users enter their email and password which are checked against the corresponding records in the MongoDB users collection. If the credentials are correct, the bookings for that email are retrieved. If the user_flights list is empty, "No bookings found" is displayed on the homepage.html. Otherwise, for each flight in the user_flights list, the flight ID is used to search the flights collection in MongoDB and all information about that flight is displayed on the homepage.html.

User Authentication Login.py
Display User Bookings Homepage.py




  1. Collections used - Users, Bookings, Flights

When the user selects the origin and destination locations, all available flights are displayed in flight.html. After selecting a flight, the user is directed to the payment page. Upon clicking the "confirm" button, if the user already has a booking with the same flight ID, an error is displayed. Otherwise, the flight ID is added to the user's booking list.

User Authentication Homepage.py
Display Searched Flights Flights.py
Confirm Flight Booking Payment.py




  1. Collections used - Users, Bookings, Flights, discount (Bonus Complex Query)

After selecting the origin and destination locations, all available flights are displayed in flight.html. Upon selecting a flight, the user is redirected to the payment page where, upon clicking "confirm," the system checks if the user has already booked the same flight. If yes, an error message is displayed. Otherwise, the flight ID is added to the user's booking list. Additionally, if the user enters a valid promo code, the price of the flight ticket is reduced based on the code entered. However, if an invalid promo code is entered, an error message is displayed.

User Authentication Homepage.py
Display Searched Flights Flights.py
Validate Promo Code Payment.py


Visualization

  1. A bar graph is created using the list of cities from where flights are departing, which shows the most busiest cities.

  2. A bar graph is generated using the list of cities to which flights are arriving, highlighting the most frequently visited cities.

  3. A node graph is created to represent the flight paths originating from various cities, which also displays the interconnected flights between two destinations.

All the visualizations are generated dynamically by visualization.py

Conslusion

In conclusion, this project is a fully functional web-based flight booking system that provides users with a convenient way to search and book flights. The system is designed with a user-friendly interface and includes features such as flight search, booking, and payment.

Overall, this project serves as a practical example of how web-based applications can be designed to provide a seamless and personalized user experience, making the booking process easier and more efficient for users.


Project Setup

1. Create virtual environment (Windows)

Delete env folder if it is already present in the project folder

python -m venv env

Navigate to env/Scripts

Run the command activate and go to the main project folder

2. Install necessary libraries

pip install flask pymongo matplotlib networkx

3. Go to services and check if MongoDB is running

4. Initialize the MongoDB in Command Prompt

mongod

5. In the virtual environment, run app.py

python app.py

6. Credentials, locations, promo codes

Credentials, locations, and promo codes can be found in the db_data folder. One can access them in the form of json or text files

horizon-airlines-bookings's People

Watchers

 avatar

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.