How liyuanjie0808/home-chat_localareanetworkchat works
Home Chat is a self-hosted, LAN-only family messaging application: household members connect from a browser to a Mac-hosted service, authenticate, and exchange messages and media without cloud storage. The principal flow runs from the shared web client through its network layer to the server’s WebSocket hub, which authenticates devices, dispatches messaging operations, and persists chat state. The README also documents group chats, archive recovery, monitoring and device approval, local media relay, discovery, and mobile-specific security and notification features. Unsampled subsystem wiring is shown only where documented.
Main entry points: app.js Chat application · index.js Service entry · hub.js Message hub · net.js Client networking
Components 24
Web client
- Chat application
app/js/app.js - Chat interface
app/js/ui.js - Client networking
app/js/net.js - Client data
app/js/store.js - Media handling
app/js/media.js - Client encryption
app/js/hc1.js - Session restore
app/js/session.js - Device protection
app/js/secure.js - Notifications
app/js/notify.js - Archive recovery
app/js/archive.js
Chat service
- Service entry
server/src/index.js - Message hub
server/src/hub.js - HTTP and uploads
server/src/http.js - Media relay cache
server/src/filecache.js - LAN discovery
server/src/discovery.js - Server encryption
server/src/crypto.js
Local state
- Persistent chat data
server/src/store.js - Local configuration
server/src/config.js
Admin and device
- Monitoring panel
admin/HomeChat-监控.html - Password management
server/src/setpass.js - Network watchdog
server/src/net.js
Other components
- Household member
- Browser
- Administrator
Connections 28
- Household member → Browser: opens chat
- Browser → Chat application: uses
- Chat application → Chat interface: renders
- Chat application → Client networking: connects and syncs
- Chat application → Media handling: sends media
- Chat application → Client data: manages client data
- Client networking → Client encryption: seals messages
- Client networking → Service entry: WebSocket and HTTP
- Service entry → Message hub: dispatches connections
- Service entry → HTTP and uploads: serves HTTP
- Service entry → LAN discovery: starts UDP discovery
- Service entry → Network watchdog: starts watchdog
- Message hub → Persistent chat data: reads and writes chat state
- Message hub → Server encryption: seals and opens data
- Message hub → Media relay cache: relays media
- HTTP and uploads → Media relay cache: stores and retrieves uploads
- Service entry → Local configuration: loads settings
- Media handling → HTTP and uploads: uploads and downloads
- Client data → Session restore: persists session state
- Chat application → Archive recovery: recovers history
- Chat application → Device protection: applies device protection
- Chat application → Notifications: sets up alerts
- Administrator → Monitoring panel: opens monitoring
- Monitoring panel → Service entry: requests monitoring
- Service entry → Message hub: routes admin connection
- Message hub → Persistent chat data: reads monitoring statistics
- Administrator → Password management: changes passwords
- Password management → Persistent chat data: re-encrypts stored data