How programador-tv/monorepo works
Project type and purpose
• This is a full-stack, .NET-centric monorepo powering the “programador.tv” ecosystem. It includes:
• An ASP.NET Razor-Pages UI (“APP.Platform”)
• Multiple backend services (WebApi, WebSocket, Background workers, RTMP.Live, Background.Live, Background.Browser)
• A Core bounded-context broken into Presentation (API & WebSocket endpoints, queues, workers), Application (business logic), Domain (entities, contracts, interfaces), and Infrastructure (EF Core, Redis, repositories, web-service clients, video handling, email handling).
• Messaging via MassTransit/RabbitMQ and Redis for real-time chat.
• Streaming ingestion/processing (RTMP → HLS via Infrastructure.VideoHandling).
• Identity & authentication with ASP.NET Identity.
File structure
• Top-level “src” contains:
• APP.Platform: front-end UI (Razor pages + client JS + Identity).
• WebApi: REST API front door.
• WebSocket: real-time channels for chat/live.
• Background, Background.Live, Background.Browser: long-running services (email sender, mentor notifications, browser automation).
• RTMP.Live: Go-based RTMP ingest server.
• Core: the heart of the domain (Presentation, Application, Domain, Infrastructure).
• “docker-compose.yml” orchestrates all services plus dependencies (SQL, Redis, RabbitMQ).
• “monorepo.sln” references all .NET projects.
Readme insights
a. Frontend/UI
• APP.Platform (Razor Pages, JS components) serving user interactions.
• Authentication (Identity Area).
b. API layer
• WebApi + Core.Presentation REST EndPoints.
• WebSocket service + ChatHub, LiveSockets for real-time messages.
c. Business core
• Core.Application: business logic for chat, follow, live, scheduling, notifications.
• MassTransit message publisher/consumers.
d. Data layer
• Core.Infrastructure EF Core (ApplicationDbContext) → SQL Server.
• Redis (Chat channel pub/sub).
• Repositories (SQL + Redis) behind Domain interfaces.
e. Messaging & workers
• RabbitMQ (queues for ChatsQueue, CommentsQueue, EmailsQueue, LiveStreamingQueue, etc.).
• Core.Presentation Workers (JoinTimeWorker, LiveCloseWorker, TimeSelectionWorker) listen and process.
f. Streaming
• RTMP.Live ingests video → pushes to Infrastructure.VideoHandling (HLSProcessManager) → clients via APP.Platform Studio page or CDN.
g. External services
• OpenAI (OpenAiService & OpenaiWebService client).
• 3rd-party WebServices (BocaSuja, ChatWebService, etc.).
• Email service (SMTP clients via Infrastructure.EmailHandling).
Relationships & data flow
• User → UI (APP.Platform) → REST API or WebSocket
• REST API → Core.Presentation EndPoints → Core.Application Logic → Core.Infrastructure Repositories → Database
• UI real-time chat/live → WebSocket → Core.Presentation Hubs → Redis pub/sub or RabbitMQ → Subscribers
• Streams: RTMP.Live → RabbitMQ LiveStreamingQueue → VideoHandling → HLS segments → UI player
• Core.Application publishes domain events to RabbitMQ → Core.Presentation Workers consume → update DB or notify UI
Architectural patterns & design principles
• Onion/Clean architecture: Presentation → Application → Domain → Infrastructure
• CQRS style separation (commands via queues, queries via REST)
• Pub/Sub (MassTransit + RabbitMQ) for decoupled asynchronous processing
• Redis for low-latency chat caching/pub-sub
• Micro-services containerized via Docker Compose
• Single repository (monorepo) with solution reference graph