Admin 93ee8be0cd feat(infra): playlist processing saga + generalize fault handling (phase 3)
Adds the PlayList picture-processing lifecycle saga (correlated by PlayListId)
mirroring the track one, and generalizes the failure plumbing:
- Rename the track fault translator to ProcessingSlipFaultConsumer and use a
  generic Workflow.SubjectId variable + ProcessKind; it now emits typed
  Track{Picture,Audio}/PlayListPicture ProcessingFailed events for all slips
- PlayListProcessingStateMachine (+ EF-persisted PlayListProcessingState,
  migration): starts on CreatePlayListResourcesEvent, finalizes on
  PlayListPictureProcessed, and on failure marks the playlist Failed and
  removes the orphaned final picture (PlayListProcessingFailedConsumer +
  MarkPlayListAsFailedActivity)
- UpdatePlayListPictureActivity publishes PlayListPictureProcessed on success
- Picture slip carries SubjectId + PlayListPicture kind + fault subscription

Verified end-to-end in Docker (RabbitMQ + migrated Postgres): both saga
endpoints, the fault translator and cleanup consumers configure, and an
addressing cross-check confirms all 21 activity execute queues the builders
address exist (caught + fixed a kebab mismatch on mark-play-list-as-failed).

Build: 0 warnings, 0 errors.
2026-07-05 14:55:40 +02:00

Musify — Documentación

Musify es un backend de streaming de música: subir pistas, procesarlas (transcodificar el audio a .m4a y generar miniaturas), organizarlas en playlists y reproducirlas en streaming sin que los bytes pasen por la API.

Esta carpeta explica qué hace cada pieza, su propósito y por qué está diseñada así.

Índice

  • architecture.md — Visión global: componentes, cómo encajan y los flujos principales.
  • projects.md — Qué es y para qué sirve cada proyecto/solución.
  • authentication.md — Zitadel (OIDC), validación de JWT, provisioning/sync de usuarios.
  • storage.md — SeaweedFS (S3), estructura de claves, URLs prefirmadas, qué es público y qué privado.
  • streaming.md — Streaming del audio (.m4a por HTTP range) con stream-ticket (RS256) y el reverse proxy (StreamingGateway).
  • media-processing.md — El worker y los workflows de MassTransit (transcode de audio, miniaturas).
  • development.md — Cómo levantar todo en local: contenedores, puertos y comandos.

Mapa de componentes (alto nivel)

                 ┌─────────────────────────────────────────────┐
   Cliente  ───► │ WebApi (:5111)  API REST + emite tickets     │
                 └─────────────────────────────────────────────┘
                        │ EF Core          │ presigned (subidas)   │ MassTransit (eventos)
                        ▼                  ▼                       ▼
                 PostgreSQL          SeaweedFS S3 (:8333)     RabbitMQ ──► Worker (procesa)
                 (metadatos)         (objetos)                            audio→.m4a, imágenes
                                          ▲
   Cliente  ───► StreamingGateway (:8081) ┘   sirve audio .m4a (valida ticket, proxy al filer)

   Login: Cliente ◄──► Zitadel (:8080, OIDC)   →  WebApi valida el JWT

Stack

  • .NET 10, C#. Minimal APIs (WebApi), Worker Service (Worker), ASP.NET + YARP (StreamingGateway).
  • CQRS con [Mediator] (source-generator) y resultados con Ardalis.Result.
  • EF Core 10 + PostgreSQL (metadatos).
  • MassTransit 8 + RabbitMQ (procesado asíncrono con routing slips/sagas).
  • SeaweedFS (almacenamiento de objetos compatible con S3, vía AWSSDK.S3).
  • ffmpeg (transcode de audio a AAC/.m4a), SixLabors.ImageSharp (miniaturas).
  • Zitadel (OIDC/OAuth2) para identidad.

Repositorios git

Cada proyecto de nivel superior es su propio repo git: MusifyBackend, Musify.WebApi, Musify.StreamingGateway, Musify.Worker. La raíz del workspace (docs/, deploy/, player.html) no está versionada.

S
Description
No description provided
Readme
5.1 MiB
Languages
C# 73.1%
Svelte 12.1%
TypeScript 9%
Kotlin 4.1%
CSS 1.1%
Other 0.6%