How zidian23345/github_webrtc works
This is a browser-based real-time communications product with an Android WebView companion. The main workflow is users entering the chat, exchanging group or friend messages, and starting voice/video calls or screen sharing; the server coordinates signaling and persists selected chat and account state. Separate branches cover friendship, administration, and Android notifications, native screen capture, and app updates. README capabilities inform the broader subsystem map; sampled server and client excerpts are partial, so uncertain internal wiring is omitted.
Main entry points: server.js HTTP and signaling · home.ejs Chat interface · webrtc-room.js Room WebRTC · MainActivity.kt WebView app
Components 21
Web experience
- Chat interface
views/home.ejs - Call room
views/room.ejs - Chat client
public/scripts/chat.js - Client utilities
public/scripts/util.js
Realtime media
- Call controls
public/scripts/main.js - Room WebRTC
public/scripts/webrtc-room.js
Server services
- HTTP and signaling
server.js - Friend and message data
data - Chat history
data/chat-history.json - Admin console
views/admin.ejs - Admin login
views/admin_login.ejs
Android companion
- WebView app
_android_project/app/src/main/java/com/webrtc/screenshare/MainActivity.kt - Server settings
_android_project/app/src/main/java/com/webrtc/screenshare/ServerConfig.kt - App settings
_android_project/app/src/main/java/com/webrtc/screenshare/SettingsActivity.kt - Native screen capture
_android_project/app/src/main/java/com/webrtc/screenshare/ScreenCaptureService.kt - Chat notifications
_android_project/app/src/main/java/com/webrtc/screenshare/ChatNotificationService.kt
Other components
- Participant
- Web browser
- WebRTC media peers
- STUN service
- Android system
Connections 29
- Participant → Chat interface: opens chat
- Web browser → Chat interface: loads page
- Chat interface → Client utilities: uses client setup
- Chat interface → Chat client: loads chat
- Chat interface → Call controls: loads controls
- Participant → Call room: joins call
- Web browser → Call room: loads page
- Call room → Room WebRTC: loads WebRTC
- Room WebRTC → HTTP and signaling: signals peers
- Call controls → WebRTC media peers: sends media
- Room WebRTC → WebRTC media peers: sends media
- Room WebRTC → STUN service: discovers routes
- Chat client → HTTP and signaling: sends messages
- HTTP and signaling → Chat client: pushes updates
- HTTP and signaling → Chat history: reads and writes
- HTTP and signaling → Friend and message data: persists relationships
- Participant → Admin console: administers
- Admin console → HTTP and signaling: requests admin actions
- Admin login → HTTP and signaling: authenticates
- Participant → WebView app: uses app
- WebView app → Chat interface: loads web app
- WebView app → Server settings: reads settings
- App settings → Server settings: saves settings
- WebView app → Native screen capture: starts capture
- Native screen capture → HTTP and signaling: forwards screen frames
- HTTP and signaling → Chat notifications: pushes call and chat events
- Chat notifications → Android system: shows notifications
- Native screen capture → Android system: captures display
- App settings → HTTP and signaling: checks updates