TravelTroop
TravelTroop is a full-stack web application developed using the MERN (MongoDB, Express, React, Node.js)stack. It offers a comprehensive set of features for users to explore accommodations, make reservations, manage their profiles, and list properties for rent.
Key Features
-
User Authentication and Authorization: Users can register, log in securely with JWT (JSON Web Tokens), and access various parts of the application based on their roles.
-
Home Page: The home page showcases a curated selection of accommodations available for booking.
-
Profile Page:Each user has a dedicated profile page to view user details
but does not currently support user information updates
. Users can view their personal information. It also includes a logout button for user convenience. -
My Accommodation: Hosts can list their properties on the "My Accommodation" page. They can provide detailed information about their accommodations, including descriptions, images, pricing, and availability.
-
My Booking: Users can review their booking history, including current and past reservations.
Please note that the "My Booking Page" does not currently support the cancellation of bookings.
Technology Stack
- Frontend: The frontend leverages React, a popular JavaScript library, for crafting dynamic and responsive user interfaces. React Router manages declarative routing. built using the following technologies and dependencies:
-
React: A popular JavaScript library for building user interfaces.
- Version: ^18.2.0
-
React DOM: A package for React that provides DOM-specific methods.
- Version: ^18.2.0
-
React Router DOM: A declarative routing library for React applications, facilitating navigation within the application.
- Version: ^6.15.0
-
axios: A promise-based HTTP client for making API requests from the client-side, enabling seamless communication with the server.
- Version: ^1.4.0
-
date-fns: A versatile library for date and time formatting, manipulation, and parsing, enhancing date-related functionalities.
- Version: ^2.30.0
- Backend: Node.js and Express.js power the backend, managing server-side logic and API endpoints. MongoDB serves as the NoSQL database for storing application data, and Mongoose serves as the Object Data Modeling (ODM) library.
-
Express: A Node.js web application framework, used for building the server-side logic and API endpoints.
- Version: ^4.18.2
-
MongoDB: A NoSQL database used to store application data, with MongoDB as the driver.
- Version: ^5.7.0
-
Mongoose: An Object Data Modeling (ODM) library used to interface with MongoDB, facilitating data manipulation.
- Version: ^7.4.3
-
jsonwebtoken: A library for generating and validating JSON Web Tokens (JWT), providing secure user authentication.
- Version: ^9.0.1
-
bcryptjs: A library for hashing and salting passwords, enhancing user password security.
- Version: ^2.4.3
-
multer: Middleware for handling multipart/form-data, used for file uploads.
- Version: ^1.4.5-lts.1
-
cookie-parser: Middleware for parsing cookies in incoming HTTP requests.
- Version: ^1.4.6
-
cors: Middleware for enabling Cross-Origin Resource Sharing (CORS), allowing secure interactions with frontend applications.
- Version: ^2.8.5
-
dotenv: A zero-dependency module for loading environment variables from a .env file, enhancing configuration management.
- Version: ^16.3.1
-
image-downloader: A library for downloading images from the web, useful for handling images in the application.
- Version: ^4.3.0
-
Authentication: Secure user authentication is implemented using JWT (JSON Web Tokens).
-
Data Retrieval: Axios, a promise-based HTTP client, facilitates API requests from the client-side to fetch data from the server.
Installation and Usage
To run TravelTroop locally:
- Clone the repository to your local machine.
- Navigate to the project root directory in the terminal.
- Install necessary dependencies using your preferred package manager (e.g.,
yarn
ornpm install
). - Set up environment variables for MongoDB connection, JWT secret, JWT token expiry, and cookie duration.
- Start both frontend and backend servers.