{"id":26725433,"url":"https://github.com/sivert-io/websocket-voice","last_synced_at":"2025-11-03T13:02:25.769Z","repository":{"id":247683719,"uuid":"826557831","full_name":"sivert-io/WebSocket-Voice","owner":"sivert-io","description":"Voice communication through WebRTC and WebSockets","archived":false,"fork":false,"pushed_at":"2024-11-24T02:09:29.000Z","size":2740,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-19T19:46:43.836Z","etag":null,"topics":["pion","socket-io","webrtc"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sivert-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-10T00:12:05.000Z","updated_at":"2024-11-24T02:09:33.000Z","dependencies_parsed_at":"2024-11-11T22:44:12.785Z","dependency_job_id":null,"html_url":"https://github.com/sivert-io/WebSocket-Voice","commit_stats":null,"previous_names":["sivertgullberghansen/websocket-voice","sivert-io/websocket-voice"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sivert-io%2FWebSocket-Voice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sivert-io%2FWebSocket-Voice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sivert-io%2FWebSocket-Voice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sivert-io%2FWebSocket-Voice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sivert-io","download_url":"https://codeload.github.com/sivert-io/WebSocket-Voice/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245924501,"owners_count":20694731,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["pion","socket-io","webrtc"],"created_at":"2025-03-27T21:18:49.112Z","updated_at":"2025-11-03T13:02:25.762Z","avatar_url":"https://github.com/sivert-io.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🌩️ Gryt - Modern WebRTC Voice Chat Platform\n\n\u003e [!CAUTION]\n\u003e **Early Development Stage - Experimental Project**\n\u003e \n\u003e This project is currently in its **early experimental stages** and is being developed in real-time. The codebase is **not stable** and will change frequently. Do not expect a fully usable product at this time. This is primarily a **proof of concept** for WebRTC voice communication technology.\n\u003e \n\u003e **Use at your own risk** - features may break, APIs may change, and the project structure is subject to major modifications without notice.\n\nWelcome to **Gryt**, a cutting-edge WebRTC-based voice chat platform featuring real-time communication, advanced audio processing, and a beautiful modern interface. Built with TypeScript, React, and Go, Gryt provides a Discord-like experience with enterprise-grade voice quality and reliability.\n\n\u003cdiv align=\"center\"\u003e\n\n![Preview](/.github/preview_client.png)\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![TypeScript](https://img.shields.io/badge/TypeScript-007ACC?logo=typescript\u0026logoColor=white)](https://www.typescriptlang.org/)\n[![React](https://img.shields.io/badge/React-20232A?logo=react\u0026logoColor=61DAFB)](https://reactjs.org/)\n[![Go](https://img.shields.io/badge/Go-00ADD8?logo=go\u0026logoColor=white)](https://golang.org/)\n\n\u003c/div\u003e\n\n## 🚀 **[Quick Start - Get Running in 30 Seconds!](QUICK-START.md)**\n\n**Want to try Gryt right now?** Check out our **[QUICK-START.md](QUICK-START.md)** guide for true one-liner setup:\n\n```bash\n# Docker (easiest)\ngit clone https://github.com/sivert-io/WebSocket-Voice.git \u0026\u0026 cd webrtc \u0026\u0026 docker-compose up -d\n\n# Kubernetes  \ngit clone https://github.com/sivert-io/WebSocket-Voice.git \u0026\u0026 cd webrtc \u0026\u0026 helm install gryt ./helm/gryt\n```\n\n**That's it!** 🎉\n\n---\n\n## ✨ Features\n\n### 🎙️ **Advanced Voice Communication**\n- **High-Quality Audio**: Crystal-clear voice with noise suppression and echo cancellation\n- **Real-time Voice Activity Detection**: Visual indicators showing who's speaking\n- **Smart Noise Gate**: Automatic background noise filtering with customizable thresholds\n- **Volume Controls**: Independent microphone and output volume with 2x boost capability\n- **Mute \u0026 Deafen**: Full voice controls with server synchronization\n\n### 🎛️ **Professional Audio Processing**\n- **Enhanced Audio Pipeline**: Multi-stage processing (noise gate → volume → mute → output)\n- **Real-time Audio Visualization**: Frequency spectrum and level meters\n- **Loopback Monitoring**: Hear yourself to test audio setup\n- **Device Management**: Hot-swappable microphone and speaker selection\n- **Audio Quality Optimization**: Automatic gain control and dynamic range compression\n- **Smart Rate Limiting**: Score-based rate limiting with user-friendly error messages\n\n### 🌐 **Multi-Server Architecture**\n- **Server Discovery**: Automatic server detection and connection\n- **Seamless Server Switching**: Switch between voice servers without disconnection\n- **Room Isolation**: Unique room IDs prevent cross-server interference\n- **Connection State Management**: Robust handling of network changes and reconnections\n- **Auto-Focus**: Automatically focuses the first available server on startup\n- **Server Management**: Add, remove, and switch between multiple servers with ease\n\n### 🎨 **Modern User Interface**\n- **Beautiful Design**: Clean, modern interface built with Radix UI\n- **Responsive Layout**: Works perfectly on desktop and mobile\n- **Real-time Animations**: Smooth transitions and visual feedback\n- **Dark/Light Themes**: Adaptive theming with system preference detection\n- **Accessibility**: Full keyboard navigation and screen reader support\n\n### 🔧 **Developer Experience**\n- **TypeScript**: Full type safety across the entire stack\n- **Modular Architecture**: Clean separation of concerns with package-based structure\n- **Hot Reload**: Instant development feedback with Vite and Bun\n- **Comprehensive Logging**: Detailed debugging and monitoring capabilities\n\n## 🏗️ Architecture\n\nGryt consists of three main components working together, with authentication provided as a centrally hosted service:\n\n```\n┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐\n│   Web Client    │    │  Gryt Servers   │    │   SFU Server    │\n│   (React/TS)    │◄──►│   (Node.js)     │◄──►│     (Go)        │\n│                 │    │                 │    │                 │\n│ • Voice UI      │    │ • Signaling     │    │ • Media Relay   │\n│ • Audio Proc.   │    │ • User Mgmt     │    │ • WebRTC        │\n│ • Server Mgmt   │    │ • Room Mgmt     │    │ • Track Mgmt    │\n└─────────────────┘    └─────────────────┘    └─────────────────┘\n                                │\n                       ┌─────────────────┐\n                       │  Auth Service   │\n                       │ (Hosted by Gryt)│\n                       │                 │\n                       │ • Authentication│\n                       │ • User Sessions │\n                       │ • Security      │\n                       └─────────────────┘\n```\n\n### Component Overview\n\n| Component | Technology | Purpose | Setup Required |\n|-----------|------------|---------|----------------|\n| **[Web Client](client/)** | React + TypeScript | User interface and audio processing | ✅ Self-hosted |\n| **[Gryt Server](server/)** | Node.js + TypeScript | Signaling and room management | ✅ Self-hosted |\n| **[SFU Server](sfu-v2/)** | Go + Pion WebRTC | Media forwarding and WebRTC | ✅ Self-hosted |\n| **Auth Service** | Hosted by Gryt Team | Authentication and security | 🌐 Centrally hosted |\n\n\u003e **Note**: Authentication is provided as a centrally hosted service by the Gryt team. You don't need to set up your own authentication server - just configure your servers to use the official Gryt Auth API.\n\n## 🚀 Quick Start\n\n### Prerequisites\n- **Node.js** 18+ and **Bun** (for client/server)\n- **Go** 1.21+ (for SFU)\n- **STUN/TURN Server** (for production)\n\n### Development Setup\n\n1. **Clone the repository**\n   ```bash\n   git clone https://github.com/sivert-io/WebSocket-Voice.git\n   cd gryt\n   ```\n\n2. **Start all services** (uses tmux for multi-service development)\n   ```bash\n   chmod +x start.sh\n   ./start.sh\n   ```\n\n   This starts:\n   - SFU Server (Go) on port 5005\n   - Web Client (React) on port 5173\n   - Gryt Server 1 \"Gryta Krutt\" on port 5000\n   - Gryt Server 2 \"Techial\" on port 5001\n\n3. **Access the application**\n   - Open http://localhost:5173 in your browser\n   - Create an account or use community access (via centrally hosted auth)\n   - Join a voice channel and start chatting!\n\n### Manual Setup\n\nIf you prefer to start services individually:\n\n```bash\n# Terminal 1: SFU Server\ncd webrtc/sfu-v2\n./start.sh\n\n# Terminal 2: Web Client\ncd webrtc/client\nbun install \u0026\u0026 bun dev\n\n# Terminal 3: Gryt Server\ncd webrtc/server\nbun install \u0026\u0026 bun dev\n```\n\n## 🛠️ Production Deployment\n\n### Requirements\n- **Domain with SSL/TLS**: Required for WebRTC in production\n- **STUN/TURN Server**: We recommend [coturn](https://github.com/coturn/coturn)\n- **Load Balancer**: For multiple Gryt server instances\n\n### Environment Configuration\n\nEach component includes an `example.env` file that you can copy and customize:\n\n**SFU Server** (copy `env.example` to `.env`):\n```env\nPORT=5005\nSTUN_SERVERS=stun:stun.l.google.com:19302,stun:stun1.l.google.com:19302\n```\n\n**Gryt Server** (copy `example.env` to `.env`):\n```env\n# Port clients connect to\nPORT=5000\n\n# Your secure SFU host\nSFU_WS_HOST=\"wss://sfu_host.com\"\n\n# Comma separated list of URLs\nSTUN_SERVERS=\"stun:stun.l.google.com:19302\"\n\n# Name of the server\nSERVER_NAME=\"My Brand New Server\"\n\n# Icon of the server (filename in the public folder)\nSERVER_ICON=\"example.png\"\n\n# Websocket allowed origins\nCORS_ORIGIN=\"https://gryt.chat\"\n\n# Server password for client authentication (optional - leave empty for open server)\n# SERVER_PASSWORD=\"your-secure-server-password\"\n\n# ScyllaDB / Cassandra settings\nSCYLLA_CONTACT_POINTS=your-scylla-host.com\nSCYLLA_LOCAL_DATACENTER=datacenter1\nSCYLLA_KEYSPACE=your_keyspace_name\nSCYLLA_USERNAME=your_scylla_username\nSCYLLA_PASSWORD=your_scylla_password\n\n# S3 / Object storage (AWS S3, Cloudflare R2, Wasabi, MinIO)\nS3_REGION=auto\nS3_ENDPOINT=https://your-s3-endpoint.com\nS3_ACCESS_KEY_ID=your_s3_access_key\nS3_SECRET_ACCESS_KEY=your_s3_secret_key\nS3_BUCKET=your-bucket-name\nS3_FORCE_PATH_STYLE=true\n\n# Additional channels configuration\nADDITIONAL_CHANNELS=[{\"name\":\"Announcements\",\"type\":\"text\",\"id\":\"announcements\",\"description\":\"Server announcements and important updates\"}]\n```\n\n**Web Client**:\nThe web client does not require environment variables for basic operation. Users add servers manually through the application interface.\n\n\u003e **Quick Setup**: Copy the example files:\n\u003e ```bash\n\u003e # Server\n\u003e cd webrtc/server\n\u003e cp example.env .env\n\u003e \n\u003e # Client  \n\u003e cd webrtc/client\n\u003e cp example.env .env\n\u003e ```\n\n### Authentication Configuration\n\nAuthentication is provided by the centrally hosted Gryt Auth service. No additional configuration is required as the auth endpoint is automatically configured to use the official Gryt Auth API at `https://auth.gryt.chat`.\n\n## 🎯 Key Features Deep Dive\n\n### Voice Controls\n- **Mute**: Prevents your microphone from transmitting (visual feedback to others)\n- **Deafen**: Mutes all incoming audio (local only, others still see you as connected)\n- **Push-to-Talk**: Coming soon\n- **Voice Activation**: Automatic transmission based on voice activity\n\n### Audio Processing Pipeline\n```\nMicrophone → Noise Gate → Volume Control → Mute → SFU → Other Users\n                ↓\n            Visual Feedback (accurate representation of transmitted audio)\n```\n\n### Server Management\n- **Multi-server Support**: Connect to multiple Gryt servers simultaneously\n- **Seamless Switching**: Change servers without losing voice connection\n- **Room Isolation**: Unique room IDs prevent conflicts between servers\n- **Connection Recovery**: Automatic reconnection with state preservation\n\n### Rate Limiting \u0026 Security\n- **Score-Based Rate Limiting**: Intelligent rate limiting that adapts to user behavior\n- **User-Friendly Messages**: Clear feedback when rate limited with wait times\n- **Action-Specific Limits**: Different limits for chat, reactions, server joins, etc.\n- **Automatic Decay**: Rate limits automatically decrease over time\n- **Abuse Prevention**: Protects against spam and malicious activity\n\n## 🤝 Contributing\n\nWe welcome contributions! Here's how to get started:\n\n1. **Fork the repository**\n2. **Create a feature branch**: `git checkout -b feature/amazing-feature`\n3. **Make your changes** with proper TypeScript types\n4. **Add tests** for new functionality\n5. **Commit your changes**: `git commit -m 'Add amazing feature'`\n6. **Push to the branch**: `git push origin feature/amazing-feature`\n7. **Open a Pull Request**\n\n### Development Guidelines\n- Follow TypeScript best practices\n- Use proper error handling and logging\n- Write comprehensive tests\n- Update documentation for new features\n- Ensure accessibility compliance\n\n## 📚 Documentation\n\n- **[Client Documentation](client/README.md)** - React app, audio processing, UI components\n- **[Server Documentation](server/README.md)** - Signaling server, room management\n- **[SFU Documentation](sfu-v2/README.md)** - Media forwarding, WebRTC implementation\n- **[Rate Limiting Guide](RATE_LIMITING.md)** - Score-based rate limiting system\n\n## 🐛 Troubleshooting\n\n### Common Issues\n\n**Audio not working?**\n- Check microphone permissions in browser\n- Verify STUN/TURN server configuration\n- Ensure HTTPS/WSS in production\n\n**Connection issues?**\n- Check firewall settings for WebRTC ports\n- Verify server URLs and SSL certificates\n- Check browser console for detailed errors\n\n**Performance issues?**\n- Monitor CPU usage during audio processing\n- Check network bandwidth and latency\n- Verify browser WebRTC support\n\n## 📄 License\n\nThis project is licensed under the [MIT License](LICENSE) - see the LICENSE file for details.\n\n## ✍️ Authors\n\n\u003cdiv align=\"center\"\u003e\n  \n| \u003cimg src='https://avatars.githubusercontent.com/u/6785315?s=64\u0026v=4'\u003e  | \u003cimg src='https://avatars.githubusercontent.com/u/74724224?s=64\u0026v=4'\u003e  |\n| ------------- | ------------- |\n| [Sivert Gullberg Hansen](https://github.com/sivert-io)  | [Ola Hulleberg](https://github.com/OlaHulleberg)  |\n| Lead Developer \u0026 Architecture | Authentication \u0026 Backend |\n\n\u003c/div\u003e\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\n**Built with ❤️ for the future of voice communication**\n\n[Report Bug](https://github.com/sivert-io/WebSocket-Voice/issues) • [Request Feature](https://github.com/sivert-io/WebSocket-Voice/issues) • [Documentation](https://docs.gryt.chat)\n\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsivert-io%2Fwebsocket-voice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsivert-io%2Fwebsocket-voice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsivert-io%2Fwebsocket-voice/lists"}