0% found this document useful (0 votes)
24 views15 pages

Nima Part

The document outlines a Microservices Architecture for a tourism application, detailing its key layers including Frontend, API Gateway, Microservices, Database, Infrastructure, and Event-Driven Communication. Each microservice is responsible for specific functionalities such as user management, booking, payment processing, and visa applications, promoting scalability and modularity. The architecture supports various user types (Tourists, Tour Agencies, and Department of Tourism) with defined features and interactions, ensuring efficient management and real-time updates through RESTful APIs and Kafka.

Uploaded by

Nima Dorji
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views15 pages

Nima Part

The document outlines a Microservices Architecture for a tourism application, detailing its key layers including Frontend, API Gateway, Microservices, Database, Infrastructure, and Event-Driven Communication. Each microservice is responsible for specific functionalities such as user management, booking, payment processing, and visa applications, promoting scalability and modularity. The architecture supports various user types (Tourists, Tour Agencies, and Department of Tourism) with defined features and interactions, ensuring efficient management and real-time updates through RESTful APIs and Kafka.

Uploaded by

Nima Dorji
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

System Architecture

Our project adopts a Microservices Architecture to ensure scalability, flexibility, and efficient
management of the tourism application. This architecture breaks down the system into
independent, loosely coupled services, where each microservice is responsible for a specific
business functionality. These microservices communicate with each other through RESTful APIs
and event-driven messaging systems like Kafka, promoting modularity and ease of
maintenance.

The architecture consists of the following key layers:

1.​ Frontend Layer


○​ Built using React for both web and mobile applications (React Web App and
React Native Mobile App).
○​ Handles user interactions for all three user types: Tourists, Tour Agencies, and
the Department of Tourism (DoT).
○​ Communicates with backend services via API Gateway, ensuring secure and
streamlined access.
2.​ API Gateway & Security Layer
○​ The Spring Cloud Gateway manages API routing, load balancing, and request
filtering.
○​ OAuth2 and JWT Authentication secure the endpoints, ensuring role-based
access control for the three user types.
3.​ Microservices Layer
○​ Composed of various independent services, including:
■​ User Management Service: Handles user registration, authentication,
and profiles.
■​ Tour Package & Booking Service: Manages tour packages, availability,
and tourist bookings.
■​ Tour Agency Management Service: Allows agencies to manage their
profiles and package listings.
■​ Visa Processing Service: Handles VISA application submissions and
tracking for tourists.
■​ Payment Service: Manages secure transactions and payment
processing.
■​ Notification Service: Sends real-time updates and booking
confirmations.
■​ Reporting & Analytics Service: Provides insights and analytics for DoT
and agencies.
○​ These services are designed to be independently deployable and scalable,
enabling continuous development and deployment.
4.​ Database & Storage Layer
○​ Utilizes MongoDB for flexible document storage and AWS S3 for secure file
storage (e.g., VISA documents).
○​ Redis is used for caching to enhance system performance.
5.​ Infrastructure & DevOps Layer
○​ The entire system is containerized using Docker and orchestrated with
Kubernetes for efficient deployment and scaling.
○​ Prometheus and Grafana provide monitoring and visualization of system
performance.
○​ The ELK Stack is used for centralized logging and error tracking.
6.​ Event-Driven Communication
○​ Kafka serves as the backbone for asynchronous communication between
microservices, ensuring real-time updates and efficient processing of events such
as booking confirmations and VISA approvals.

Why Microservices Architecture:

●​ Scalability: Each service can be scaled independently based on load.


●​ Resilience: Failure in one service does not impact others, ensuring system robustness.
●​ Agility: Development teams can work on different services simultaneously, speeding up
the delivery process.
●​ Technology Flexibility: Each microservice can use the most suitable technology stack,
optimizing performance and maintainability.

+-------------------------------------------------+
| Frontend Layer |
|-------------------------------------------------|
| - Mobile App / Website (Tourists) |
| - Dashboard Website (Tour Agencies) |
| - Dashboard Website (Department of Tourism) |
+----------------------+--------------------------+
|
v
+-----------------------------------------+
| API Gateway & Security Layer |
| (Spring Cloud, OAuth2, JWT) |
+----------------------+------------------+
|
-----------------------------------------------------------------------
| | | |
v v v v
+-------------------+ +-------------------+ +-------------------+ +-------------------+
| User Mgmt | | Tour Booking | | Visa Service | | Payment Service |
| Service | | Service | | (Visa Processing) | | (Transactions) |
+--------+---------+ +---------+---------+ +---------+---------+ +---------+---------+
| | | |
| | | |
+--------v---------+ +---------v---------+ +---------v---------+ +---------v---------+
| User Database | | Booking Database | | Visa Database | | Payment Database |
| (MongoDB) | | (MongoDB) | | (MongoDB) | | (PostgreSQL) |
+-----------------+ +-----------------+ +-----------------+ +-----------------+
|
-----------------------------------------------------------------------
|
v
+-----------------------------------------+
| Event-Driven Communication (Kafka) |
+-----------------------------------------+
|
--------------------------------------------------------------------------------------
| | | |
v v v v
+-------------------+ +-------------------+ +-------------------+ +-------------------+
| Notification | | Reporting & | | Analytics | | Tour Agency |
| Service | | Insights (DoT) | | (For DoT & Agencies)| | Management |
+--------+---------+ +---------+---------+ +---------+---------+ +---------+---------+
| | | |
+--------v---------+ +---------v---------+ +---------v---------+ +---------v---------+
| Notification DB | | Reports Database | | Analytics DB | | Agency Database |
| (MongoDB) | | (MongoDB) | | (PostgreSQL) | | (MongoDB) |
+-----------------+ +-----------------+ +-----------------+ +-----------------+
|
v
+-----------------------------------------+
| Infrastructure & DevOps |
| (Docker, Kubernetes, ELK, Prometheus) |
+-----------------------------------------+

ERD​
Tables & Relationships

1. User Management (MongoDB)

●​ Users (user_id, name, email, password_hash, phone, role (tourist, agency, DoT),
created_at)
●​ Tourist Profiles (user_id (FK), nationality, passport_number, dob,
preferences)
●​ Agency Profiles (agency_id, user_id (FK), name, license_number,
contact_info, created_at)

2. Tour Package & Booking (MongoDB)


●​ Tour Packages (package_id, agency_id (FK), title, description, price,
availability, created_at)
●​ Bookings (booking_id, user_id (FK), package_id (FK), status (pending,
confirmed, canceled), booking_date, payment_status)

3. Visa Processing (MongoDB)

●​ Visa Applications (visa_id, user_id (FK), passport_number, visa_status,


submission_date, approval_date)
●​ Visa Documents (document_id, visa_id (FK), file_url, uploaded_at)

4. Payment (PostgreSQL)

●​ Payments (payment_id, booking_id (FK), amount, status (successful, failed),


transaction_date)
●​ Transactions (transaction_id, payment_id (FK), method (credit card, PayPal,
etc.), reference_number)

5. Notifications (MongoDB)

●​ Notifications (notification_id, user_id (FK), message, status (read/unread),


created_at)

6. Reports & Analytics (PostgreSQL)

●​ Reports (report_id, generated_by (DoT/Admin), report_type,


generated_date)
●​ Analytics (analytics_id, metric_name, metric_value, recorded_at)

User Types and Their Features


1. Tourists

📌 Features:
●​ Register/Login
●​ View & Book Tour Packages
●​ Apply for Visa
●​ Make Payments
●​ Get Notifications
●​ Track Booking & Visa Status

📌 Interacts with Tables:


●​ Users
●​ Tourist Profiles
●​ Tour Packages
●​ Bookings
●​ Payments
●​ Visa Applications
●​ Visa Documents
●​ Notifications

2. Tour Agencies

📌 Features:
●​ Register/Login
●​ Create & Manage Tour Packages
●​ View Bookings for Their Packages
●​ Receive Payments for Bookings
●​ Get Reports on Bookings & Earnings

📌 Interacts with Tables:


●​ Users
●​ Agency Profiles
●​ Tour Packages
●​ Bookings
●​ Payments
●​ Reports

3. Department of Tourism (DoT)

📌 Features:
●​ Register/Login
●​ Manage & Approve Visa Applications
●​ Generate Reports & Analytics
●​ View Tour Agency Registrations
●​ Track Tourism Trends

📌 Interacts with Tables:


●​ Users
●​ DoT Profiles
●​ Visa Applications
●​ Visa Documents
●​ Reports
●​ Analytics

+-----------------+
| Users |
|-----------------|
| user_id (PK) |
| name |
| email |
| password_hash |
| phone |
| role (Tourist / Agency / DoT) |
| created_at |
+-----------------+
|
|
+---------------------+ +---------------------+ +----------------------+
| Tourist Profiles | | Agency Profiles | | DoT Profiles |
|---------------------| |---------------------| |----------------------|
| user_id (PK, FK) | | agency_id (PK) | | user_id (PK, FK) |
| nationality | | user_id (FK) | | department_name |
| passport_number | | name | | position |
| dob | | license_number | | permissions |
| preferences | | contact_info | | created_at |
+---------------------+ +---------------------+ +----------------------+

|
|
+----------------------------+
| Tour Packages |
|----------------------------|
| package_id (PK) |
| agency_id (FK) |
| title |
| description |
| price |
| availability |
| created_at |
+----------------------------+
|
|
+----------------------------+
| Bookings |
|----------------------------|
| booking_id (PK) |
| user_id (FK) | <-- (Tourist makes booking)
| package_id (FK) |
| status (pending, confirmed)|
| booking_date |
| payment_status |
+----------------------------+

|
|
+----------------------------+
| Payments |
|----------------------------|
| payment_id (PK) |
| booking_id (FK) |
| amount |
| status (successful, failed)|
| transaction_date |
+----------------------------+

|
|
+----------------------------+
| Visa Applications |
|----------------------------|
| visa_id (PK) |
| user_id (FK) | <-- (Tourist applies for Visa)
| passport_number |
| visa_status |
| submission_date |
| approval_date |
+----------------------------+
|
|
+----------------------------+
| Visa Documents |
|----------------------------|
| document_id (PK) |
| visa_id (FK) |
| file_url |
| uploaded_at |
+----------------------------+

|
|
+----------------------------+
| Notifications |
|----------------------------|
| notification_id (PK) |
| user_id (FK) |
| message |
| status (read/unread) |
| created_at |
+----------------------------+

|
|
+----------------------------+
| Reports |
|----------------------------|
| report_id (PK) |
| generated_by (DoT/Admin) | <-- (DoT generates reports)
| report_type |
| generated_date |
+----------------------------+

|
|
+----------------------------+
| Analytics |
|----------------------------|
| analytics_id (PK) |
| metric_name |
| metric_value |
| recorded_at |
+----------------------------+

Key Adjustments & Relationships


1.​ User Roles & Features Defined Clearly
○​ Users table stores Tourists, Agencies, and DoT with a role column.
○​ Each user type has its own profile table for specific details.
2.​ Feature-Specific Tables
○​ Tour Packages (Managed by Tour Agencies)
○​ Bookings (Created by Tourists)
○​ Payments (Processed when Tourists book packages)
○​ Visa Applications (Submitted by Tourists and Approved by DoT)
○​ Reports & Analytics (Generated by DoT)
3.​ Direct Relationships Between Tables
○​ Users → Bookings → Payments
○​ Users → Visa Applications → Visa Documents
○​ Tour Agencies → Tour Packages → Bookings
○​ DoT → Reports & Analytics

📌 Application Workflow Overview


1️⃣ User Registration & Authentication
🚶 Steps:
1.​ A Tourist, Tour Agency, or DoT user registers via the app/website.
2.​ The request goes to the User Management Service.
3.​ Credentials are validated, and user details are stored in the Users table.
4.​ A JWT token is generated for authentication.
5.​ User logs in and is redirected to their respective dashboard (Tourist App, Agency
Dashboard, or DoT Dashboard).

📌 Tables Involved: Users


📌 Microservices Involved: User Management Service, Auth Service

2️⃣ Tourist Browsing & Booking a Tour Package


🚶 Steps:
1.​ A Tourist logs in and browses available tour packages.
2.​ The Tour Package & Booking Service fetches tour details from the Tour Packages
table.
3.​ Tourist selects a package and clicks "Book Now".
4.​ The system creates a new booking entry in the Bookings table with status "Pending
Payment".
5.​ The user is redirected to the Payment Gateway.

📌 Tables Involved: Tour Packages, Bookings


📌 Microservices Involved: Tour Package & Booking Service, Payment Service

3️⃣ Tourist Making a Payment


🚶 Steps:
1.​ User chooses a payment method (Credit Card, PayPal, etc.).
2.​ The Payment Service processes the transaction.
3.​ Upon success, the payment record is added to the Payments table.
4.​ The Booking status is updated to "Confirmed".
5.​ The Notification Service sends a confirmation to the tourist & tour agency.

📌 Tables Involved: Payments, Bookings, Notifications


📌 Microservices Involved: Payment Service, Notification Service

4️⃣ Tour Agency Managing Tour Packages & Bookings


🚶 Steps:
1.​ A Tour Agency logs into their dashboard.
2.​ They can:
○​ Create, edit, or delete tour packages.
○​ View incoming bookings from tourists.
3.​ When a new booking arrives, they can accept/reject it.
4.​ If a booking is accepted, the system updates the Bookings table.
5.​ The Notification Service alerts the tourist about booking confirmation.

📌 Tables Involved: Tour Packages, Bookings, Notifications


📌 Microservices Involved: Tour Package & Booking Service, Notification
Service
5️⃣ Tourist Applying for a Visa
🚶 Steps:
1.​ The Tourist navigates to Visa Application in the app.
2.​ They fill in their details and upload required documents (passport, ID, etc.).
3.​ The Visa Processing Service stores the data in Visa Applications and Visa
Documents.
4.​ The Department of Tourism (DoT) reviews the application from their dashboard.
5.​ DoT updates the visa status (Approved/Rejected) in the Visa Applications table.
6.​ The Notification Service informs the tourist about visa status.

📌 Tables Involved: Visa Applications, Visa Documents, Notifications


📌 Microservices Involved: Visa Processing Service, DoT Management Service,
Notification Service

6️⃣ Department of Tourism (DoT) Managing Approvals &


Analytics
🚶 Steps:
1.​ DoT logs in to their dashboard.
2.​ They can:
○​ Approve/Reject Visa Applications.
○​ Generate Reports on bookings, payments, and visa approvals.
○​ View analytics dashboards with tourism trends.
3.​ Reports are stored in the Reports table.
4.​ Tourism statistics are updated in Analytics.

📌 Tables Involved: Visa Applications, Reports, Analytics


📌 Microservices Involved: DoT Management Service, Analytics Service

7️⃣ Notification System for Updates & Alerts


🚶 Steps:
1.​ Any important action (Booking confirmation, Visa Approval, Payment Success) triggers
an event.
2.​ The Notification Service listens to these events and sends emails or app notifications.
3.​ Notifications are stored in the Notifications table.

📌 Tables Involved: Notifications


📌 Microservices Involved: Notification Service

🔄 Summary: High-Level Workflow


1. User Registers/Login → Auth Service
2. Tourist Browses Tours → Tour Package & Booking Service
3. Tourist Books a Package → Booking Table Update
4. Payment Processing → Payment Service
5. Tour Agency Manages Bookings → Booking Table Update
6. Tourist Applies for Visa → Visa Processing Service
7. DoT Approves Visa & Generates Reports → DoT Service
8. Notifications Sent → Notification Service

+---------------------------+
| Tourist / Tour Agency |
| / DoT User Login |
+------------+--------------+
|
v
+---------------------------+
| Authentication Service |
| (JWT / OAuth2 Validation) |
+------------+--------------+
|
+------------------------------+-----------------------------+
| |
v v
+-------------------------+ +---------------------------+
| Tourist Dashboard | | Tour Agency Dashboard |
| (Mobile/Web App) | | (Web Portal) |
+-----------+-------------+ +------------+--------------+
| |
| |
v v
+------------------------------+ +-----------------------------+
| Tour Package & Booking Service| | Manage Tour Packages |
| - View Packages | | - Create/Edit/Delete |
| - Book a Tour | | - Accept/Reject Bookings |
+-----------+-------------------+ +-------------+--------------+
| |
| |
v v
+-------------------------------+ +------------------------------+
| Payment Service | | Notification Service |
| - Process Payment | | - Confirm Booking |
| - Update Booking Status | | - Payment/Visa Alerts |
+-------------------------------+ +------------------------------+
| |
v v
+------------------------------+ +------------------------------+
| Visa Processing Service | | Department of Tourism (DoT) |
| - Submit Visa Application | | - Approve/Reject Visa |
| - Upload Documents | | - View Analytics & Reports |
+------------------------------+ +------------------------------+

📌 1. Tourist Use Case Diagram


+---------------------+
| Tourist |
+---------------------+
|
-------------------------------------
| | |
v v v
+----------------+ +----------------+ +----------------------+
| Browse Tours | | Book a Tour | | Apply for Visa |
+----------------+ +----------------+ +----------------------+
| |
v v
+----------------+ +--------------------+
| Make Payment | | Receive Booking |
| | | & Visa Updates |
+----------------+ +--------------------+
📌 2. Tour Agency Use Case Diagram
+---------------------+
| Tour Agency |
+---------------------+
|
----------------------------------------
| | |
v v v
+----------------+ +----------------+ +----------------------+
| Create/Edit | | Manage Bookings | | Receive Payments |
| Tour Packages| | (Approve/Reject)| | for Bookings |
+----------------+ +----------------+ +----------------------+
|
v
+--------------------------+
| Send Booking Updates |
+--------------------------+

📌 3. Department of Tourism (DoT) Use Case Diagram


+----------------------+
| DoT User |
+----------------------+
|
---------------------------------------------------------
| | | |
v v v v
+----------------+ +----------------+ +----------------------+
+------------------------+
| Approve/Reject | | View Reports & | | Manage Regulations | |
Approve/Reject Agencies|
| Visas | | Analytics | | & Compliance |
+------------------------+
+----------------+ +----------------+ +----------------------+
DoT Use Cases

1.​Approve/Reject Visas – Review and decide on visa applications.


2.​View Reports & Analytics – Monitor tourism data, bookings, and
revenue.
3.​Manage Regulations & Compliance – Oversee tourism regulations and
guidelines.
4.​Approve/Reject Agencies – Review and authorize new tour agencies
or revoke existing licenses.

You might also like