A video-hosting backend on Laravel 12. Uploads go through a Redis queue, FFmpeg cuts tube-style hover previews, ImageMagick makes thumbnails, and the catalog is served from a Redis cache.
These thumbnails and previews came out of ClipForge's own processing job. Hover a card (or tap it on mobile) to play the preview.
GitHub Pages only serves static files, so this page shows processed results. The full app (uploads, queue, API) runs with one docker compose up.
The HTTP request only validates and stores the file. Everything heavy happens in a queue worker.
ProcessVideo job lands on the Redis media queue. It is unique per video, with 2 tries+faststartThe parts a video platform needs to hold up under load.
| Problem | Solution |
|---|---|
| Encoding blocks requests | Processing runs in a queue worker. retry_after (700 s) is set above the job timeout (600 s), so a long encode is never picked up twice. |
| Hottest read: the catalog | Pages are cached in Redis and invalidated with a version counter: a single INCR retires every cached page, and no cache tags are needed. |
| View counter = hot-row UPDATE | Write-behind: each view is a Redis HINCRBY. A scheduled command drains the hash with an atomic RENAME and applies the counts in one transaction every minute. |
| Heavy grid pages | Small WebP thumbnails. The preview <video> element is created only on first hover. |
| Third-party API is down | The Telegram notifier uses a timeout and retries, and logs errors without failing the job. |
| Shell injection via filenames | All binaries run through argument arrays, never string concatenation. |
git clone https://github.com/trump-sudo/clipforge.git cd clipforge docker compose up -d --build # open http://localhost:8080 docker compose exec app php artisan test # 15 tests