OpenBabyPhone is a browser-based baby monitor built with a Vite + React frontend and a Node.js signaling backend, both written in TypeScript. The baby device publishes live camera video and microphone audio, runs lightweight crib motion detection on the camera feed, and the parent device receives both the stream and live movement alerts over WebRTC and Socket.IO. The parent can also switch the session into audio-only mode to reduce bandwidth use and pause the baby device camera for lower battery drain.
https://openbabyphone.wirewire.de/
- Frontend: React, Vite, TypeScript, Tailwind CSS, React Router, Socket.IO client
- Backend: Node.js, Express, TypeScript, Socket.IO
- Streaming: WebRTC with configurable STUN and TURN servers
- Deployment: Single Dockerized Node service that also serves the built frontend
-
Install dependencies:
npm install
-
Start both services in development mode:
npm run dev
-
Open the app:
- Frontend: http://localhost:5173
- Backend health check: http://localhost:3001/health
The Vite dev server proxies /api and /socket.io traffic to the backend, so the frontend can use same-origin URLs in both development and production.
Copy .env.example and adjust values as needed.
PORT=3001
CORS_ORIGIN=http://localhost:5173
ICE_SERVERS=[{"urls":"stun:stun.l.google.com:19302"}]ICE_SERVERS expects JSON that can be passed directly to the WebRTC RTCPeerConnection constructor.
Example with TURN support:
ICE_SERVERS=[
{"urls":"stun:stun.l.google.com:19302"},
{
"urls":["turn:turn.example.com:3478?transport=udp","turn:turn.example.com:3478?transport=tcp"],
"username":"turn-user",
"credential":"turn-password"
}
]npm run build
npm run startThe backend serves frontend/dist in production, so you only need one deployed service.
This repository is set up for a Dockerfile-based deployment in Coolify.
- Create a new application from the repository.
- Select Dockerfile build mode.
- Expose port
3001. - Set the health check path to
/health. - Configure these environment variables in Coolify:
PORT=3001ICE_SERVERS=...with your STUN/TURN JSON when neededCORS_ORIGIN=https://your-domain.exampleif you want to restrict non-same-origin access
- Enable HTTPS in Coolify. Browser camera and microphone access requires a secure origin outside localhost.
- If frontend and backend run under the same domain, the default same-origin Socket.IO setup works without extra client configuration.
- For monitoring across different networks, add a TURN service. STUN alone is often not enough through mobile carriers or strict NATs.
- Keep the baby device awake and connected to power during longer sessions.
- Open the Baby Device view.
- Allow camera and microphone access.
- Share the generated room code or QR link.
- Open the Parent Device view on another browser.
- Enter the room code or use the QR-generated link.
- Choose between Video + audio or Audio only on the parent device.
- The parent browser creates a WebRTC offer, the baby browser answers, and the signaling server relays ICE candidates until the direct media path is established.
The current implementation has been validated with:
npm installnpm run buildGET /healthGET /api/config- Rendering the built landing page through the backend server