@@ -99,6 +99,71 @@ MailMERN/
9999git clone https://github.com/OPCODE-Open-Spring-Fest/MailMERN.git
100100cd MailMERN
101101```
102+
103+ ## 🐳 Run with Docker (Recommended for Development & Testing)
104+
105+ You can now easily run the entire ** MailMERN** stack (Frontend + Backend + MongoDB) using ** Docker Compose** — no manual setup needed!
106+
107+ ---
108+
109+ ### 1️⃣ Prerequisites
110+ Make sure you have these installed:
111+ - [ Docker] ( https://docs.docker.com/get-docker/ )
112+ - [ Docker Compose] ( https://docs.docker.com/compose/install/ )
113+
114+ ---
115+
116+ ### 2️⃣ Setup Environment Variables
117+ Create a ` .env ` file inside the ` backend/ ` folder (if not already present):
118+
119+ ``` env
120+ PORT=5000
121+ MONGO_URI=mongodb://mongo:27017/mailmern
122+ 123+ EMAIL_PASS=your_app_password
124+ OPENAI_API_KEY=your_openai_key
125+
126+ SMTP_HOST=smtp.gmail.com
127+ SMTP_PORT=587
128+ SMTP_SECURE=false # true for 465, false for 587
129+ 130+ SMTP_PASS=your_app_password
131+ EMAIL_FROM="MailMERN [email protected] " 132+ 133+ NODE_ENV=development
134+ ```
135+
136+ ### 3️⃣ Start the Containers
137+
138+ From the project root, run:
139+
140+ ``` bash
141+ docker-compose up --build
142+ ```
143+
144+ This will:
145+
146+ 🧩 Start the MongoDB container
147+
148+ ⚙️ Run the Express backend on port 5000
149+
150+ 💻 Serve the React frontend on port 5173
151+
152+ Once started:
153+
154+ Frontend: http://localhost:5173
155+
156+ Backend API: http://localhost:5000/api
157+
158+ ### 4️⃣ Stopping Containers
159+
160+ To stop and remove all running containers, use:
161+
162+ ``` bash
163+ docker-compose down
164+ ```
165+ ---
166+ ## Individual Setup
1021672️⃣ Backend Setup
103168``` bash
104169cd backend
112177EMAIL_PASS=your_app_password
113178OPENAI_API_KEY=your_openai_key
114179```
180+
115181Run the backend:
116182``` bash
117183npm run dev
0 commit comments