Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

✈️ Airline Booking Platform β€” Full Stack (Microservices + Android)

A distributed, event-driven backend system for flight management, booking orchestration, and automated notifications β€” paired with a premium Jetpack Compose Android client.

Built with Node.js, Express, MySQL, RabbitMQ, and Kotlin (Jetpack Compose). Deployed on AWS using a custom API Gateway and Auto Scaling Groups.


πŸ“± Android App

Download & Try (Static UI Preview APK)

This APK demonstrates the full UI/UX with static mock data. No backend required.

⬇️ Download APK (Google Drive)

Android Source Code

πŸ“¦ Android App Repository β€” GitHub

Install the APK on Your Android Device

  1. Open the Google Drive link above on your Android phone and tap Download
  2. Once downloaded, tap the .apk file in your notifications or file manager
  3. If prompted, go to Settings β†’ Security β†’ Install unknown apps and enable it for your browser/file manager
  4. Tap Install and open the app
  5. Note: This APK uses static mock data. To use live booking with the real backend, build from source (see Run the Android App below)


πŸ”— Microservice Repositories

Service Responsibility Repository
API Gateway Central entry point, Routing, Rate Limiting, Auth Proxy Link
Auth Service JWT issuance, Validation, User Management Link
Flight Service Flight Catalog, City/Airport Management, Search Filters Link
Booking Service Booking Orchestration, Transaction Management, Message Publishing Link
Reminder Service Cron Jobs, Email Notifications, RabbitMQ Consumer Link

πŸ“– Project Overview

This is a comprehensive Airline Booking System built using a Microservices Architecture. It simulates a real-world production environment where different functionalities (Authentication, Booking, Flight Search, Notifications) are decoupled into independent services.

The system handles the complete flow of a flight reservation β€” from searching for flights and managing seat inventory, to processing secure bookings and sending asynchronous email notifications β€” all accessible through a polished Android mobile client.


✨ Key Features

πŸ“± Android App Features

  • JWT Authentication β€” Login & signup with role selection (Passenger / Admin); session persisted in SharedPreferences
  • Live Flight Search β€” Real airport dropdowns from API; filtered by departure airport, arrival airport, and travel date (timezone-aware)
  • Premium Flight Cards β€” Airline branding, flight duration, seat availability indicator, price per seat
  • Booking Flow β€” Seat selector, real-time booking creation, success/error dialogs; triggers confirmation email via RabbitMQ
  • My Bookings β€” Boarding-pass style cards split into Upcoming and Previous tabs, sorted by departure time
  • User Profile β€” Displays real JWT-decoded email and role
  • Admin Panel β€” Full flight and airport CRUD management
  • Custom UI β€” Wave-shaped curved bottom nav with raised FAB; all times shown in device local timezone

πŸ‘€ Backend Features (User-Facing)

  • Smart Flight Search β€” Filter by source, destination, and price range
  • Real-Time Seat Availability β€” Atomic seat inventory update prevents overbooking
  • Secure Authentication β€” JWT + bcrypt password hashing
  • Instant Booking Confirmation β€” Email sent immediately after booking
  • Automated Reminders β€” Cron job sends flight reminder emails 24 hours before departure

βš™οΈ Backend Features (Technical)

  • Centralized API Gateway β€” Single entry point for routing, rate limiting, and logging
  • Event-Driven Architecture β€” RabbitMQ decouples booking from notifications for low latency
  • Resilient Scheduling β€” Reminder Service handles scheduling even if mail server is temporarily down
  • Scalable Infrastructure β€” AWS Auto Scaling Groups + Load Balancers for traffic spikes

πŸ—οΈ System Architecture

Android App (Jetpack Compose)
        β”‚
        β–Ό
  API Gateway :3005
  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  β”‚  Auth Service       :7000       β”‚
  β”‚  Flight Service     :3000       β”‚
  β”‚  Booking Service    :5000  ──── RabbitMQ ──── Reminder Service :3004
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                    β”‚
        β”‚                                           Nodemailer (Email)
     MySQL / AWS RDS

Key Workflows:

  1. Search: App β†’ Gateway β†’ Flight Service (MySQL)
  2. Booking: App β†’ Gateway β†’ Booking Service β†’ Flight Service (seat check) β†’ MySQL (save)
  3. Notification: Booking Service β†’ RabbitMQ β†’ Reminder Service β†’ Nodemailer

πŸ› οΈ Full Tech Stack

Android App

Layer Technology
Language Kotlin
UI Jetpack Compose (Material 3)
Navigation Compose Navigation (androidx.navigation)
Dependency Injection Dagger Hilt (@HiltViewModel, @Singleton)
Networking Retrofit 2 + OkHttp (with AuthInterceptor for JWT)
Serialization Gson (@SerializedName)
State Management Kotlin StateFlow / MutableStateFlow
Auth JWT decoded from SharedPreferences
Date/Time java.time (API 26+): Instant, ZoneId, LocalDate
Min SDK API 26 (Android 8.0)

Backend

Layer Technology
Runtime Node.js
Framework Express.js
Database MySQL + Sequelize ORM
Cloud DB AWS RDS
Message Broker RabbitMQ (amqplib)
Task Scheduling node-cron
Email Nodemailer
Auth JWT + bcrypt
Logging Morgan
Cloud Infra AWS EC2, Auto Scaling Groups, ALB

πŸš€ How to Run the Full Stack Locally

Prerequisites

  • Node.js (v18+)
  • MySQL Server running locally
  • RabbitMQ running locally (amqp://localhost)
  • Android Studio Hedgehog or newer (for the app)
  • JDK 17+, Android SDK API 26+

Step 1 β€” Clone All Repositories

Create a root folder and clone each service into it:

mkdir AirlineBookingProject && cd AirlineBookingProject

# 1. API Gateway
git clone https://github.com/rkt0209/ApiGateway

# 2. Auth Service
git clone https://github.com/rkt0209/Auth_Service

# 3. Flight & Search Service
git clone https://github.com/rkt0209/flightsandSearch

# 4. Booking Service
git clone https://github.com/rkt0209/bookingService

# 5. Reminder Service
git clone https://github.com/rkt0209/reminderService

# 6. Android App
git clone https://github.com/rkt0209/airlineManagmentAPP

Step 2 β€” Database Setup

Create the three databases in your local MySQL:

CREATE DATABASE auth_db;
CREATE DATABASE booking_db;
CREATE DATABASE flights_search_db;

Step 3 β€” Configure Each Service

3a. Database Config (src/config/config.json)

Create config.json inside each service's src/config/ folder:

{
  "development": {
    "username": "root",
    "password": "YOUR_MYSQL_PASSWORD",
    "database": "SERVICE_DB_NAME",
    "host": "127.0.0.1",
    "dialect": "mysql"
  }
}
Service "database" value
Auth Service "auth_db"
Booking Service "booking_db"
Reminder Service "booking_db"
Flight Service "flights_search_db"

3b. Environment Variables (.env)

Create a .env file in the root of each service folder:

API Gateway

PORT=3005
AUTH_SERVICE=http://localhost:7000
BOOKING_SERVICE=http://localhost:5000
FLIGHT_SERVICE=http://localhost:3000

Auth Service

PORT=7000
SALT=YourRandomSaltString
JWT_KEY=YourSecretKey
DB_SYNC=true

Flight Search Service

PORT=3000
DB_SYNC=true

Booking Service

PORT=5000
DB_SYNC=false
FLIGHT_SERVICE_PATH=http://localhost:3000/flightservice
USER_SERVICE_PATH=http://localhost:7000/authservice
MESSAGE_BROKER_URL=amqp://localhost
EXCHANGE_NAME=AIRLINE_BOOKING
REMINDER_BINDING_KEY=REMINDER_SERVICE

Reminder Service

PORT=3004
EMAIL_ID=your-email@gmail.com
EMAIL_PASS=your-gmail-app-password
MESSAGE_BROKER_URL=amqp://localhost
EXCHANGE_NAME=AIRLINE_BOOKING
REMINDER_BINDING_KEY=REMINDER_SERVICE

For EMAIL_PASS: use a Gmail App Password (not your account password). Generate one at Google Account β†’ Security β†’ 2-Step Verification β†’ App Passwords.


Step 4 β€” Install, Migrate & Start Each Service

Open 5 separate terminals and run in this order:

# 1. Auth Service
cd Auth_Service && npm install && npx sequelize db:migrate && npm start

# 2. Flight Service
cd flightsandSearch && npm install && npx sequelize db:migrate && npm start

# 3. Reminder Service
cd reminderService && npm install && npx sequelize db:migrate && npm start

# 4. Booking Service
cd bookingService && npm install && npx sequelize db:migrate && npm start

# 5. API Gateway (last β€” depends on all other services)
cd ApiGateway && npm install && npm start

Startup order matters: RabbitMQ and MySQL must be running before any service. API Gateway must start last.

The backend is now live at: http://localhost:3005


πŸ“± Run the Android App from Source

Step 1 β€” Open in Android Studio

  • Launch Android Studio
  • File β†’ Open β†’ select the airlineManagmentAPP/ folder
  • Wait for Gradle sync to complete

Step 2 β€” Configure the Backend URL

The app defaults to http://10.0.2.2:3005 β€” the Android emulator's loopback address for your host machine.

Scenario What to do
Running on emulator No change needed β€” 10.0.2.2 works out of the box
Running on a physical device Open app/src/main/java/com/example/airline/core/network/NetworkModule.kt and replace 10.0.2.2 with your machine's local IP (e.g., 192.168.1.5)

Your phone and computer must be on the same Wi-Fi network.

Step 3 β€” Build & Run

  • Select an emulator or connected device (API 26+)
  • Click Run β–Ά or press Shift + F10
  • The app will launch and connect to your running backend

πŸ“² Install the Live-Connected APK (Build from Source)

If you want to share the app with someone who already has the backend running:

  1. In Android Studio: Build β†’ Build Bundle(s) / APK(s) β†’ Build APK(s)
  2. APK is generated at:
    airlineManagmentAPP/app/build/outputs/apk/debug/app-debug.apk
    
  3. Transfer the APK to the target Android device (USB, Google Drive, etc.)
  4. On the device: Settings β†’ Security β†’ Install unknown apps β†’ enable for your file manager
  5. Tap the APK file and install
  6. Ensure the device is on the same network as the backend, or point to a deployed backend URL

☁️ How to Deploy on AWS

Deployment Overview

  • Hardware: t2.micro / t2.medium EC2 instances
  • OS: Ubuntu 24.04 LTS
  • Database: AWS RDS (MySQL)
  • Scaling: AWS Auto Scaling Group (ASG) behind an Application Load Balancer (ALB)

Step-by-Step Guide

  1. RDS Setup: Create a MySQL instance on AWS RDS
  2. Launch Template: Create an EC2 Launch Template using the User Data Script in aws/launch-script.sh

    Update the DB_HOST variable in the script with your RDS Endpoint

  3. Auto Scaling: Create an Auto Scaling Group using the template
  4. Load Balancer: Attach an Application Load Balancer (Internet Facing) listening on Port 80
  5. Target Group: Point the Load Balancer to Port 3005 (the API Gateway)
  6. Android App (Cloud): Update NetworkModule.kt with the Load Balancer DNS and rebuild the APK

Accessing the Deployed API

GET  http://<LOAD_BALANCER_DNS>/home
POST http://<LOAD_BALANCER_DNS>/flightservice/api/v1/flights

πŸ“‚ Backend Project Structure

/config       β€” Environment configs and DB connections
/controllers  β€” HTTP request/response handlers
/services     β€” Core business logic
/repository   β€” Data Access Layer (DB queries)
/models       β€” Sequelize schema definitions
/migrations   β€” Database schema version control
/seeders      β€” Initial data population scripts
/middlewares  β€” Auth checks, validation, error handling
/routes       β€” API route definitions
/utils        β€” Helper functions and error classes

πŸ“„ License

This project is for educational and portfolio purposes.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages