Watch
1
Fork
You've already forked AfogadosStudio
0
0

Latest commit

maotovisk
c41f8ea 2026-09-01 18:38:18 -03:00 3 commits
2026-09-01 18:38:18 -03:00
2026-09-01 18:38:18 -03:00
2026-09-01 18:38:18 -03:00

AfogadosStudio

AfogadosStudio is a cross-platform desktop application for watching and publishing streams on the Afogados platform.

It is built with .NET, Avalonia, and MVVM. Local broadcasting will be provided through ObsKit.NET, while playback and publishing use the Afogados WHEP and WHIP APIs.

AfogadosStudio is currently under active development. The application shell and public stream catalog are functional; authentication, playback, chat, ObsKit capture, and publishing are not complete yet.

Product direction

AfogadosStudio is intended to feel like a community streaming application rather than a traditional broadcasting control panel.

The v1 experience is deliberately focused:

LOGIN
  ↓
BROWSE STREAMS ─────► WATCH + CHAT
  │
  │ GO LIVE
  ▼
YOUR STREAM
  ├── Preview
  ├── Scenes and sources
  ├── Audio
  ├── Chat
  └── WHIP publishing

Advanced broadcast analytics, plugins, recording management, custom RTMP output, and complex dock layouts are outside the v1 scope.

Current functionality

  • Persistent Avalonia shell with Streams, Your Stream, and Settings pages.
  • Swiss-inspired dark desktop interface.
  • Explicit publishing and playback state models.
  • Compile-time API, OAuth, and Reverb configuration.
  • Typed integration with GET /api/v1/streams.
  • Stream-catalog loading, failure handling, and manual retry.
  • Initial boundaries for the API, credential store, WHEP playback, and ObsKit studio engine.
  • OAuth PKCE/token-refresh foundation with OS-backed credentials and real profile status.
  • Windows and Linux architecture planned from the start.

See the completion plan for the remaining work and acceptance criteria.

Technology

  • .NET 10
  • Avalonia 12
  • CommunityToolkit.Mvvm
  • ObsKit.NET — planned media engine integration
  • WebRTC through WHEP and WHIP
  • Native HttpClient and WebSocket clients
  • Reverb using the Pusher protocol

Supported platforms

The v1 target platforms are:

  • Windows x64
  • Linux x64

Planned media support:

Platform NVIDIA AMD Software fallback Desktop audio
Windows NVENC AMF x264 OBS Windows audio capture
Linux NVENC VAAPI x264 PipeWire OBS plugin

Planned distribution formats:

  • Windows installable executable through Velopack (vpk).
  • Linux AppImage.

Requirements

  • .NET 10 SDK
  • Windows or Linux desktop environment supported by Avalonia
  • Access to an Afogados backend deployment for live API functionality

ObsKit and its native OBS components are not integrated yet. Additional platform dependencies will be documented when that milestone lands.

Build-time configuration

The client is a public OAuth application. Configuration is supplied through MSBuild properties at compile time:

Property Description
AfogadosApiBaseUrl Absolute Afogados API/application base URL
AfogadosOAuthClientId Public OAuth client identifier
AfogadosReverbAppKey Public Reverb application key
AfogadosReverbHost Reverb WebSocket host
AfogadosReverbPort Reverb WebSocket port; defaults to 443
AfogadosReverbTls Whether Reverb uses TLS; defaults to true

Example:

dotnet build AfogadosStudio/AfogadosStudio.csproj `
  -p:AfogadosApiBaseUrl=https://afogados.example/ `
  -p:AfogadosOAuthClientId=desktop-client-id `
  -p:AfogadosReverbAppKey=public-reverb-key `
  -p:AfogadosReverbHost=reverb.afogados.example `
  -p:AfogadosReverbPort=443 `
  -p:AfogadosReverbTls=true

For local development, these properties can be placed in an ignored Directory.Build.props.user file and imported from a local Directory.Build.props setup. Never commit production configuration or credentials.

The OAuth redirect URI is fixed to:

afogados-stream-studio://oauth/callback

Initial scopes:

profile:read
stream:manage
stream:publish
chat:write

Build and run

Restore and build:

dotnet restore AfogadosStudio/AfogadosStudio.csproj
dotnet build AfogadosStudio/AfogadosStudio.csproj

Run:

dotnet run --project AfogadosStudio/AfogadosStudio.csproj

On Bash-compatible shells, use the same commands with / paths and supply MSBuild properties on one line or with shell continuation characters.

If build-time configuration is absent, the application remains open and presents a recoverable catalog configuration error instead of crashing.

Project structure

AfogadosStudio/
├── Configuration/    Compile-time application configuration
├── Models/           API and application-state models
├── Services/         API, authentication, media, and OS boundaries
├── ViewModels/       UI state and commands
├── Views/            Avalonia views
├── Styles/           Shared design tokens and control styles
├── Assets/           Packaged application assets
└── App.axaml         Application composition and resources

The intended dependency direction is intentionally small:

View
  ↓
ViewModel
  ↓
Service
  ↓
Afogados API / Reverb / ObsKit / operating system

ViewModels must not manipulate ObsKit objects directly. Capture, scenes, sources, preview, audio, encoding, and publishing media remain behind IStudioEngine.

Backend responsibilities

AfogadosStudio does not duplicate backend policy. The backend remains authoritative for:

  • Authentication and OAuth scopes.
  • User permissions and publisher ownership.
  • Stream visibility.
  • Viewer sessions.
  • Chat persistence.
  • Realtime channel authorization.

If the stream catalog returns a stream, the desktop client may display it. The client must not attempt to independently calculate visibility.

Security

  • OAuth uses Authorization Code with S256 PKCE and no client secret.
  • Access and refresh tokens will be stored only in the operating-system credential store.
  • Tokens must never be written to the JSON settings file.
  • Publishing uses authenticated WHIP and never requests an OBS publish token.
  • WHEP playback tokens and Reverb tickets exist in memory only.
  • Logs must redact OAuth codes, tokens, PKCE verifiers, playback tokens, realtime tickets, media keys, and Authorization headers.

Compile-time values must only contain public client configuration. Do not embed OAuth client secrets, Reverb secrets, media keys, or publishing credentials.

API overview

The v1 client integrates with these endpoint groups:

GET    /api/v1/streams
GET    /api/v1/streams/{slug}
GET    /api/v1/streams/{slug}/state

GET    /api/v1/streams/{slug}/chat
POST   /api/v1/streams/{slug}/chat

POST   /api/v1/streams/{slug}/whep
PATCH  /api/v1/whep/{session}
POST   /api/v1/whep/{session}/heartbeat
DELETE /api/v1/whep/{session}

GET    /api/v1/me
GET    /api/v1/me/stream
PATCH  /api/v1/me/stream

POST   /api/v1/me/stream/whip
PATCH  /api/v1/me/stream/whip/{session}
DELETE /api/v1/me/stream/whip/{session}

Development principles

  • Keep v1 straightforward; add abstractions only when a real boundary requires one.
  • Use explicit publishing and viewer states rather than collections of booleans.
  • Keep startup fast and initialize feature-specific systems lazily.
  • Always attempt remote media-session cleanup, but never skip local cleanup when the network fails.
  • Never replace an active publisher without explicit user confirmation.
  • Prefer user-facing recovery guidance over exposing HTTP, WebRTC, or source-code details.
  • Preserve the square, restrained visual system established by the supplied design references.

Roadmap

The planned delivery order is:

  1. OAuth PKCE, credential storage, token refresh, and real profile state.
  2. Complete typed API client, local settings persistence, and logging.
  3. Stream viewer and WHEP lifecycle.
  4. Chat, optimistic reconciliation, and Reverb reconnect behavior.
  5. ObsKit initialization, capture, preview, scenes, sources, audio, and encoder detection.
  6. Managed stream metadata and WHIP publishing.
  7. Cross-platform testing, Velopack packaging, and AppImage packaging.

Detailed tasks and acceptance criteria are maintained in docs/COMPLETION_PLAN.md.

License

No license has been declared yet. Until a license file is added, all rights are reserved by the project owner.