How misterneo/monkey-app-clone works
Project type and purpose
• This is a full-stack, real-time video-chat “Monkey App Clone” comprising:
• A ReactJS SPA frontend (Vite) that handles user interface, state (Redux), WebRTC peer connections (PeerJS), and WebSocket signaling (react-use-websocket).
• A BunJS backend that exposes an HTTP server (serving WebSocket upgrades) for pairing users and relaying WebRTC signaling messages.
• Docker Compose to orchestrate two containers: one for client (port 5173) and one for server (port 3000).
File structure
• Top level:
• client/ → React application (src/, public/, Vite & Tailwind config, Dockerfile, .env.example).
• server/ → BunJS app (index.ts - HTTP + WebSocket server, utils/, pm2 config, Dockerfile, tsconfig).
• docker-compose.yml orchestrates both.
• Patterns:
• client/src/features/main & /messaging subdivide UI into the video-chat flow and DataChannel chat flow (Redux slices, components).
• client/src/utils/usePeer.js & constants/helpers manage PeerJS initialization and config.
• server/utils/websocketHandler.ts implements pairing logic and routes signaling messages.
README
• Confirms use of React, Redux Toolkit, PeerJS (WebRTC), react-use-websocket, BunJS, Docker Compose.
• No persistent database—peer-to-peer media and data is ephemeral; server only handles signaling.
• Running modes: BunJS locally or containerized with Docker Compose.
Detail
• Every distinct module as its own node: WebSocket Handler, PeerJS Init, Redux Store, video components, data components.
• Don’t oversimplify—show the two-phase connection (signaling vs direct P2P).
• Ports (5173, 3000) and mention environment variables (.env.local → VITE_SERVER_PORT).