@@ -8,10 +8,7 @@ This project is configured to work seamlessly in GitHub Codespaces or with VS Co
882 . The devcontainer will automatically:
99 - Spin up a MongoDB instance (Atlas Local)
1010 - Install all dependencies
11- - Seed sample data each time the Codespace starts
12- - Start the Express API on port 5050
13- - Start the React app on port 5173
14- - Open the React app in the built-in Codespaces browser preview
11+ - Seed sample data
1512
1613## Using with VS Code Dev Containers
1714
@@ -32,21 +29,20 @@ Once the devcontainer is running:
3229
3330## Quick Start in Codespaces
3431
35- Once the devcontainer is fully loaded, the app should already be running.
36-
37- If you want to check logs:
32+ Once the devcontainer is fully loaded (wait for "Poststart" to complete):
3833
3934``` bash
40- tail -f /tmp/mern-server.log
41- tail -f /tmp/mern-client.log
42- ```
43-
44- If you need to restart startup tasks manually:
35+ # Terminal 1: Start the Express server
36+ cd mern/server
37+ npm start
4538
46- ``` bash
47- bash .devcontainer/startup.sh
39+ # Terminal 2: Start the React dev server
40+ cd mern/client
41+ npm run dev
4842```
4943
44+ Then open http://localhost:5173 in your browser.
45+
5046## Database Credentials
5147
5248- ** Host** : ` mongodb ` (inside container) or ` localhost:27017 ` (from host)
@@ -75,9 +71,8 @@ The devcontainer includes these extensions:
7571
7672### MongoDB connection issues
7773``` bash
78- # Check if mongodb is running
79- cd mern/server
80- node --input-type=module -e " import { MongoClient } from 'mongodb'; const c = new MongoClient(process.env.ATLAS_URI || 'mongodb://admin:mongodb@mongodb:27017/employees'); await c.connect(); console.log(await c.db('admin').command({ ping: 1 })); await c.close();"
74+ # Check if MongoDB is running
75+ mongosh -u admin -p mongodb --eval " db.adminCommand('ping')"
8176```
8277
8378### Port conflicts
0 commit comments