Skip to content

Latest commit

 

History

47 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

🧱 Three-Tier MERN Application

This is a full-stack three-tier web application built with:

  • Frontend: React + Nginx
  • Backend: Node.js + Express
  • Database: MongoDB Atlas (Cloud DB)

📁 Folder Structure

.

  • ├── backend/ # Express.js backend API
  • ├── frontend/ # React frontend (served via Nginx)
  • ├── docker-compose.yml # Docker Compose configuration file
  • └── README.md # Project documentation

📥 Step 1: Clone the Repository

  • Fork the repository
 git clone https://github.com/<your-username>/<your-repo>.git 
  • cd your-repo

MongoDB Atlas

1️⃣ Create a MongoDB Atlas Account

2️⃣ Create Free Cluster

  • Choose “Shared” Tier (Free) → Click "Create"
  • Cloud Provider & Region: Choose AWS or GCP (select a nearby region)
  • Cluster Name: e.g., three-tier-cluster
  • Click Create Cluster (takes ~1-2 minutes)

4️⃣ Add IP Whitelist

  • Go to "Network Access"
  • Click “Add IP Address”
  • Choose ALLOW ACCESS FROM ANYWHERE (0.0.0.0/0) for now
  • You can restrict to your EC2 IP for production

5️⃣ Get the Connection String

  • Go to Clusters > Connect > Connect your application
  • Choose driver: Node.js, version >= 3.6
  • Copy the URI:
 MONGO_URI="mongodb+srv://<username>:<password>@cluster0.mongodb.net/three-tier-db?retryWrites=true&w=majority" 
-

Replace with your actual password.

6️⃣ Add Environment Variables

  • Create a .env file inside the backend/ folder:

backend/.env

MONGO_URI="mongodb+srv://<username>:<password>@cluster0.mongodb.net/three-tier-db?retryWrites=true&w=majority" 

7️⃣ Run the Application

Backend

cd backend
node server.js

Frontend

cd frontend
npm start

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages