{"id":49753190,"url":"https://github.com/brints/spoken-api","last_synced_at":"2026-06-08T00:01:48.071Z","repository":{"id":344396655,"uuid":"1004347838","full_name":"Brints/spoken-api","owner":"Brints","description":"Spoken is a real-time voice translation video conferencing platform that eliminates language barriers in global professional collaborations by providing instantaneous, natural-sounding voice translation, allowing participants to communicate naturally in their native tongues.","archived":false,"fork":false,"pushed_at":"2026-05-31T21:14:09.000Z","size":2782,"stargazers_count":0,"open_issues_count":6,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-31T23:12:03.806Z","etag":null,"topics":["digitalocean","fastapi","github-actions","postgresql","python3","unit-testing","uvicorn","webrtc","websocket"],"latest_commit_sha":null,"homepage":"https://spoken-api.unraveldocs.xyz/docs","language":"Python","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/Brints.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-06-18T13:39:48.000Z","updated_at":"2026-05-31T21:14:12.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Brints/spoken-api","commit_stats":null,"previous_names":["brints/fluentmeet","brints/spoken-api"],"tags_count":49,"template":false,"template_full_name":null,"purl":"pkg:github/Brints/spoken-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Brints%2Fspoken-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Brints%2Fspoken-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Brints%2Fspoken-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Brints%2Fspoken-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Brints","download_url":"https://codeload.github.com/Brints/spoken-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Brints%2Fspoken-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34042554,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-07T02:00:07.652Z","response_time":124,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["digitalocean","fastapi","github-actions","postgresql","python3","unit-testing","uvicorn","webrtc","websocket"],"created_at":"2026-05-10T14:55:56.946Z","updated_at":"2026-06-08T00:01:48.062Z","avatar_url":"https://github.com/Brints.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spoken.ai 🎙️🌐\n\n**\"Speak your language, they hear theirs.\"**\n\nSpoken.ai is a real-time voice translation video conferencing platform. It eliminates language barriers in global professional collaborations by providing instantaneous, natural-sounding voice translation, allowing participants to communicate naturally in their native tongues.\n\n---\n\n## 🚀 Key Features\n\n- **Near-Instantaneous Translation**: Targeted glass-to-glass latency of under 1.5 seconds.\n- **Natural Voice Synthesis**: High-quality TTS that preserves the natural flow of conversation.\n- **Zero-Friction Client**: Participants join via a secure link with no mandatory account creation for guests.\n- **Intelligent Audio Routing**: An \"SFU-Lite\" logic for routing raw or translated audio based on individual language preferences.\n- **Dual-Language Captions**: Real-time transcripts showing both original and translated text concurrently.\n- **Professional Vocabulary**: Optimised for business, technical, and domain-specific context.\n\n---\n\n## 🛠️ Technical Stack\n\n### **Backend (Python Implementation)**\n- **Framework**: [FastAPI](https://fastapi.tiangolo.com/) (Asynchronous, high-concurrency architecture).\n- **Data Persistence**: [PostgreSQL](https://www.postgresql.org/) with [SQLAlchemy 2.0](https://www.sqlalchemy.org/) (Async).\n- **Migration Management**: [Alembic](https://alembic.sqlalchemy.org/) (Configured for asynchronous migrations).\n- **Event Streaming**: [Apache Kafka](https://kafka.apache.org/) (Decoupled, event-driven audio processing pipeline).\n- **Real-time Communication**: [WebSockets](https://fastapi.tiangolo.com/advanced/websockets/) for media signaling and caption streaming.\n- **In-Memory Store**: [Redis](https://redis.io/) for live room state, participant sessions, and rate-limiting.\n\n### **AI Infrastructure**\n- **STT (Speech-to-Text)**: [Deepgram](https://www.deepgram.com/) / [OpenAI Whisper](https://openai.com/research/whisper) (High-accuracy streaming).\n- **Machine Translation**: [DeepL API](https://www.deepl.com/pro-api) / [GPT-4o](https://openai.com/) (Context-aware translation).\n- **TTS (Text-to-Speech)**: [Voice.ai](https://voice.ai/) (Natural audio synthesis).\n\n---\n\n## 📂 System Architecture\n\nSpoken.ai utilizes an event-driven pipeline to ensure minimal latency and high scalability:\n\n1.  **Ingest**: Speaker's audio is captured via WebRTC and streamed over WebSockets to the Backend.\n2.  **STT**: Raw audio chunks are pushed to Kafka (`audio.raw`), consumed by STT workers, and converted to text.\n3.  **Translation**: Original text is pushed to Kafka (`text.original`), consumed by Translation workers, and converted to the target language.\n4.  **TTS**: Translated text is pushed to Kafka (`text.translated`), consumed by TTS workers, and synthesized into target audio.\n5.  **Egress**: Synthesized audio is pushed back to Kafka (`audio.synthesized`) and routed via WebSockets to listeners who require that language.\n\n```mermaid\ngraph TD\n    UserA[Speaker] --\u003e|WebRTC/WS| Backend[Signaling \u0026 Routing Server]\n    Backend --\u003e|Raw Audio| K1((Kafka: audio.raw))\n    K1 --\u003e STT[STT Worker]\n    STT --\u003e|Original Text| K2((Kafka: text.original))\n    K2 --\u003e TL[Translation Worker]\n    TL --\u003e|Translated Text| K3((Kafka: text.translated))\n    K3 --\u003e TTS[TTS Worker]\n    TTS --\u003e|Synthesized Audio| K4((Kafka: audio.synthesized))\n    K4 --\u003e Backend\n    Backend --\u003e|Translated Audio| UserB[Listener]\n```\n\n---\n\n## 🏁 Installation \u0026 Setup\n\n### **1. Prerequisites**\n- Python 3.11+\n- [Docker](https://www.docker.com/) and [Docker Compose](https://docs.docker.com/compose/)\n- Access to Deepgram, DeepL, and Voice.ai APIs (API Keys needed).\n\n### **2. Cloning the Repository**\n```bash\ngit clone \u003crepository-url\u003e\ncd spoken-api\n```\n\n### **3. Environment Configuration**\nCopy the example environment file and fill in your credentials:\n```bash\ncp .env.example .env\n```\nGenerate a secure `SECRET_KEY` for JWT:\n```bash\npython -c \"import secrets; print(secrets.token_hex(32))\"\n```\n\n### 4. Local Development Setup\nIt is highly recommended to use the `uv` tool for fast virtual environment and dependency management:\n```bash\nuv sync\n```\n\n### **5. Infrastructure Setup (Docker)**\nStart the required infrastructure (PostgreSQL, Redis, Kafka, Zookeeper):\n```bash\ndocker-compose up -d\n```\n\n### **6. Database Migrations**\nInitialize the database schema using Alembic:\n```bash\nalembic upgrade headalembic upgrade head\n```\n\n---\n\n## 🚀 Running the Application\n\n### **Start the Backend**\n```bash\nuv run uvicorn app.main:app --reload\nuv run uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload\n```\nThe API will be available at `http://localhost:8000`. You can access the interactive API documentation (Swagger UI) at `http://localhost:8000/docs`.\n\n---\n## Database Models Setup with SQLAlchemy 2.0 (Async)\n### **Defining Models**\n```bash\nCreate your SQLAlchemy models in `app/models.py` using the async syntax.\n```\n### **Registering Models with Alembic**\n```bash\nEnsure your models are imported in `app/models/init.py` for Alembic to detect them during migrations.\n```\n\n### **Creating Migrations**\n```bash\nuv run alembic revision --autogenerate -m \"Add avatar url to users\"\n```\n### **Migrate Head**\n```bash\nuv run alembic upgrade head\n```\n\n### **Applying Migrations**\n```bash\nuv run alembic upgrade head\n```\n\n---\n\n## 🧪 Testing \u0026 Quality Assurance\n\n### **Running Tests**\n```bash\nuv run pytest\n```\n\n### **Test Coverage**\nGenerate and view a coverage report:\n```bash\nuv run pytest tests/ -v --cov=app --cov-report=html --cov-report=term\n# Open htmlcov/index.html in your browser\n```\n\n---\n\n## 🛡️ Security \u0026 Compliance\n\n- **Authentication**: JWT-based authentication with `HttpOnly`, `Secure`, `SameSite=Strict` cookies for Refresh Tokens.\n- **Data Privacy**: Ephemeral audio/text processing; no data is persisted after the meeting ends.\n- **Rate Limiting**: Redis-backed throttling to manage API costs and prevent abuse.\n- **Soft-Delete**: Strict account deletion policies preventing reactivation via login.\n\n---\n\n## Linting \u0026 Formatting\n- **Black**: Enforce consistent code formatting.\n```bash\nuv run black .\n```\n- **isort**: Sort imports for readability.\n```bash\nuv run isort .\n```\n- **ruff**: Linting for code quality and style.\n```bash\nuv run ruff check .\nuv run ruff format .\n```\n\n---\n\n## Logging Safety\n\nTo prevent log injection and control-character pollution from user-provided inputs,\nFluentMeet sanitizes dynamic log arguments with `app/core/sanitize.py`.\n\n- Use `sanitize_for_log(value)` for a single value.\n- Use `sanitize_log_args(*values)` when logging multiple placeholders.\n- Newline, carriage return, tab, and other control characters are escaped or replaced.\n- Long values are truncated with `...\u003ctruncated\u003e`.\n\n## 🤝 Contributing\n\nWe welcome contributions! Please follow these steps:\n1.  Fork the repository.\n2.  Create your feature branch (`git checkout -b feature/AmazingFeature`).\n3.  Ensure your code follows [Black](https://github.com/psf/black) and [isort](https://github.com/PyCQA/isort) formatting.\n4.  Commit your changes (`git commit -m 'Add some AmazingFeature'`).\n5.  Push to the branch (`git push origin feature/AmazingFeature`).\n6.  Open a Pull Request.\n\n---\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrints%2Fspoken-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrints%2Fspoken-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrints%2Fspoken-api/lists"}