This project is a full-stack video platform, built to show how modern video systems (like YouTube) work.
- Account registration, password login, Google sign-in, sessions, roles, creator channels, and staff access checks
- Direct-to-S3 multipart upload sessions with checksum, content-type, owner, and completion validation
- Kafka-backed FFmpeg workers for asynchronous media processing
- Adaptive HLS playback assets, thumbnails, preview sprites, and caption tracks
- CloudFront-ready playback metadata with signed URL and signed cookie support
- OpenSearch indexing for search, suggestions, filters, ranking, and reindexing
- Personalized recommendation surfaces from trending, subscriptions, similarity, and history signals
- ClickHouse-backed creator analytics for watch time, retention, exports, and dashboard views
- Moderation queues, reviewer actions, report handling, audit events, and trust hooks
- Docker Compose, Kubernetes, Terraform, Prometheus, Grafana, and OpenTelemetry scaffolding
The system centers on a production media loop: creators upload source media directly to object storage, the API records state and emits Kafka events, workers generate playback assets and read models, viewers stream HLS through CloudFront, and product events feed analytics, recommendations, moderation, search, and observability.
The editable Mermaid source for the diagram lives at assets/architecture.mmd.
- Next.js, React, TypeScript, and CSS for the web application
- Go HTTP services and workers for API, media processing, indexing, and analytics ingestion
- PostgreSQL for users, channels, sessions, videos, uploads, jobs, moderation, analytics metadata, and audit events
- Redis for short-lived state, rate-limit-ready counters, locks, and cache surfaces
- Kafka for upload, search, playback, analytics, recommendation, and moderation event streams
- Amazon S3 and CloudFront for source media, HLS assets, thumbnails, captions, and playback delivery
- FFmpeg and FFprobe for media probing, transcoding, thumbnails, sprites, and captions
- OpenSearch for full-text discovery and suggestions
- ClickHouse for append-only analytics and creator dashboard queries
- Docker Compose, Kubernetes, Terraform, Prometheus, Grafana, and OpenTelemetry for production-style operations
apps/web- Next.js viewer, creator, auth, moderation, channel, search, and watch surfacesservices/api- Go API for identity, uploads, playback, search, recommendations, moderation, and analyticsservices/worker-transcode- Kafka consumer that runs FFmpeg and writes playback assetsservices/worker-indexer- Kafka consumer that keeps OpenSearch synchronizedservices/worker-analytics- Kafka consumer that writes playback analytics into ClickHousepackages/analytics,packages/search,packages/observability- shared Go packagesinfra- Docker-adjacent config, Kubernetes manifests, Terraform modules, Prometheus, Grafana, and OpenTelemetry collector configassets- favicon and architecture diagram assets
npm install
docker-compose up -d
npm run migrate:up
npm run serve:api
npm --workspace apps/web run serveFor the development web server, use:
npm --workspace apps/web run devnpm run verifyThis runs web linting, Go vet, Go tests across services and shared packages, the Next.js production build, and Go binary builds. Go build and module caches are kept under scratch/.