This is a full-stack three-tier web application built with:
- Frontend: React + Nginx
- Backend: Node.js + Express
- Database: MongoDB Atlas (Cloud DB)
.
- ├── backend/ # Express.js backend API
- ├── frontend/ # React frontend (served via Nginx)
- ├── docker-compose.yml # Docker Compose configuration file
- └── README.md # Project documentation
- Fork the repository
git clone https://github.com/<your-username>/<your-repo>.git
- cd your-repo
- Go to: https://www.mongodb.com/cloud/atlas
- Sign up (Google/GitHub/Email)
- After login, click "Build a Database"
- 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)
- 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
- 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.
- Create a .env file inside the backend/ folder:
MONGO_URI="mongodb+srv://<username>:<password>@cluster0.mongodb.net/three-tier-db?retryWrites=true&w=majority" cd backend node server.js
cd frontend npm start