1021 B
1021 B
Docker Setup
Run the full stack with:
docker compose up --build
Services:
- Frontend:
http://localhost:5173 - Backend:
http://localhost:4000 - MongoDB:
mongodb://localhost:27017/chatapp
The Compose file starts all required services together:
frontendas a Vite containerbackendas a Node/Express containermongowith a persistentmongo-datavolume
Stop everything with:
docker compose down
Remove containers and database volume with:
docker compose down -v
Local Development Without Docker
-
Copy the backend environment file:
cp Backend/.env.example Backend/.env -
Start MongoDB locally or with Docker.
-
Start the backend:
cd Backend && npm run dev
The backend tries MongoDB at mongodb://127.0.0.1:27017/chatapp first and falls back to Backend/data/db.json only if MongoDB is unavailable. Use DATA_STORE=mongo to fail fast on MongoDB errors, or DATA_STORE=json to force the JSON store.