Skip to content

About

ARDPS is a scalable airline management platform that handles flight scheduling, bookings, ticketing, passenger records, and seat management. Powered by MongoDB, it supports high-speed operations and smart dynamic pricing based on demand, occupancy, and travel trends.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Airline Reservation and Dynamic Pricing System (ARDPS)

Version License Status

A comprehensive, mission-critical platform for managing airline operations with real-time seat inventory management and demand-based dynamic pricing.

Features β€’ Architecture β€’ Getting Started β€’ API Reference β€’ Team


πŸ“‹ Table of Contents


🌟 Overview

The Airline Reservation and Dynamic Pricing System (ARDPS) is a high-availability platform designed to handle the complete lifecycle of airline operations. It manages flight scheduling, seat inventory, passenger profiles, bookings, ticketing, and implements intelligent dynamic pricing strategies based on demand and occupancy rates.

This system is built with MongoDB as the document database to handle hierarchical data structures, flexible schemas, and high-throughput operations required in the aviation industry.

Key Business Objectives

  • ✈️ Flight Management: Complete lifecycle from scheduling to completion
  • 🎫 Booking & Ticketing: Seamless reservation and e-ticket generation
  • πŸ’° Dynamic Pricing: Real-time fare adjustment based on demand and occupancy
  • πŸ‘₯ Passenger Management: Comprehensive passenger profiles and frequent flyer tracking
  • πŸ” Concurrency Control: Atomic seat reservations with temporary seat holds
  • πŸ“Š Analytics & Admin: Comprehensive system administration and reporting

✨ Features

Core Flight Operations

  • Flight Scheduling: Create and manage flight routes with multiple departure times
  • Real-Time Seat Inventory: Track seat availability across different cabin classes (Economy, Business, First Class)
  • Concurrent Seat Hold: Temporary seat locking mechanism to prevent double-booking during peak traffic
  • Seat Allocation Management: Assign and manage seats with automatic availability updates

Passenger Management

  • Passenger Profiles: Maintain comprehensive passenger information and travel history
  • Frequent Flyer Program: Track loyalty points and membership tiers
  • Travel Preferences: Store passenger preferences for seamless booking experience
  • Documentation: Manage passenger documents and travel requirements

Booking & Ticketing

  • Smart Search: Advanced flight search with multiple filters and sorting options
  • Atomic Booking: ACID-compliant booking transactions ensuring data consistency
  • Instant E-Ticket Generation: Auto-generated e-tickets with PNR numbers
  • Booking History: Complete booking record with payment snapshots
  • Cancellation & Refunds: Flexible cancellation policies with refund processing

Dynamic Pricing Engine

  • Demand-Based Pricing: Automatic fare adjustment based on occupancy percentage
  • Advance Booking Brackets: Special rates for early bird bookings
  • Seasonal Pricing: Different pricing rules for peak and off-peak seasons
  • Price Preservation: Historical fare logging to track actual price paid at booking time
  • Pricing Rules Management: Flexible rule engine for custom pricing scenarios

Administrative Features

  • Dashboard Analytics: Real-time system statistics and performance metrics
  • User Management: Administrative control over system users
  • Report Generation: Automated PDF and presentation generation
  • System Maintenance: Database seeding, collection management, and debugging tools

πŸ—οΈ Technology Stack

Backend

  • Runtime: Node.js
  • Framework: Express.js 4.18.2
  • Database: MongoDB 6.3.0
  • Middleware: CORS for cross-origin requests
  • Additional Libraries: PPTXGenJS for report generation

Frontend

  • Markup: HTML5
  • Styling: Custom CSS with modern design patterns
  • Client Logic: Vanilla JavaScript (ES6+)
  • UI Patterns: Glass-morphism and responsive design

Architecture

  • Pattern: Model-View-Controller (MVC) with API-driven architecture
  • Communication: RESTful API
  • Database Type: NoSQL Document Database (MongoDB)

πŸ›οΈ System Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    FRONTEND LAYER                       β”‚
β”‚  (HTML5, CSS, Vanilla JavaScript - SPA)                 β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚ Search β”‚ Passengers β”‚ Bookings β”‚ Tickets β”‚ Admin β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                     β”‚
                     β”‚ REST API (JSON)
                     β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   BACKEND LAYER                         β”‚
β”‚              (Express.js REST API)                      β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚  /api/flights    - Flight operations             β”‚   β”‚
β”‚  β”‚  /api/passengers - Passenger management          β”‚   β”‚
β”‚  β”‚  /api/bookings   - Booking operations            β”‚   β”‚
β”‚  β”‚  /api/tickets    - Ticket generation             β”‚   β”‚
β”‚  β”‚  /api/pricing    - Dynamic pricing engine        β”‚   β”‚
β”‚  β”‚  /api/admin      - Administrative endpoints      β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                     β”‚
                     β”‚ Connection Pool
                     β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   DATA LAYER                            β”‚
β”‚              (MongoDB Database)                         β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚  Collections:                                    β”‚   β”‚
β”‚  β”‚  β€’ airports, aircraft, flights                   β”‚   β”‚
β”‚  β”‚  β€’ passengers, bookings, tickets                 β”‚   β”‚
β”‚  β”‚  β€’ pricing_rules, seat_holds                     β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“ Project Structure

airport_reservation_system/
β”œβ”€β”€ backend/                          # Backend application
β”‚   β”œβ”€β”€ config/
β”‚   β”‚   └── db.js                    # MongoDB connection configuration
β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”œβ”€β”€ admin.js                 # Administrative endpoints
β”‚   β”‚   β”œβ”€β”€ bookings.js              # Booking management endpoints
β”‚   β”‚   β”œβ”€β”€ flights.js               # Flight operations endpoints
β”‚   β”‚   β”œβ”€β”€ passengers.js            # Passenger management endpoints
β”‚   β”‚   β”œβ”€β”€ pricing.js               # Dynamic pricing endpoints
β”‚   β”‚   └── tickets.js               # E-ticket generation endpoints
β”‚   β”œβ”€β”€ seed.js                      # Database seeding script
β”‚   β”œβ”€β”€ server.js                    # Express server entry point
β”‚   └── package.json                 # Backend dependencies
β”‚
β”œβ”€β”€ frontend/                         # Frontend application
β”‚   β”œβ”€β”€ index.html                   # Main SPA entry point
β”‚   β”œβ”€β”€ admin.html                   # Admin panel (if separate)
β”‚   β”œβ”€β”€ css/
β”‚   β”‚   └── style.css                # Unified styling
β”‚   └── js/
β”‚       └── app.js                   # Frontend application logic
β”‚
β”œβ”€β”€ Utility Scripts
β”‚   β”œβ”€β”€ collection_create.js         # MongoDB collection initialization
β”‚   β”œβ”€β”€ debug.js                     # Debugging utilities
β”‚   β”œβ”€β”€ insert_data.js               # Data insertion scripts
β”‚   β”œβ”€β”€ generate_doc.js              # Documentation generation
β”‚   β”œβ”€β”€ generate_ppt.js              # PowerPoint report generation
β”‚   └── seed.js                      # Database seeding
β”‚
└── Documentation
    β”œβ”€β”€ ARDPS_Assignment1_Refined.md # Detailed system documentation
    β”œβ”€β”€ ARDPS_Assignment1_Refined.html# HTML documentation
    β”œβ”€β”€ er_diagram_chen.html         # Entity Relationship diagram
    └── diagrams.html                # System diagrams

πŸš€ Getting Started

Prerequisites

  • Node.js (v14 or higher)
  • npm or yarn package manager
  • MongoDB (local instance or MongoDB Atlas connection)
  • Git (for version control)

Installation

  1. Clone the Repository

    cd airport_reservation_system
  2. Install Backend Dependencies

    cd backend
    npm install
  3. Install Frontend Dependencies (if using separate build)

    cd ../frontend
    npm install
  4. Configure Database Connection

    Update backend/config/db.js with your MongoDB connection string:

    const mongoURI = process.env.MONGODB_URI || "mongodb://localhost:27017/ardps";
  5. Initialize Database

    cd backend
    node seed.js          # Seed initial data

Running the Application

Development Mode

cd backend
npm run dev

The application will start on http://localhost:3000

Production Mode

cd backend
npm start

Environment Variables

Create a .env file in the backend directory:

PORT=3000
MONGODB_URI=mongodb://localhost:27017/ardps
NODE_ENV=development

πŸ“‘ API Reference

Base URL

http://localhost:3000/api

API Endpoints Overview

Flights (/api/flights)

  • GET / - Retrieve all flights with filters
  • GET /:id - Get flight details by ID
  • POST / - Create new flight
  • PUT /:id - Update flight information
  • DELETE /:id - Delete flight

Search Example:

curl "http://localhost:3000/api/flights?origin=MAA&destination=BLR&date=2025-06-15"

Passengers (/api/passengers)

  • GET / - List all passengers
  • GET /:id - Get passenger details
  • POST / - Register new passenger
  • PUT /:id - Update passenger profile
  • DELETE /:id - Remove passenger

Bookings (/api/bookings)

  • GET / - List all bookings
  • GET /:id - Get booking details
  • POST / - Create new booking
  • PUT /:id - Update booking
  • DELETE /:id - Cancel booking

Booking Payload Example:

{
  "passengerId": "P123",
  "flightId": "FL456",
  "seats": ["12A", "12B"],
  "cabinClass": "economy",
  "paymentMethod": "credit_card"
}

Tickets (/api/tickets)

  • GET / - List all tickets
  • GET /:pnr - Get ticket by PNR number
  • POST / - Generate e-ticket
  • PUT /:id - Update ticket

Pricing (/api/pricing)

  • GET / - Get all pricing rules
  • GET /flight/:flightId - Get dynamic price for flight
  • POST / - Create pricing rule
  • PUT /:id - Update pricing rule

Admin (/api/admin)

  • GET /stats - System statistics
  • GET /reports - Generate reports
  • POST /backup - Database backup
  • POST /seed - Reseed database

πŸ—„οΈ Database Schema

Collection Architecture Diagram

Collection Architecture β€” ARDPS

Relationships:

  • Tickets ──> Passengers ──> Bookings
  • Bookings ──> Flights ──> Airports & Aircraft
  • Flights ──> Pricing Rules (demand-based)
  • Bookings ──> Seat Holds (concurrency control)

Core Collections

flights

{
  _id: ObjectId,
  flightNumber: String,
  origin: String (IATA),
  destination: String (IATA),
  departureTime: Date,
  arrivalTime: Date,
  aircraft: ObjectId,
  basefare: Number,
  seats: {
    economy: { total: Number, available: Number },
    business: { total: Number, available: Number },
    first: { total: Number, available: Number }
  },
  seatLayout: Array,
  status: String (scheduled, in-flight, completed, cancelled)
}

passengers

{
  _id: ObjectId,
  firstName: String,
  lastName: String,
  email: String,
  phone: String,
  passport: String,
  dateOfBirth: Date,
  frequentFlyerTier: String,
  frequentFlyerPoints: Number,
  preferences: {
    seatPreference: String,
    mealPreference: String
  }
}

bookings

{
  _id: ObjectId,
  bookingReference: String,
  passenger: ObjectId,
  flight: ObjectId,
  seats: Array,
  cabinClass: String,
  priceSnapshot: {
    baseFare: Number,
    discount: Number,
    tax: Number,
    totalPrice: Number
  },
  status: String (confirmed, cancelled, completed),
  bookingDate: Date,
  paymentStatus: String
}

tickets

{
  _id: ObjectId,
  pnr: String,
  booking: ObjectId,
  passenger: ObjectId,
  seat: String,
  boarding_pass: String,
  issueDate: Date,
  expiryDate: Date
}

pricing_rules

{
  _id: ObjectId,
  flightRoute: String,
  season: String,
  occupancyBrackets: Array,
  advanceBookingRates: Array,
  effectiveDate: Date,
  expiryDate: Date
}

🎯 Key Features Deep Dive

Dynamic Pricing Algorithm

The system implements a multi-factor pricing model:

  1. Base Fare: Standard pricing for the route

  2. Occupancy Factor:

    • 0-25%: -15% discount
    • 26-50%: -5% discount
    • 51-75%: Base price
    • 76-90%: +15% premium
    • 91-100%: +25% premium
  3. Advance Booking Bonus:

    • 30+ days: -20% discount
    • 14-29 days: -10% discount
    • 7-13 days: -5% discount
    • 0-6 days: Base or premium pricing
  4. Seasonal Multiplier:

    • Peak Season: 1.3x
    • Normal Season: 1.0x
    • Off-Peak: 0.85x

Concurrency Control

To prevent overbooking during concurrent user sessions:

  • Seat Hold Mechanism: When a user selects a seat, it's temporarily locked for 10 minutes
  • TTL Indexes: Automatic removal of expired seat holds
  • Atomic Updates: MongoDB's atomic $inc operators ensure no race conditions

ACID Compliance in Bookings

Every booking follows strict ACID principles:

  1. Atomicity: All-or-nothing: seats deducted, payment processed, ticket generated
  2. Consistency: Flight seat count always accurate
  3. Isolation: Concurrent bookings don't interfere
  4. Durability: All successful bookings persist permanently

πŸ“Š Database Constraints

Constraint Implementation
No Overbooking Atomic $inc with availability check
Unique PNR Unique index on tickets.pnr
Referential Integrity Manual validation via ObjectId references
Historical Audit Immutable booking records with price snapshots
Session Management TTL-based seat holds
Scalability Horizontal partitioning by route/date

πŸ› οΈ Utility Scripts

Seed Database

node backend/seed.js

Initializes the database with sample airports, aircraft, flights, and pricing rules.

Insert Test Data

node insert_data.js

Adds sample passenger and booking data for testing.

Generate Documentation

node generate_doc.js

Creates detailed HTML and Markdown documentation.

Generate Reports

node generate_ppt.js

Creates PowerPoint presentations with system statistics and analytics.

Debug Database

node debug.js

Utility script for debugging database issues and inspecting data.


πŸ‘₯ Team

Name Registration Number Role
Danush K 3122247001013 Developer
Jeeva G 3122247001027 Developer
Chitraju Vishnu Vineeth 3122247001012 Developer

Institution: Sri Sivasubramaniya Nadar College of Engineering
Course: ICS1402 - Database Systems
Faculty: Dr. N. Sujaudeen
Batch: 2024-29


πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ“ž Support & Contact

For issues, questions, or contributions, please:

  1. Report Issues: Create an issue on the project repository
  2. Email: Contact the development team
  3. Documentation: Refer to ARDPS_Assignment1_Refined.md for detailed documentation

πŸ”„ Version History

Version Date Notes
1.0.0 2025 Initial release with full feature set

πŸ“š Additional Resources



Project Lead & Developer: Danush K

Developed as part of the NoSQL Database Systems Learning


About

ARDPS is a scalable airline management platform that handles flight scheduling, bookings, ticketing, passenger records, and seat management. Powered by MongoDB, it supports high-speed operations and smart dynamic pricing based on demand, occupancy, and travel trends.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages