How saeetarde/photo-booth works
Booth for Two is a browser-based, two-person photo booth. A visitor creates or enters a room code, shares the room link, and joins a live camera call; either partner can trigger a synchronized four-shot session, optionally decorate the video with a face-tracked bunny overlay, apply a photo style, and download the resulting strip. The server serves the pages and relays room signaling and session-start events, while media travels peer-to-peer through WebRTC. The graph follows the supplied source; landing and page markup are represented by their exact paths, but their contents were not sampled.
Main entry points: booth.js Booth controls · socket.js WebSocket client · server.js HTTP and signaling · webrtc.js Peer call
Components 18
Room entry
- Room entry UI
public/index.html - Create or join
public/js/landing.js - Booth page
public/booth.html - Booth controls
public/js/booth.js
Live connection
- WebSocket client
public/js/socket.js - Peer call
public/js/webrtc.js - Camera and mic
- STUN service
Photo creation
- Four-shot capture
public/js/capture.js - Face-tracked overlay
public/js/doodle.js - Face models
- Strip composition
public/js/strip.js - Photo styles
public/js/filters.js - Downloaded image
Server runtime
- HTTP and signaling
server.js - Room membership
server.js
Other components
- Visitor
- Room partner
Connections 25
- Visitor → Room entry UI: opens
- Room entry UI → Create or join: loads script
- Create or join → Booth page: navigates to
- Visitor → Booth controls: uses controls
- HTTP and signaling → Room entry UI: serves page
- HTTP and signaling → Booth page: serves room page
- Booth controls → WebSocket client: creates client
- WebSocket client → HTTP and signaling: joins and signals
- HTTP and signaling → Room membership: updates membership
- HTTP and signaling → WebSocket client: relays events
- WebSocket client → Peer call: delivers signaling
- Peer call → Camera and mic: requests media
- Peer call → STUN service: uses ICE service
- Peer call → Room partner: negotiates peer call
- Room partner → Peer call: streams media
- Booth controls → Four-shot capture: starts session
- Booth controls → WebSocket client: sends snap start
- WebSocket client → Room partner: relays snap start
- Booth controls → Face-tracked overlay: controls overlay
- Face-tracked overlay → Face models: loads models
- Four-shot capture → Face-tracked overlay: reads composite
- Four-shot capture → Strip composition: passes shots
- Booth controls → Strip composition: renders result
- Strip composition → Photo styles: applies style
- Booth controls → Downloaded image: exports PNG