Skip to content

Advanced-computer-lab-2024/JetSetGo2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JetSetGo2

Welcome to JetSetGo2, your ultimate travel companion!
JetSetGo2 is a web-based platform designed to simplify and enhance the process of planning your trips. Whether you're traveling for leisure, business, or adventure, JetSetGo offers a seamless experience by bringing all your travel needs to one place.

Motivation

JetSetGo2 is your ultimate travel companion, created to transform the way you plan trips. It eliminates the hassle of manual planning and introduces a seamless, all-in-one platform that empowers you to manage every aspect of your journey effortlessly. Whether it’s personalized itineraries, smart budgeting, or real-time updates, JetSetGo2 ensures your travel experience is stress-free and unforgettable.

Build Status

JetSetGo2 is currently under active development and is not yet recommended for production environments. While the core features are operational, a few exciting enhancements are still in progress:

  • Loyalty Level and Badge Updates:

    • This feature, designed to reward our users, is still in the works and will be a game-changer once implemented.
  • Promo Code Creation by Admin:

    • The groundwork for this feature is ready, but a missing navigation button is temporarily keeping this functionality out of reach. Stay tuned for its debut!
  • UI/UX Enhancements:

    • The visual experience is evolving, and our team is dedicated to delivering a polished, intuitive interface in upcoming updates.
  • Performance and Scalability Optimizations:

    • Efforts are ongoing to ensure JetSetGo2 is faster, smoother, and capable of handling a growing user base.

Code Style

JetSetGo2 adheres to robust coding standards to ensure clarity, consistency, and collaboration across the development process:

  • Tools Used:
    • Prettier: Enforces automatic code formatting, making our code clean, readable, and uniform across the project.
  • Style Guidelines:
    • We follow the StandardJS code style guidelines for JavaScript, ensuring a widely recognized and reliable convention.
    • In the backend, a blank line is always left between methods and routes, fostering better readability and logical organization.
  • Why It Matters:
    • Adopting a consistent code style reduces errors, enhances teamwork, and ensures that anyone can easily navigate the project without confusion. JetSetGo2’s code is written not just for the present but for future scalability and collaboration.

Screenshots

Home

image

Tourist SignUP

image

Login

image

Tourist HomePage

image

BuyProducts By Tourist

image

Tourist Wishlist

image

Tourist Step - by - Step Guide

image

Select Prefrences by Tourist

image

Admin Complains

image

Admin User Statistics

image

Accept Users By Admin

image

Generate Sales Report By Admin

image

Itenararies Shown By Admin

image

Manage tags By Admin

image

Seller Home Page

image

Manage Seller Products

image

Add a New Product

image

Create Activity

image

View Seller Activities

image

Tourguide HomePage

image

Tourist Reports

image

Calculate Revenue

image

Create an Itinerary

image

View Tourguide Itineraries

image

Tech/Framework used

JetSetGo2 is powered by a modern MERN stack to ensure scalability, performance, and a seamless user experience:

  • Frontend: React.js, Axios, Bootstrap CSS
  • Backend: Node.js, Express.js
  • Database: MongoDB
  • Authentication: JSON Web Tokens (JWT)
  • Payment Integration: Stripe API
  • API Integration: Amadeus API for flight and hotel booking
  • Mapping Service: OpenStreetMap for interactive maps and location-based services

Features

JetSetGo2 delivers a comprehensive suite of features designed to revolutionize travel planning and management. Here’s what our platform offers:

Core Features

  • User Authentication: Secure registration and login system for multiple user roles, including tourists, tour guides, and advertisers.
  • Password Recovery: Easily recover passwords using OTP verification for hassle-free account access.
  • Role-Based Access: Distinct functionalities tailored for tourists, tour guides, advertisers, and tourism governance entities.
  • Guest Access: Limited functionalities for non-registered users, allowing exploration of the platform.
  • User Profiles: Manage personal details, travel history, and preferences for a tailored experience.
  • Upload Documents: Upload required documents during the registration process for tour guides, advertisers, or sellers.

Travel Planning

  • Trip Planning Tools: Create and organize personalized itineraries and activities for a seamless travel experience.
  • Activity Management: Schedule, view, and manage activities during trips with an intuitive interface.
  • Interactive Maps: Visualize destinations and travel plans with integrated map support.
  • Promotions and Discounts: Personalized promo codes and offers to enhance user engagement.
  • Loyalty Rewards: Earn points for frequent travel activities and redeem them for discounts.
  • Currency Selection: Choose the currency in which you want to view prices.

Search and Discovery

  • Search and Filter: Advanced options to find destinations, services, and reviews quickly.
  • Reviews and Recommendations: Access and contribute reviews for destinations and services.
  • Social Integration: Share trips, reviews, and recommendations with other users.
  • Bookmark Events: Save events to view later and request notifications when bookings open.

Admin and Governance Tools

  • Admin Management: Comprehensive admin tools for monitoring platform activity, managing users, and enforcing compliance.
  • Promotional Tools: Options for advertisers to promote services and destinations effectively.
  • Third-Party Integration: Seamless API integration for travel-related services, such as flight and hotel booking.
  • Activity and Itinerary Management: Create, read, update, or delete activities and itineraries, along with necessary details.

User Experience

  • Responsive Design: Fully optimized for both mobile and desktop devices.
  • Notifications: Timely alerts for upcoming trips, activities, bookings, and payment receipts.
  • Feedback Collection: Built-in mechanism to gather user feedback for continuous improvement.
  • Loyalty Badges: Earn badges based on activity and engagement levels.

Data Security and Insights

  • Secure Data Management: Robust security for personal and sensitive user data.
  • Booking History: View and manage past trip and service bookings with ease.
  • Sales Reports: Generate reports on sales, revenue, and tourist attendance for events or itineraries.
  • Complaints and Resolutions: File, view, and manage complaints with status tracking and admin replies.

Shopping and Products

  • Product Management: View available products, add them to wishlists or carts, and complete purchases.
  • Product Ratings and Reviews: Rate and review products after purchase.
  • Payment Options: Pay using a wallet, credit card (via Stripe), or cash on delivery.
  • Order History: View current and past orders, including statuses and cancellations.

Payment Features

  • Payment Options: Pay for activities, itineraries, or products using a wallet, credit card (via Stripe), or cash on delivery(for products).
  • Payment Receipts: Receive detailed payment receipts via email for all transactions.
  • Wallet Integration: View wallet balance updates after payments or cancellations.
  • Loyalty Points: Redeem loyalty points to add cash to your wallet.

Code Examples

Tourist Creation

const createTourist = async (req, res) => {
  // create a tourist after sign up
  const {
    Email,
    UserName,
    Password,
    MobileNumber,
    Nationality,
    DateOfBirth,
    Job,
  } = req.body;

  // Validation checks
  if (
    !Email ||
    !UserName ||
    !Password ||
    !MobileNumber ||
    !Nationality ||
    !DateOfBirth ||
    !Job
  ) {
    return res.status(400).json({ error: "All fields are required." });
  }

  // Example: Validate Email format
  const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
  if (!emailRegex.test(Email)) {
    return res.status(400).json({ error: "Invalid email format." });
  }

  // Example: Validate MobileNumber (it should be a number and not less than 10 digits)
  if (isNaN(MobileNumber) || MobileNumber.toString().length < 10) {
    return res
      .status(400)
      .json({ error: "Mobile number must be at least 10 digits." });
  }

  // Example: Validate DateOfBirth (it should be a valid date)
  const dob = new Date(DateOfBirth);
  if (isNaN(dob.getTime())) {
    return res.status(400).json({ error: "Invalid date of birth." });
  }

  try {
    const tourist = await touristModel.create({
      Email,
      UserName,
      Password,
      MobileNumber,
      Nationality,
      DateOfBirth,
      Job,
      Admin_Acceptance: true,
    });
    res.status(200).json(tourist);
  } catch (error) {
    res.status(400).json({ error: error.message });
  }
};

This component allows a user (tourist) to create an account by entering details like username, email, password, and more. The form data is sent to a backend API for processing, and the user is redirected to a login page upon successful signup.

User Authentication

const loginUser = async (req, res) => {
  const { Email, Password } = req.body;

  try {
    let user = await SellerModel.findOne({ Email });
    let AccountType = "Seller";

    // If not found in Seller, search in Adver
    if (!user) {
      user = await AdverModel.findOne({ Email });
      AccountType = "Advertiser";
    }

    // If not found in Adver, search in TourGuide
    if (!user) {
      user = await TourModel.findOne({ Email });
      AccountType = "TourGuide";
    }

    if (!user) {
      user = await TouristModel.findOne({ Email });
      AccountType = "Tourist";
    }

    if (!user) {
      user = await AdminModel.findOne({ Email });
      AccountType = "Admin";
    }

    // If user is not found in any model
    if (!user) {
      return res.status(401).json({ message: "Invalid credentials" });
    }

    // Check if password matches
    if (user.Password !== Password) {
      return res.status(401).json({ message: "Invalid credentials" });
    }

    // Generate JWT token including AccountType
    const token = jwt.sign(
      { userId: user._id, Email: user.Email, AccountType: AccountType }, // Include AccountType
      process.env.JWT_SECRET, // Your secret key
      { expiresIn: "1h" } // Token expiration
    );

    res.json({
      token,
      userId: user._id,
      Email: user.Email,
      AccountType: AccountType,
      profileCompleted: user.Profile_Completed || false, // Assuming the field 'profileCompleted' exists
      adminAccept: user.Admin_Acceptance || false,
    }); // Send token, AccountType, and profileCompleted back to client
  } catch (error) {
    console.error("Login error:", error);
    res.status(500).json({ message: "Server error", error: error.message });
  }
};

This functionality allows users (tourists, tour guides, advertisers, etc.) to securely log in to the platform by entering their credentials. The authentication token is stored locally to enable seamless access to protected routes and features.

Installation

Follow these steps to set up JetSetGo2 locally:

Prerequisites

  • Node.js (v14 or higher)
  • MongoDB
  • Git

Steps

  1. Clone Our Repository:
git clone https://github.com/Advanced-computer-lab-2024/JetSetGo2.git
  1. Install dependencies:

In the first terminal

cd backend 
npm install

Another terminal

cd frontend
npm install
  1. Set environment variables: Create a .env file in the root directory and add the necessary environment variables:
MONGO_URI = "mongodb+srv://marwanallam8:[email protected]/"
JWT_SECRET = 123@abc$in4
EMAIL_USER = [email protected]
EMAIL_PASSWORD = himy vxuv rfvz znqw
STRIPE_SECRET_KEY= sk_test_51QQBfPKbaBifWGn1fXWxcx0EP2pM8w3mbIuiCioPXVwWwaaLneXESzR68ZJkabcYsNAo9my2oXr20RuWu96jiXQX00sOLXsAlz
Webhook_secret_key = whsec_395bd0204bc24e6ff41dad457b0bf0ca6f1961c497f09b6197045c434bae761a
  1. Run the application:

In the first terminal

cd backend
nodemon server.js

In the second terminal

cd frontend
npm start

API References

JetSetGo2 provides a comprehensive API for managing users, activities, itineraries, and more. Below is a list of available endpoints with their descriptions:

tourist

  • POST /home/tourist/addTourist: Registers a new Toruist.
  • PUT /home/tourist/updateTourist/:id: Update tourist profile.
  • GET /home/tourist/getTourist: fetch all toursit.
  • GET /home/tourist/getTourist/:id: get tourist by id.
  • DELETE /home/tourist/delete/:id: delete tourist by id.
  • POST /home/tourist/bookTransportation/:touristId/:transportationId: tourist book transportation.
  • GET /home/tourist/getBookedTransportations/:touristId: get tourist booked transportation.
  • POST /home/tourist/buyProduct/:touristId/:productId: tourist buy product.

Seller

  • GET /Seller/readSeller/:id: get exact seller with id.
  • PUT /Seller/acceptSeller/:id: accept this seller on the system.
  • PUT /Seller/rejectSeller/:id: reject this seller on the system.
  • DELETE /Seller//deletMyAccount/:id: accept this seller on the system.

Promotions

  • GET /promo/get: Fetches all available promo codes.
  • POST /promo/create: Creates a new promo code.

OTP

  • POST /otp/send-otp: send email otp
  • POST /otp/verify-otp: verify otp

Products

  • POST /product/get: Fetches all available products.
  • GET /product/add: Add product.
  • PUT /product/update/:id: update specicific product.
  • DELETE /product//delete/:id: delete specific product.
  • PATCH /product/archive/:id: urchive product.
  • PATCH /product/unarchive/:id: unarchive product.

Tests

JetSetGo2 includes robust testing to ensure all functionalities work as expected.

Tools Used

  • Postman: For manual API testing.

Promotions

Products

OTP

Tourists

Sellers

Advertisers

Activities

Itineraries

Tour Guides

Notifications

Admin

How to Use

JetSetGo2 is a versatile platform designed for multiple user roles, including tourists, tour guides, advertisers, and sellers. Below is a guide on how each user type can interact with the platform.

Tourists

  1. Registration:
    • Sign up with your email, username, password, and personal details like nationality and date of birth.
  2. Search and Explore:
    • Use the search bar to find itineraries, activities, and historical places.
    • Apply filters (e.g., budget, date, ratings) and sort results to match your preferences.
  3. Booking:
    • Book itineraries, activities, flight, hotels, transportation and events directly through the app.
    • Use the integrated payment system (wallet, credit card, or Stripe) to complete transactions.
  4. Personalized Experience:
    • Save events to bookmarks and set notifications for when bookings open.
    • Manage your wallet, loyalty points, and rewards from your profile.
  5. Ratings and Reviews:
    • Rate and review activities, tour guides, or itineraries you’ve experienced.

Tour Guides

  1. Registration:
    • Sign up as a tour guide by providing personal details and uploading necessary documents for verification.
  2. Profile Management:
    • Update your profile with experience details and past work.
  3. Create and Manage Itineraries:
    • Add new itineraries with detailed descriptions, activities, and pricing.
    • Activate or deactivate itineraries and view feedback from tourists.
  4. Personalized Experience:
    • Save events to bookmarks and set notifications for when bookings open.
    • Manage your wallet, loyalty points, and rewards from your profile.
  5. Engage with Tourists:
    • Respond to reviews and ratings for your itineraries.

Advertisers

  1. Registration:
    • Register your company by providing details such as a website link, company profile, and uploaded documents.
  2. Promote Activities:
    • Create and manage promotional events or activities.
    • View insights and reports on the performance of your campaigns.
  3. Admin Features:
    • Use tools to track the success of promotions and adjust pricing or availability as needed.

Sellers

  1. Registration:
    • Sign up as a seller with your company name, description, and required documentation.
  2. Manage Products:
    • Add, update, or archive products in the in-app gift shop.
    • Monitor sales performance and available stock.
  3. Engage with Customers:
    • Respond to reviews and ratings for your products.

Admins

  1. Manage Users:
    • Approve or reject registrations for tourists, tour guides, advertisers, and sellers based on uploaded documents.
    • Delete accounts upon request or due to policy violations.
  2. Oversee Platform Activities:
    • Manage promo codes, notifications, and flagged content.
    • View user and sales reports for all activities.

For All Users

  • Access real-time notifications for bookings, updates, and reminders.
  • Use interactive maps to explore itineraries and locations.
  • Enjoy a fully responsive design, accessible on both desktop and mobile devices.

Contribute

JetSetGo2 is an open-source project, and we welcome contributions to improve the platform. Whether you want to report a bug, suggest a feature, or enhance existing functionality, here’s how you can contribute:

Report Issues

JetSetGo2 encourages users and contributors to report bugs, suggest new features, or provide feedback. Follow these steps to report an issue:

  1. Go to the Issues Tab.
  2. Click on New Issue.
  3. Provide a clear and descriptive title.
  4. Add detailed information about the issue, including:
    • Steps to reproduce (if it’s a bug).
    • Expected vs. actual behavior.
    • Screenshots or logs, if applicable.
  5. Submit the issue, and our team will review it promptly.

We appreciate your contributions to improving JetSetGo2!

Suggesting Features

  1. Open an issue titled “Feature Request: [Feature Name]”.
  2. Clearly explain your idea and how it can benefit users.

Submitting Code

  1. Fork the repository.

  2. Create a new branch for your feature or bug fix:

    git checkout -b feature-name
  3. Make your changes and commit them:

    git commit -m "Add feature: [Feature Name]"
  4. Push your changes to your forked repository:

    git push origin feature-name

Credits

JetSetGo2 was developed with the contributions of talented individuals and the use of various tools and resources. We’d like to acknowledge the following:

Development Team

  • Marwan Allam: Scrum Master, Developer and Contributor
  • Mahmoud Omran: Developer and Contributor
  • Omar bakr: Developer and Contributor
  • Ahmed eltabbakh: Developer and Contributor
  • Omar Tayel: Developer and Contributor
  • Omar elhossary: Developer and Contributor
  • Mario Sameh: Developer and Contributor
  • Youssef ahmed: Developer and Contributor
  • Mostafa Tarek: Developer and Contributor
  • Mayar Mohamed: Developer and Contributor

Tools and Technologies

  • React.js: Frontend development
  • Node.js: Backend development
  • Express.js: Web server framework
  • MongoDB: Database management
  • Bootstrap CSS: Frontend styling
  • OpenStreetMap: Maps integration
  • Stripe API: Payment processing
  • Amadeus API: Travel booking services

Resources

  • Postman: For API testing
  • GitHub: For version control and collaboration

License

JetSetGo2 is licensed under the Apache 2.0 License. You are free to use, modify, and distribute this project under the terms of this license.

contact

For any questions, feedback, or assistance, please reach out to us at

Thank you for choosing JetSetGo2 – now go pack your bags and let the adventures begin!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 10