Skip to content

Latest commit

 

History

History
357 lines (234 loc) · 5.63 KB

File metadata and controls

357 lines (234 loc) · 5.63 KB

✈️ 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!