{"id":51594502,"url":"https://github.com/vitorhugo-dotnet/dotnet_sonicrelay","last_synced_at":"2026-07-11T17:03:00.895Z","repository":{"id":369141646,"uuid":"1288551935","full_name":"vitorhugo-dotnet/dotnet_SonicRelay","owner":"vitorhugo-dotnet","description":"Low-latency audio streaming from Windows PC to mobile using .NET, Flutter, WebRTC, Opus, Identity auth and isolated multi-user sessions.","archived":false,"fork":false,"pushed_at":"2026-07-06T13:01:19.000Z","size":183,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-07-06T18:20:36.211Z","etag":null,"topics":["aspnet-core","audio-streaming","coturn","docker","dotnet","flutter","identity","low-latency","mobile","opus","postgresql","redis","sonicrelay","webrtc","websocket","windows"],"latest_commit_sha":null,"homepage":"","language":"C#","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/vitorhugo-dotnet.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":"docs/security.md","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":"2026-07-03T18:05:03.000Z","updated_at":"2026-07-06T13:01:43.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/vitorhugo-dotnet/dotnet_SonicRelay","commit_stats":null,"previous_names":["vitorhugo-java/dotnet_sonicrelay","vitorhugo-dotnet/dotnet_sonicrelay"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/vitorhugo-dotnet/dotnet_SonicRelay","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitorhugo-dotnet%2Fdotnet_SonicRelay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitorhugo-dotnet%2Fdotnet_SonicRelay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitorhugo-dotnet%2Fdotnet_SonicRelay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitorhugo-dotnet%2Fdotnet_SonicRelay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vitorhugo-dotnet","download_url":"https://codeload.github.com/vitorhugo-dotnet/dotnet_SonicRelay/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitorhugo-dotnet%2Fdotnet_SonicRelay/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35368768,"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-07-11T02:00:05.354Z","response_time":104,"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":["aspnet-core","audio-streaming","coturn","docker","dotnet","flutter","identity","low-latency","mobile","opus","postgresql","redis","sonicrelay","webrtc","websocket","windows"],"created_at":"2026-07-11T17:03:00.078Z","updated_at":"2026-07-11T17:03:00.890Z","avatar_url":"https://github.com/vitorhugo-dotnet.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SonicRelay\n\nBackend/control plane for low-latency audio streaming between a Windows publisher and mobile viewers. The API uses ASP.NET Core Minimal API, PostgreSQL, Redis and authenticated WebSocket signaling; WebRTC/Opus media stays between clients, directly or through coturn.\n\n## Project suite\n\n| Project | Repository | Stack | Responsibility |\n| --- | --- | --- | --- |\n| Backend API | [dotnet_SonicRelay](https://github.com/vitorhugo-java/dotnet_SonicRelay) | .NET 10, ASP.NET Core, PostgreSQL, Redis | Authentication, devices, sessions, join codes and signaling. |\n| Mobile Viewer | [flutter_SonicRelay](https://github.com/vitorhugo-java/flutter_SonicRelay) | Flutter, `flutter_webrtc` | Join a session and play WebRTC audio. |\n| Windows Publisher | [windows_SonicRelay](https://github.com/vitorhugo-java/windows_SonicRelay) | C#/.NET Desktop, WASAPI, WebRTC | Capture system audio and publish it to viewers. |\n\nThis repository contains only the backend and its infrastructure.\n\n## Current status\n\n| Area | Status | Current implementation |\n| --- | --- | --- |\n| Identity/authentication | Implemented | ASP.NET Core Identity with PostgreSQL and opaque bearer/refresh tokens. |\n| Sessions | Implemented | Create, list, read, join, rotate code, end and background expiry/cleanup. |\n| WebSocket signaling | Implemented | Authenticated participant validation and in-process, participant-targeted routing. |\n| Devices | Implemented | Authenticated, owner-scoped create, list, read, update, delete and revocation endpoints. |\n| Account deletion | Implemented | Self-service (`DELETE /api/account`) and admin (`DELETE /api/admin/users/{id}`) soft delete with device/session revocation, audit log and n8n webhook. See [account deletion](docs/account-deletion.md). |\n| Observability | Implemented | Prometheus `/metrics`, client WebRTC stats ingestion (`POST /api/webrtc/stats`), structured signaling logs, Grafana dashboard and alerts. See [observability](docs/observability.md). |\n| PostgreSQL | Implemented | Identity, device, session, participant and signaling-event schema plus initial migration. |\n| Redis | Implemented | Expiring HMAC-derived session-code lookup. |\n| WebRTC media | Client responsibility | No media capture, transcoding or relay is implemented in this API. |\n| CI/CD | Implemented with scope noted | GitHub Actions builds/tests/publishes and deploys the API-only Compose stack over SSH. |\n\nSee the [client integration protocol](docs/protocol.md) for exact routes and WebRTC signaling flows, the [beginner guide](docs/beginner-guide.md) for a plain-language introduction, and [Security](docs/security.md) for implemented controls and known gaps.\n\n## Quick start\n\nRequirements: .NET 10 SDK, PostgreSQL and Redis.\n\n```bash\ndotnet restore SonicRelay.sln\ndotnet ef database update \\\n  --project src/SonicRelay.Infrastructure/SonicRelay.Infrastructure.csproj \\\n  --startup-project services/SonicRelay.Api/SonicRelay.Api.csproj\ndotnet run --project services/SonicRelay.Api/SonicRelay.Api.csproj\n```\n\nHealth endpoints:\n\n```bash\ncurl http://localhost:8080/health/live\ncurl http://localhost:8080/health/ready\n```\n\nDocker development stack:\n\nThe root `Dockerfile` is the canonical image definition. Run `docker build .` from the repository root; it publishes `services/SonicRelay.Api/SonicRelay.Api.csproj` using a multi-stage, non-root runtime image. Compose and CI/CD use the same Dockerfile and project path.\n\n```bash\ncp infra/.env.example infra/.env\ndocker compose \\\n  --env-file infra/.env \\\n  -f infra/compose.yml \\\n  -f infra/compose.dev.yml \\\n  --profile dev \\\n  up --build\n```\n\nRun the API integration/E2E tests:\n\n```bash\ndotnet test tests/SonicRelay.Api.IntegrationTests/SonicRelay.Api.IntegrationTests.csproj\n```\n\nValidate the real authentication, device, session, and WebSocket signaling flow without audio or WebRTC clients using the [fake signaling client](tools/SonicRelay.SignalingClient/README.md).\n\n## Documentation\n\n- [Architecture](docs/architecture.md)\n- [HTTP, WebSocket and WebRTC client integration protocol](docs/protocol.md)\n- [Guia para leigos: WebSocket, WebRTC, Signaling, Opus e arquitetura](docs/beginner-guide.md)\n- [Security](docs/security.md)\n- [VPS deployment over SSH](docs/deployment-vps-ssh.md)\n- [Architecture decision records](docs/adr/)\n\n## CI/CD summary\n\n`.github/workflows/vps-ci-cd.yml` runs build and tests on pull requests and pushes. Non-PR runs publish immutable `sha-\u003ccommit\u003e` images to GHCR; `main` also publishes `latest`. A push to `main`, or a manual run with deployment enabled, copies `deploy/docker-compose.prod.yml` and `deploy/deploy.sh` to the VPS and starts the API image over SSH.\n\nThe automated deployment Compose file contains only the API. PostgreSQL, Redis, coturn and reverse proxy must already be reachable/configured, or operators must deploy the separate full stack from `infra/`. Details and required secrets are in the [deployment guide](docs/deployment-vps-ssh.md).\n\n## License\n\nSee [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvitorhugo-dotnet%2Fdotnet_sonicrelay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvitorhugo-dotnet%2Fdotnet_sonicrelay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvitorhugo-dotnet%2Fdotnet_sonicrelay/lists"}