Files
Musify/docs
Admin 89569736b7 Reorganize backend to mirror Musify.slnx folder structure
Moves the six backend projects on disk into Core/ and Hosts/
subfolders, matching the solution folders already defined in
Musify.slnx, so the file explorer reflects the same layout as the
solution:

  backend/Core/Musify.Domain
  backend/Core/Musify.Application
  backend/Core/Musify.Infrastructure
  backend/Hosts/Musify.Api
  backend/Hosts/Musify.Worker
  backend/Hosts/Musify.StreamingGateway

Updates every reference to the old paths: ProjectReference entries in
Musify.Api.csproj and Musify.Worker.csproj, the three Dockerfiles,
deploy/scripts/migrate.ps1|sh, deploy/zitadel/provision.ps1,
deploy/up.ps1, deploy/README.md and docs/development.md. Also fixes a
stale Dockerfile comment pointing at a compose file that no longer
exists.

Verified with `dotnet build Musify.slnx` against the new layout.
2026-09-09 14:27:50 +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.
  • ../deploy/README.md — El deploy en detalle: compose, scripts y producción.

Mapa de componentes (alto nivel)

                 ┌─────────────────────────────────────────────┐
   Cliente  ───► │ Musify.Api (: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)   →  Musify.Api valida el JWT

Stack

  • .NET 10, C#. Minimal APIs (Musify.Api), Worker Service (Musify.Worker), ASP.NET + YARP (Musify.StreamingGateway).
  • CQRS con [Mediator] (source-generator) y resultados con ErrorOr.
  • 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.

Estructura del repositorio

Un solo repo: backend/ (los seis proyectos .NET), web-player/ (cliente web SvelteKit), deploy/ (stacks de Docker Compose y scripts) y docs/.