Files
deepdrft/DeepDrftPublic.Client/Startup.cs
T
daniel-c-harvey dbd90ee52a feat(phase-16): anonymous play & share telemetry substrate (wave 16.1)
Player-service play-session tracker (floor + 3-bucket classify), SharePopover share tracker with debounce, sendBeacon interop, proxied rate-limited POST api/event/{play,share}, append-only event logs + incremental play_counter with server-side release resolution. Migration authored, not applied. No anonId, no read surface.
2026-06-19 12:59:00 -04:00

63 lines
2.7 KiB
C#

using DeepDrftPublic.Client.Clients;
using DeepDrftPublic.Client.Common;
using DeepDrftPublic.Client.Services;
using DeepDrftPublic.Client.ViewModels;
using Microsoft.AspNetCore.Http;
namespace DeepDrftPublic.Client;
public static class Startup
{
public static void ConfigureDomainServices(IServiceCollection services)
{
// Theme Support
services.AddScoped<DarkModeSettings>();
services.AddScoped<DarkModeCookieService>();
// Track Client. The HTTP-backed ITrackDataService is used by both WASM and SSR
// prerender — both call DeepDrftAPI over the "DeepDrft.API" client.
services.AddScoped<TrackClient>();
services.AddScoped<ITrackDataService, TrackClientDataService>();
// Release read surface (Phase 9). Same HTTP posture as the track client — both
// WASM and SSR prerender call DeepDrftAPI over the "DeepDrft.API" client.
services.AddScoped<ReleaseClient>();
services.AddScoped<IReleaseDataService, ReleaseClientDataService>();
services.AddScoped<ReleaseDetailViewModel>();
services.AddScoped<CutDetailViewModel>();
// Home hero stats read surface — same HTTP posture as the track/release clients.
services.AddScoped<StatsClient>();
services.AddScoped<IStatsDataService, StatsClientDataService>();
// Waveform visualizer controls — scoped so the eight slider positions persist across navigation
// within a session and reset on a fresh page load (see WaveformVisualizerControlState).
services.AddScoped<WaveformVisualizerControlState>();
// Phase 16 anonymous telemetry (client side). BeaconInterop wraps sendBeacon; the play sink and
// share tracker fire events through it. The play tracker itself is NOT registered — the player
// is not DI-registered, so AudioPlayerProvider constructs the tracker and attaches it. ShareTracker
// is scoped so its per-(target,channel) debounce memory lives for the session.
services.AddScoped<BeaconInterop>();
services.AddScoped<IPlayEventSink, BeaconPlayEventSink>();
services.AddScoped<ShareTracker>();
}
public static void ConfigureApiHttpClient(IServiceCollection services, string baseAddress)
{
services.AddHttpClient("DeepDrft.API", client =>
{
client.BaseAddress = new Uri(baseAddress);
});
}
public static void ConfigureContentServices(IServiceCollection services, string contentApiUrl)
{
services.AddHttpClient("DeepDrft.Content", client =>
{
client.BaseAddress = new Uri(contentApiUrl);
});
services.AddScoped<TrackMediaClient>();
services.AddScoped<AudioInteropService>();
}
}