How mathias143000/sharechat-realtime-lab works
ShareChat is a production-like lab for a realtime, stateful chat and file-sharing service. A browser user reaches the app through an Nginx WebSocket edge; the client coordinates chat selection, message rendering, mentions, theme, and uploads through HTTP and Socket.IO. App replicas share state and fan-out through Redis and store uploads in MinIO. Prometheus scrapes runtime metrics for the Grafana dashboard surface, with Alertmanager documented as part of operations. Source excerpts show client-module calls and server metrics/storage use; deployment links are documented in the README, while exact configuration wiring was not sampled.
Main entry points: main.ts Client entrypoint · index.ts App replicas · prometheus.yml Prometheus · default.conf Nginx edge
Components 19
Browser client
- Client entrypoint
src/client/main.ts - HTTP API client
src/client/api.ts - Realtime socket client
src/client/socket.ts - Chat selection
src/client/chats.ts - Message rendering
src/client/chat-view.ts - Mention controller
src/client/mentions.ts - Upload interface
src/client/uploads.ts - Theme controls
src/client/theme.ts
App runtime
- App replicas
src/server/index.ts - HTTP and chat service
src/server/index.ts
Shared state and files
- Storage adapters
src/server/storage.ts - Redis shared state
- MinIO object storage
Traffic edge
- Nginx edge
nginx/default.conf
Observability
- Runtime metrics
src/server/metrics.ts - Prometheus
prometheus/prometheus.yml - Grafana dashboards
grafana/dashboards/sharechat-overview.json - Alertmanager
alertmanager.yml
Other components
- Browser user
Connections 17
- Browser user → Client entrypoint: uses
README.md - Client entrypoint → HTTP API client: calls
src/client/main.ts - Client entrypoint → Realtime socket client: connects
src/client/main.ts - Client entrypoint → Chat selection: manages
src/client/main.ts - Client entrypoint → Message rendering: renders
src/client/main.ts - Client entrypoint → Mention controller: coordinates
src/client/main.ts - Client entrypoint → Upload interface: initializes
src/client/main.ts - Client entrypoint → Theme controls: initializes
src/client/main.ts - Client entrypoint → Nginx edge: sends app traffic
README.md - Nginx edge → App replicas: routes traffic
README.md - App replicas → Redis shared state: shares state and fan-out
README.md - App replicas → MinIO object storage: stores uploads
README.md - HTTP and chat service → Storage adapters: uses
src/server/index.ts - HTTP and chat service → Runtime metrics: records and renders
src/server/index.ts - Prometheus → App replicas: scrapes metrics
README.md - Grafana dashboards → Prometheus: visualizes metrics
README.md - Prometheus → Alertmanager: sends alerts