Skip to content

nahidkishore/wanderlust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wanderlust Three Tier Application Containerization


Wanderlust - Your Ultimate Travel Blog 🌍✈️

WanderLust is a simple MERN travel blog website ✈ This project is aimed to help people to contribute in open source, upskill in react and also master git.

Preview Image

🎯 Goal of this project

At its core, this project embodies two important aims:

  1. Start Your Open Source Journey: It's aimed to kickstart your open-source journey. Here, you'll learn the basics of Git and get a solid grip on the MERN stack and I strongly believe that learning and building should go hand in hand.
  2. React Mastery: Once you've got the basics down, a whole new adventure begins of mastering React. This project covers everything, from simple form validation to advanced performance enhancements. And I've planned much more cool stuff to add in the near future if the project hits more number of contributors.

I'd love for you to make the most of this project - it's all about learning, helping, and growing in the open-source world.

Setting up the project locally

Setting up the Backend

  1. Fork and Clone the Repository

    git clone https://github.com/{your-username}/wanderlust.git
  2. Navigate to the Backend Directory

    cd backend
  3. Install Required Dependencies

    	# installs NVM (Node Version Manager)
     curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
     # download and install Node.js
     nvm install 20
     # verifies the right Node.js version is in the environment
     node -v # should print `v20.12.1`
     # verifies the right NPM version is in the environment
     npm -v # should print `10.5.0`
     npm i
  4. Set up your MongoDB Database

    • Open MongoDB Compass and connect MongoDB locally at mongodb://localhost:27017.
  5. Import sample data

    To populate the database with sample posts, you can copy the content from the backend/data/sample_posts.json file and insert it as a document in the wanderlust/posts collection in your local MongoDB database using either MongoDB Compass or mongoimport.

    mongoimport --db wanderlust --collection posts --file ./data/sample_posts.json --jsonArray
  6. Configure Environment Variables

    cp .env.sample .env
  7. Start the Backend Server

    npm start

    You should see the following on your terminal output on successful setup.

    [BACKEND] Server is running on port 5000
    [BACKEND] Database connected: mongodb://127.0.0.1/wanderlust

Setting up the Frontend

  1. Open a New Terminal

    cd frontend
  2. Install Dependencies

    npm i
  3. Configure Environment Variables

    cp .env.sample .env.local
  4. Launch the Development Server

    npm run dev
MONGODB_URI="mongodb://127.0.0.1/wanderlust"
CORS_ORIGIN="http://localhost:5173"

#MONGODB_URI="mongodb://mongo/wanderlust" //database container name, like my mongo container name is mongo
#CORS_ORIGIN="http://ec2-ip-address:5173"  // add here public ip address, and add frontend port

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published