Beyond-Borders is a travel platform designed to simplify vacation planning, offering everything you need to create your perfect trip, from historic landmarks to family-friendly adventures.
The inspiration behind Beyond-Borders stems from a desire to help travelers overcome the hassle of trip planning. We wanted to create a platform that consolidates all essential travel information in one place, making it easier for people to explore the world and discover new experiences without the stress of juggling multiple tools and sources.
The current build of Beyond-Borders is functional but has a few known issues that require attention. These include:
- Google Maps API Issue: The API for Google Maps fails when an advertiser attempts to create an activity.
- Slow Fetching of Data: Fetching data for hotels, flights, and all products can take longer than expected, affecting the user experience.
- Step-by-Step Tutorial Button: The open dialog button for the step-by-step tutorial is not immediately obvious to tourists or guests, potentially causing usability challenges.
Our code follows a clean and consistent coding style to ensure maintainability and readability for both backend and frontend code.
- Modular and Reusable Code: Functions are modular to make them reusable across the application.
- Clear Comments: Each function and critical logic segment is well-documented with comments explaining their purpose.
- Error Handling: Backend APIs include robust error handling to address edge cases and provide meaningful feedback to users.
- Consistent Variable Naming: Variable names are written in
camelCase
to maintain consistency.
Below is the list of technologies and frameworks used in the Beyond-Borders project:
- Node.js: Used for building the backend server and handling business logic.
- Express: A Node.js framework for creating APIs and managing server-side routes.
- React: Used for developing the frontend and creating interactive user interfaces.
- Mongoose: For object data modeling (ODM) and interacting with the MongoDB database.
- MongoDB Compass: GUI for querying and managing the MongoDB database.
- Postman: For testing APIs during the development process.
- Git and GitHub: For version control and project collaboration.
This stack provides a robust and scalable foundation for the Beyond-Borders platform, enabling seamless integration of backend and frontend components.
Plan your dream vacation effortlessly with our all-in-one travel platform. Whether you’re exploring historic landmarks, relaxing on beaches, or planning family-friendly adventures, our app combines all the tools you need for a seamless experience.
-
Customized Travel Planning:
Design your perfect trip by choosing preferences like historic sites, adventure, events, and budget-friendly activities. -
Hassle-Free Booking:
Book flights, hotels, and transportation directly within the app through trusted third-party integrations—quick, secure, and without redirects. -
Discover Hidden Gems:
Explore unique activities, museums, and historical places, complete with ticket prices and step-by-step directions. -
Instant Notifications:
Stay informed with real-time alerts for your upcoming bookings, events, and activities via in-app notifications and email updates. -
Expert Tour Guides:
Access expert-guided tours with detailed activity breakdowns for a tailored adventure. -
Exclusive In-App Gift Shop:
Shop for products and locally sourced items directly from our app to create lasting memories of your trip.
Start your next adventure with us, and let our platform transform how you explore the world by putting everything you need at your fingertips!
const createNewActivity = async (req, res) => {
const { AdvertiserName, Name, Date, Time, SpecialDiscount, BookingOpen, Price, Location, Category, Tags } = req.body;
try {
const existingCategory = await NewActivityCategoryModel.findOne({ NameOfCategory: Category });
if (!existingCategory) {
return res.status(400).json({ error: "Selected category does not exist!" });
}
const existingTags = await TagsModel.find({ NameOfTags: { $in: Tags } });
if (existingTags.length !== Tags.length) {
return res.status(400).json({ error: "One or more tags do not exist!" });
}
const newActivity = await ActivityModel.create({
AdvertiserName, Name, Date, Time, SpecialDiscount, BookingOpen, Price,
Rating: 0, Location, Category, Tags, Comments: [], RatingCount: 0
});
res.status(200).json({ msg: "New activity is created!", activity: newActivity });
} catch (error) {
res.status(400).json({ error: error.message });
}
};
app.post("/api/createNewActivity", createNewActivity);
const handleCreateActivitySubmit = async (e) => {
e.preventDefault();
try {
const tagsArray = newActivityData.Tags.split(',').map((tag) => tag.trim());
const activityToSubmit = {
AdvertiserName: localStorage.getItem('username'),
Name: newActivityData.Name,
Date: newActivityData.Date,
Time: newActivityData.Time,
SpecialDiscount: newActivityData.SpecialDiscount,
BookingOpen: newActivityData.BookingOpen,
Price: newActivityData.Price,
Location: newActivityData.Location,
Category: newActivityData.Category,
Tags: tagsArray,
};
const response = await axios.post('/api/createNewActivity', activityToSubmit);
alert(response.data.msg);
setIsActivityModalOpen(false);
fetchActivities(); // Refresh activities after creation
setNewActivityData({
Name: '',
Date: '',
Time: '',
SpecialDiscount: '',
BookingOpen: false,
Price: '',
Location: '',
Category: '',
Tags: [],
});
} catch (error) {
setActivityErrorMessage(
error.response?.data?.error || 'An error occurred. Please try again.'
);
}
};
<Modal open={isActivityModalOpen} onClose={() => setIsActivityModalOpen(false)}>
<Box
sx={{
position: "absolute",
top: "50%",
left: "50%",
transform: "translate(-50%, -50%)",
width: "90%", // Adjusted for smaller screens
maxWidth: "600px",
maxHeight: "90vh", // Limit height to viewport height
overflowY: "auto", // Enable vertical scrolling
bgcolor: "background.paper",
borderRadius: "10px",
boxShadow: 24,
p: 4,
}}
>
<Typography variant="h4" align="center" sx={{ marginBottom: "20px" }}>
Create New Activity
</Typography>
<form onSubmit={handleCreateActivitySubmit}>
<TextField
fullWidth
margin="normal"
label="Activity Name"
name="Name"
value={newActivityData.Name}
onChange={handleActivityInputChange}
required
/>
<TextField
fullWidth
margin="normal"
label="Date"
name="Date"
type="date"
value={newActivityData.Date}
onChange={handleActivityInputChange}
InputLabelProps={{ shrink: true }}
required
/>
<TextField
fullWidth
margin="normal"
label="Time"
name="Time"
type="time"
value={newActivityData.Time}
onChange={handleActivityInputChange}
required
/>
<TextField
fullWidth
margin="normal"
label="Special Discount"
name="SpecialDiscount"
value={newActivityData.SpecialDiscount}
onChange={handleActivityInputChange}
/>
<FormControlLabel
control={
<Switch
name="BookingOpen"
checked={newActivityData.BookingOpen}
onChange={handleActivityInputChange}
/>
}
label="Booking Open"
/>
<TextField
fullWidth
margin="normal"
label="Price (USD)"
name="Price"
type="number"
value={newActivityData.Price}
onChange={handleActivityInputChange}
required
/>
<TextField
fullWidth
margin="normal"
label="Location"
name="Location"
value={newActivityData.Location}
onChange={handleActivityInputChange}
required
/>
<TextField
fullWidth
margin="normal"
label="Category"
name="Category"
value={newActivityData.Category}
onChange={handleActivityInputChange}
required
/>
<TextField
fullWidth
margin="normal"
label="Tags (comma-separated)"
name="Tags"
value={newActivityData.Tags}
onChange={handleActivityInputChange}
/>
{activityErrorMessage && (
<Typography color="error" sx={{ marginBottom: "10px" }}>
{activityErrorMessage}
</Typography>
)}
<Button
type="submit"
variant="contained"
sx={{
backgroundColor: "#192959",
color: "white",
padding: "10px",
borderRadius: "4px",
width: "100%",
"&:hover": { backgroundColor: "#4b5a86" },
marginTop: "20px",
}}
>
Create Activity
</Button>
</form>
</Box>
</Modal>
To test the createNewActivity
endpoint using Postman, follow these steps:
- Set the HTTP Method:
POST
- Enter the URL: http://localhost:8000/api/createNewActivity
- Set the Headers:
Content-Type
:application/json
- Select the Body Tab: Choose the raw option and set the body type to
JSON
. - Provide the Request Body: Example JSON payload:
{
"AdvertiserName": "yassinotifa5",
"Name": "Painting Workshop in Paris",
"Date": "2024-12-20",
"Time": "14:00",
"SpecialDiscount": "20%",
"BookingOpen": true,
"Price": 80,
"Location": {
"type": "Point",
"coordinates": [2.3428, 48.8867],
"address": "Montmartre, Paris, France"
},
"Category": "Arts and crafts",
"Tags": ["Cultural", "Romantic", "Historical"]
}
To test the APIs used in the Beyond-Borders project, you can import the following Postman collection:
Follow these steps to set up the project locally:
# Navigate to the desktop
cd desktop
# Clone the repository
git clone https://github.com/Advanced-computer-lab-2024/Beyond-Borders.git
# Navigate into the project directory
cd Beyond-Borders
# Open the project in Visual Studio Code
code .
# Install backend dependencies
npm install
# Navigate to the source folder
cd src
# Start the backend server
node app
# Navigate to the frontend folder
cd frontend
# Navigate to the React app folder
cd myapp
# Install frontend dependencies
npm install
# Start the frontend development server
npm start
Below are the APIs used in the Beyond-Borders project:
-
City Codes API:
https://test.api.amadeus.com/v1/reference-data/locations -
Flights API:
https://test.api.amadeus.com/v2/shopping/flight-offers -
Hotels by City API:
https://test.api.amadeus.com/v1/reference-data/locations/hotels/by-city -
Hotel Offers API:
https://test.api.amadeus.com/v3/shopping/hotel-offers -
Currency Exchange Rates API:
https://api.exchangerate-api.com/v4/latest/EGPStripe API:
Stripe is used for secure payment processing in the Beyond-Borders platform. Below are the keys used for integrating Stripe:- Secret Key:
sk_test_51QLqHGP7Sjm96OcqEPPQmxSyVbLV9L7Rnj9v67b7lvTT37QGD1aUroGnGnpU4rm8a7CgNrTpNOalXtiXfwofP3pC00FSmMdarL
- Publishable Key:
pk_test_51QLqHGP7Sjm96OcqAOCQWfQuEwmMBxXj7hieiaUq1Q0m4qd0xaW9xi2GwrQbTb89OHEXUoIyhuAP29EhDlNYXYlC00HnsADGB1
- Secret Key:
Note: The secret key should be kept private and used only in server-side code to maintain security. Avoid exposing it in frontend code or public repositories.
-
GET Products by Seller API: Fetches a list of products created by a specific seller. Requires the seller's username as a query parameter. http://localhost:8000/api/getProductsBySeller
-
GET View Archived Products by Seller API: Fetches a list of archived products for a specific seller. Requires the seller's username as a query parameter. http://localhost:8000/api/viewMyArchivedProductsSeller
-
POST Archive Product API: Archives a product, making it invisible to customers. Requires the product's ID in the request body. http://localhost:8000/api/archiveProduct
-
POST Unarchive Product API: Unarchives a product, making it visible to customers again. Requires the product's ID in the request body. http://localhost:8000/api/unarchiveProduct
-
GET Sort Products in Ascending Order API: Retrieves a list of products sorted in ascending order by price. http://localhost:8000/api/sortProductsAscendingAdmin
-
PUT Edit Product API: Updates the details of a product, including price, quantity, and description. Requires the product's ID and updated fields in the request body. http://localhost:8000/api/editProductSeller
-
POST Add Product API: Creates a new product listing for the seller. Requires the product's details (e.g., name, price, quantity, and description) in the request body. http://localhost:8000/api/addProductSeller
-
GET View Seller Profile API:Fetches the profile information of the seller. Requires the seller's username as a query parameter. http://localhost:8000/api/readSellerProfile
-
PUT Update Seller Profile API: Updates the seller's profile information http://localhost:8000/api/updateSeller
-
GET View All Products API: Fetches a list of all products created by all sellers. http://localhost:8000/api/viewAllProductsSeller
-
GET Search Products API: Searches for products by name. Requires the product name as a query parameter. http://localhost:8000/api/viewProductsSeller
-
GET Filter Products by Price API: Filters products based on a price range. http://localhost:8000/api/filterProductByPriceSeller
-
POST Request Account Deletion API: Submits a request to delete the seller's account. http://localhost:8000/api/requestDeleteAccountSeller
-
GET Apply Promo Code API: Validates and applies a promo code. Requires the promo code as a query parameter. http://localhost:8000/applyPromoCode
-
Pay for Historical Place API-Stripe: Processes payments for historical places. http://localhost:8000/payHPStripe
Follow these steps to use the Beyond-Borders platform:
-
Login as a Guest:
- On the login page, select the Continue as Guest option.
- You will be redirected to the Guest Homepage.
-
Guest Homepage:
- The homepage provides a top bar containing :
- Register Now Button:
- Click this button to go to the registration page.
- On the registration page, you can choose to register as one of the following:
- Tourist
- Tour Guide
- Advertiser
- Transportation Advertiser
- Seller
- Register Now Button:
- The homepage provides a top bar containing :
-
Navigation:
- The platform includes a side navigation bar with buttons for the following features:
- Activities: Explore upcoming activities available.
- Itineraries: View upcoming itineraries.
- Museums: Discover upcoming museum events and exhibitions.
- Historical Places: Find and view details about upcoming events at historical landmarks.
- Click on any button to be redirected to the corresponding page for more information.
- The platform includes a side navigation bar with buttons for the following features:
The guest experience is designed to provide a preview of what the platform offers, while also encouraging registration for a more personalized and feature-rich experience.
-
Login:
- Use your registered username and password to log in to the platform.
- If you forgot your password, click the Forgot Password button.
- An OTP will be sent to your registered email. Use it to reset your password.
-
Tourist Homepage:
- After logging in, you will be redirected to the Tourist Homepage.
- The homepage features cards displaying activities, itineraries, and historical places.
- Click on any card to view more details and access the relevant page.
-
Navigation:
- The platform includes a side navigation bar with buttons for the following features:
- Flights: View and book flights.
- Hotels: Browse and reserve accommodations.
- Activities: Explore and book upcoming activities.
- Itineraries: Access upcoming, completed, and saved itineraries.
- Museums: Discover and book museum events.
- Historical Places: Find and book visits to historical landmarks.
- Products: Browse and purchase products.
- Transportation: View and book transportation options.
- Complaints: File complaints or view submitted ones.
- Saved Events: Access events you’ve saved for later.
- Orders: View your product orders.
- The platform includes a side navigation bar with buttons for the following features:
-
Top Bar:
- The top bar contains the following features:
- Profile Button: View and update your profile details.
- Notifications Bell: Check notifications for updates and alerts.
- Cart Icon: Access your shopping cart to review or update your product selections.
- Wishlist Icon: View and manage your wishlist items.
- Logout Button: Log out of your account.
- The top bar contains the following features:
-
Bookings and Purchases:
- You can view all your current and past bookings, including activities, itineraries, events, flights and hotel reservations.
- Book events, buy products, and explore various travel options seamlessly on the platform.
-
Login as Admin:
- Enter your admin credentials on the login page.
- Upon successful login, you will be redirected to the Admin Statistics/App Revenue Dashboard.
-
Top Bar Features:
- The top bar provides the following functionalities:
- Change My Password:
- Click this button to change your current password.
- A form will appear to enter the current password and the new password.
- Manage Access:
- Click this button to view a dropdown menu with the following options:
- Add Admin: Add new administrators to the platform.
- Add Tourism Governor: Assign new tourism governors to manage their respective areas.
- Requests: View and manage pending user or event-related requests.
- Delete Requests: Review and delete specific requests or records as needed.
- Click this button to view a dropdown menu with the following options:
- Notifications Bell:
- Displays notifications for any out-of-stock products created by the admin.
- Clicking the bell shows a dropdown list of recent notifications.
- Logout:
- Allows the admin to securely log out of the platform.
- Change My Password:
- The top bar provides the following functionalities:
-
Side Navigation Bar:
- The side navigation bar includes the following features for managing platform content:
- Complaints: View and address user complaints or feedback.
- Products: Manage product listings, including adding, editing, or removing products.
- Activities: Oversee and update activities available on the platform.
- Itineraries: Manage itineraries, including creating or editing existing entries.
- The side navigation bar includes the following features for managing platform content:
-
Admin Interface:
- The admin interface is tailored to provide full control and management capabilities, ensuring the smooth operation of the Beyond-Borders platform.
-
Login as Advertiser:
- Enter your advertiser credentials on the login page.
- Upon successful login, you will be redirected to the Advertiser Statistics and Revenue Dashboard, where you can view your performance metrics and revenue details.
-
Top Bar Features:
- The top bar includes the following functionalities:
- View My Profile:
- Click this button to view your profile information, including personal details and account settings.
- Notifications Bell:
- Displays important notifications related to your activities.
- Logout:
- Click this button to securely log out of your account.
- View My Profile:
- The top bar includes the following functionalities:
-
Side Navigation Bar:
- The side navigation bar includes the following feature:
- Activities:
- View and manage your activities.
- You can add new activities, update details for existing ones, or remove activities as needed.
- Activities:
- The side navigation bar includes the following feature:
-
Advertiser Interface:
- The advertiser interface is designed to provide insights into your performance and tools to manage your activities efficiently.
-
Login as Tour Guide:
- Enter your tour guide credentials on the login page.
- Upon successful login, you will be redirected to the Tour Guide Statistics and Revenue Dashboard, where you can view performance metrics and earnings.
-
Top Bar Features:
- The top bar includes the following functionalities:
- View My Profile:
- Click this button to view your profile information, including personal details and account settings.
- Notifications Bell:
- Displays important notifications related to your itineraries or feedback from tourists.
- Logout:
- Click this button to securely log out of your account.
- View My Profile:
- The top bar includes the following functionalities:
-
Side Navigation Bar:
- The side navigation bar includes the following feature:
- Itineraries:
- View and manage your itineraries.
- You can create new itineraries, update existing ones, or review feedback related to them.
- Itineraries:
- The side navigation bar includes the following feature:
-
Tour Guide Interface:
- The tour guide interface is tailored to provide tools for managing itineraries and insights into your performance.
-
Login as Seller:
- Enter your seller credentials on the login page.
- Upon successful login, you will be redirected to the Seller Statistics and Revenue Dashboard, where you can view performance metrics, revenue, and sales data for your products.
-
Top Bar Features:
- View My Profile:
- Click this button to view your profile information, including personal details, business details, and account settings.
- Notifications Bell:
- Displays important notifications related to your products, such as low stock or customer feedback.
- Logout:
- Click this button to securely log out of your account.
- View My Profile:
-
Side Navigation Bar:
- Products:
- View and manage your product listings.
- Add new products, update details for existing products (e.g., price, description, and stock availability), or remove products from your catalog.
- Monitor customer reviews and feedback to improve your offerings.
- Products:
-
Seller Interface:
- The seller interface is designed to provide all the tools and insights needed to effectively manage your product catalog, enhance customer satisfaction, and boost sales.
-
Login as Tourism Governor:
- Enter your credentials on the login page.
- Upon successful login, you will be redirected to the Historical Places and Museums Management Page, where you can view and manage your listed historical places and museums.
-
Top Bar Features:
- View My Profile:
- Click this button to view your profile details, including your account and responsibilities.
- Notifications Bell:
- Displays important notifications, such as feedback from visitors or urgent updates for your locations.
- Logout:
- Click this button to securely log out of your account.
- View My Profile:
-
Side Navigation Bar:
- Historical Places:
- Manage your listed historical places.
- Add new locations with details such as descriptions, ticket prices, and opening hours.
- Update or remove existing listings as needed.
- Museums:
- View and manage museums under your jurisdiction.
- Add new museum events, update exhibits, and adjust visitor details.
- Historical Places:
-
Tourism Governor Interface:
- The Tourism Governor dashboard ensures seamless management of historical places and museums while providing tools to enhance visitor experiences and operations.
-
Login as Transportation Advertiser:
- Enter your credentials on the login page.
- Upon successful login, you will be redirected to the Transportation Management Page, where you can view and manage your transportation services.
-
Top Bar Features:
- View My Profile:
- Click this button to view your profile details, including account information and service offerings.
- Notifications Bell:
- Displays important notifications, such as inquiries or updates about your listed transportation services.
- Logout:
- Click this button to securely log out of your account.
- View My Profile:
-
Side Navigation Bar:
- Transportations:
- Manage your listed transportation services.
- Add new transportation options, such as buses, taxis, or private cars.
- Update or remove existing transportation services.
- Monitor customer feedback and bookings for better service optimization.
- Transportations:
-
Transportation Advertiser Interface:
- The Transportation Advertiser dashboard provides all necessary tools for managing and promoting transportation services effectively, ensuring streamlined operations and enhanced visibility.
We welcome contributions to improve Beyond-Borders! Follow these steps:
1.Fork the Repository. 2.Clone Your Fork:
git clone https://github.com/your-username/Beyond-Borders.git
3.Create a New Branch:
git checkout -b feature/your-feature-name
4.Make Changes. 5.Commit Changes:
git commit -m "Add your commit message"
6.Push Changes:
git push origin feature/your-feature-name
7.Submit a Pull Request
- Ensure clean and modular code: Write code that is easy to understand and reusable.
- Test thoroughly before submitting: Verify that your changes work as intended and do not introduce bugs.
- Reference any issues your contribution resolves: Link to the relevant issue(s) in your pull request description.
- Be respectful and constructive during reviews: Foster a positive and collaborative environment.
Together, let's build a better Beyond-Borders!
We would like to acknowledge and thank the following sources of inspiration and resources that helped in building Beyond-Borders:
-
Talabat:
- Inspired us to design the Products Page, including features like ratings, shopping cart functionality, and wishlist.
-
Amazon:
- Provided inspiration for implementing an efficient Products Page, focusing on user-friendly shopping experiences with comprehensive product details.
-
TripAdvisor:
- Served as a reference for creating the Homepages for both tourists and guests, ensuring an intuitive layout and easy navigation to explore activities, itineraries, museums, and historical places.
The ideas and concepts from these platforms guided us in crafting a cohesive and feature-rich experience for our users.