Skip to content

Latest commit

ย 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

โœˆ๏ธ Flight Booking System

A full-stack web application to search, book, and manage flight tickets, built using ASP.NET Core Web API + MVC + SQL Server.


๐Ÿš€ Key Highlights

  • ๐Ÿ” Secure user authentication system
  • ๐Ÿ‘ฅ Role-based access control (User & Admin)
  • โœˆ๏ธ Real-time flight booking system
  • ๐ŸŽŸ Automatic ticket generation
  • ๐Ÿ“Š Admin dashboard for flight & booking management
  • ๐Ÿ”„ Dynamic seat availability tracking
  • ๐Ÿงฉ Clean architecture (MVC + Web API separation)

๐Ÿ›  Tech Stack

Backend (API)

  • ASP.NET Core Web API (.NET 8)
  • Entity Framework Core
  • SQL Server

Frontend (UI)

  • ASP.NET Core MVC (Razor Views)
  • Bootstrap 5
  • HttpClient (API Integration)

Database

  • SQL Server

๐Ÿง  System Architecture

  • MVC frontend communicates with Web API using HttpClient
  • Web API handles business logic and database operations
  • SQL Server stores user, flight, and booking data

Flow: User โ†’ MVC โ†’ Web API โ†’ Database โ†’ Response โ†’ MVC โ†’ UI


๐Ÿ‘ฅ Roles

๐Ÿ‘ค User

  • Register & Login
  • Search flights
  • Filter flights (Source, Destination, Date)
  • View flight details
  • Book tickets
  • View ticket confirmation
  • View booking history

๐Ÿ›  Admin

  • Login (role managed in database)

  • Manage flights:

    • Add flights
    • Edit flights
    • Delete flights
  • View bookings for each flight


โœจ Features

โœˆ๏ธ Flight Management

  • Add new flights
  • Edit flight details
  • Delete flights

Flight includes:

  • Flight Name
  • Company
  • Source โ†’ Destination
  • Departure & Arrival Time
  • Business & Economy Pricing
  • Seat Availability

๐ŸŽŸ Booking System

  • Select class (Economy / Business)
  • Select number of seats
  • Automatic price calculation
  • Booking stored in database
  • Ticket generated instantly

๐Ÿ“Š Seat Management Logic

  • Total Seats (fixed)
  • Available Seats (dynamic)
Available Seats = Total Seats - Booked Seats

โœ” Automatically updates after booking โœ” Prevents overbooking


๐Ÿ“‹ Booking History

Users can view:

  • Current bookings
  • Past bookings
  • Booking status

๐Ÿ” Search & Filter

Search flights by:

  • Flight Name
  • Company

Filter flights by:

  • Source
  • Destination
  • Date

๐ŸŽจ UI Features

  • Responsive Bootstrap UI
  • Role-based navigation
  • Clean cards and tables
  • Back navigation support
  • Professional layout

๐Ÿ“ธ Screenshots

๐Ÿ” Login Page

Login

๐Ÿ“Š Admin Dashboard

Dashboard

๐Ÿ“‹ Flight Listings (Home)

Flights

โœˆ๏ธ Flight Details

Details

๐ŸŽŸ Booking Page

Booking

๐ŸŽซ Ticket Confirmation

Ticket

๐Ÿ“– My Bookings

My Bookings

๐Ÿ“Š Flight-wise Bookings (Admin)

Bookings


๐Ÿ“ก API Endpoints

๐Ÿ‘ค Users

Method Endpoint Description
POST /api/Users/register Register
POST /api/Users/login Login
GET /api/Users/{id} Get user

โœˆ๏ธ Flights

Method Endpoint Description
GET /api/Flights Get all flights
POST /api/Flights Create flight
GET /api/Flights/{id} Get flight
PUT /api/Flights/{id} Update flight
DELETE /api/Flights/{id} Delete flight

๐ŸŽŸ Bookings

Method Endpoint Description
POST /api/Bookings Create booking
GET /api/Bookings Get all bookings
GET /api/Bookings/user/{userId} User bookings
GET /api/Bookings/flight/{flightId} Flight bookings

๐Ÿ—„ Database Schema

Users Table

  • UserId
  • Name
  • Email
  • MobileNumber
  • Password
  • Role

Flights Table

  • FlightId
  • FlightName
  • Company
  • Source
  • Destination
  • DepartureTime
  • ArrivalTime
  • BusinessSeatsTotal
  • EconomySeatsTotal
  • BusinessSeatsAvailable
  • EconomySeatsAvailable
  • BusinessPrice
  • EconomyPrice

Bookings Table

  • BookingId
  • UserId
  • FlightId
  • ClassType
  • SeatCount
  • TotalPrice
  • BookingDate
  • Status

๐Ÿš€ How to Run

Step 1 โ€” Run Web API

  1. Open FlightBooking.API
  2. Run project (F5)

API runs at:

https://localhost:7274

Swagger:

https://localhost:7274/swagger

Step 2 โ€” Run MVC

  1. Open FlightBooking.MVC
  2. Run project (F5)

โš™๏ธ Configuration

API Base URL (MVC)

File:

Services/ApiService.cs
client.BaseAddress = new Uri("https://localhost:7274/api/");

Database Connection

File: appsettings.json

"ConnectionStrings": {
  "DefaultConnection": "Server=.;Database=FlightBookingDB;Trusted_Connection=True;"
}

๐Ÿ› Troubleshooting

  • Ensure API is running before MVC
  • Check API Base URL
  • Verify endpoints (/api/...)
  • Check database connection
  • Ensure migrations are applied

๐Ÿ”ฎ Future Enhancements

  • JWT Authentication
  • Online payment integration ๐Ÿ’ณ
  • Email ticket confirmation ๐Ÿ“ง
  • Flight cancellation & refund
  • Advanced filtering (price, duration)
  • Deployment on Azure

๐Ÿ’ก Project Objective

To build a scalable flight reservation system with real-time seat management, secure booking, and seamless user experience.

๐Ÿ‘ฉโ€๐Ÿ’ป Author

Dheetchana K Final Year CSE Student


โญ If you like this project, give it a star!

About

A full-stack Flight Booking System built with ASP.NET Core Web API and MVC featuring real-time seat availability, ticket booking, and admin flight management.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages