Skip to content

MurugananthamB/backend-flight-now

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Backend - Flight Booking and Reservation System ✈️

This is the backend service for the Flight Booking and Reservation System. It provides robust APIs for flight search, booking management, payment processing, and integration with real-time airline data.


🔥 Features

  • Flight Search API: Fetch flights based on user preferences such as origin, destination, and dates.
  • Booking Management: Manage bookings with APIs to create, update, view, or cancel reservations.
  • Payment Processing: Secure payment handling with integration for Stripe and PayPal.
  • User Authentication: JSON Web Tokens (JWT) for secure user sessions.
  • Real-Time Updates: Integration with airline APIs for live flight schedules and updates.

🛠️ Tech Stack

  • Backend Framework: Node.js with Express.js.
  • Database: MongoDB with Mongoose for data modeling.
  • Authentication: JWT for secure API access.
  • Payment Gateway: Stripe/PayPal integration.
  • API Integration: Amadeus and Skyscanner APIs for real-time data.

🚀 Installation and Setup

Prerequisites:

  • Install Node.js and npm.
  • Set up MongoDB locally or use a cloud database (e.g., MongoDB Atlas).
  • Get API keys for:
    • Stripe or PayPal (Payment Gateway)
    • Amadeus or Skyscanner (Airline Data API)

Steps:

  1. Clone the repository:
    git clone https://github.com/yourusername/backend-flight-now.git
    cd backend-flight
  2. Install dependencies:
    npm install
  3. Set up environment variables: Create a .env file in the backend-flight folder and add:
     PORT=5000
     MONGO_URI=your_mongodb_connection_string
     JWT_SECRET=your_jwt_secret
     STRIPE_KEY=your_stripe_api_key
     SKYSCRAPER_API_KEY=your_skyscanner_api_key
  4. Start the server:
    npm start
  5. Test API Endpoints: The backend server will be running at:
    http://localhost:5000
    
    

📂 Directory Structure

backend-flight/
│
├── controllers/       
│   ├── flightController.js
│   ├── bookingController.js
│   ├── paymentController.js
│
├── models/            
│   ├── Flight.js
│   ├── Booking.js
│   ├── User.js
│
├── routes/           
│   ├── flights.js
│   ├── bookings.js
│   ├── payments.js
│
├── middleware/        
│   ├── authMiddleware.js
│
├── config/           
│   ├── db.js          
│
├── utils/             
│   ├── emailService.js
│
└── server.js          

🛡️ API Endpoints

GET    /api/flights        # Search flights
POST   /api/bookings       # Create a booking
GET    /api/bookings/:id   # View booking details
PUT    /api/bookings/:id   # Update a booking
DELETE /api/bookings/:id   # Cancel a booking
POST   /api/payments       # Process a payment

🌟 Future Enhancements

Implement real-time socket-based flight updates. Add support for multiple currencies in payment gateways. Enhance the booking system with multi-city options.

🤝 Contributing

We welcome contributions to improve this project. Feel free to fork the repository, make changes, and submit a pull request.

📜 License

This project is licensed under the MIT License.

📧 Contact

About

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors