Single-repo app with:
- React frontend
- Express + Socket.IO backend (
server.js) - MongoDB via
MONGODB_URI
Create .env in project root with:
MONGODB_URI=your_mongodb_connection_string
PORT=5000Optional frontend API override for split deployments:
REACT_APP_API_URL=http://localhost:5000If REACT_APP_API_URL is not set, frontend calls same host (recommended for production).
npm install
npm run devThis runs backend and frontend together.
npm install
npm run build
npm startnpm start runs server.js, and the server also serves the React build folder, so frontend + backend are hosted together from one process.
npm run dev-> backend + frontend together for developmentnpm run server-> backend onlynpm run start:client-> frontend dev server onlynpm run build-> production frontend buildnpm start-> production server (serves API + static build)