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.
- 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.
- 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.
- 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)
- Clone the repository:
git clone https://github.com/yourusername/backend-flight-now.git cd backend-flight - Install dependencies:
npm install
- 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
- Start the server:
npm start
- Test API Endpoints:
The backend server will be running at:
http://localhost:5000
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
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
Implement real-time socket-based flight updates. Add support for multiple currencies in payment gateways. Enhance the booking system with multi-city options.
We welcome contributions to improve this project. Feel free to fork the repository, make changes, and submit a pull request.
This project is licensed under the MIT License.
- Developer: @MurugananthamB
- Email: murugananthamanand01212@gmail.com