A real-time, multi-platform moderation logging system built with a CQRS and event-sourced architecture. ModLog tracks and aggregates moderation actions across Twitch, Discord, and other streaming platforms into a unified dashboard, giving streamers and their mod teams full visibility into moderation activity.
Key Features
- Multi-Platform Support — Ingests moderation events from Twitch, Discord, YouTube, Kick, and TikTok via dedicated bot services
- CQRS Architecture — Separated command (write) and query (read) paths using Kafka for event processing and dedicated API service for reads
- Event Sourcing — Complete audit trail of all moderation actions stored in PostgreSQL with read replicas for performance
- Real-Time Dashboard — Next.js 16 web application with live updates, role-based access control, and per-streamer configuration
- Custom Permissions System — Granular role and permission management allowing streamers to control what their moderators can access
- Observability — Full distributed tracing with OpenTelemetry and Jaeger, structured logging with Pino
- Scheduled Automation — Cron-based scheduler for recurring tasks and automated moderation workflows
Architecture
The system is organized as a Bun monorepo managed with Turborepo, consisting of 10+ services and shared packages:
- Dashboard — Next.js 16 App Router frontend with tRPC and Eden Treaty for type-safe API consumption
- API Service — Elysia-based query layer serving the read side of CQRS
- Command Service — Kafka consumer processing write commands and broadcasting events
- Twitch Bot — Real-time WebSocket connection to Twitch for event ingestion
- Discord Bot — discord.js integration for Discord moderation tracking
- Shared Packages — Database (Prisma + ZenStack), caching (Redis), permissions, error handling, resilience (circuit breakers), and logging