An e-commerce hotel/accomodation booking website based on the MERN Stack (MongoDB, Express.js, React.js, Node.js)
The website is implemented with the following features:
- User login/logout
- Buyers can browse for the available hotels at the homepage, plus making a booking.
- Sellers can upload and manage the hotel room for sale.
See the final results here: Website Preview
git clone https://github.com/junwai7159/mern-project.git
cd mern-project
-
Create your own MongoDB account by visiting the MongoDB website and signing up for a new account.
-
Create a new database or cluster by following the instructions provided in the MongoDB documentation. Remember to note down the "Connect to your application URI" for the database, as you will need it later. Also, make sure to change
<password>
with your own password -
add your current IP address to the MongoDB database's IP whitelist to allow connections (this is needed whenever your ip changes)
In the .env file, find the line that reads:
MONGO_URL="your-mongodb-url"
Replace "your-mongodb-url" with the actual URL of your MongoDB database.
In your terminal, navigate to the /backend directory of the project and run the following command to install the backend dependencies:
cd api
yarn install
This command will install all the required packages specified in the package.json file.
In the same terminal, run the following command to start the backend server:
node index.js
This command will start the backend server, and it will listen for incoming requests.
Open a new terminal window , and run the following command to install the frontend dependencies:
cd client
yarn install
This command will navigate to the frontend directory within the project and install all the required packages for the frontend.
After installing the frontend dependencies, run the following command in the same terminal to start the frontend server:
yarn start
The website link will be provided in the same terminal.