$ show moffatman/chan
Chance is a multi-platform Flutter application for browsing and posting to imageboard forums (4chan, 8kun, Lainchan, Hacker News, etc.). It implements a rich, adaptive UI that switches between Material Design and Cupertino styling based on platform and user preference. The app handles complex networking tasks including Cloudflare bypass, multiple captcha systems (reCAPTCHA, hCaptcha, custom 4chan captcha), TLS fingerprinting, and HTTP caching. It features a full media pipeline with streaming MP4/HLS support, thumbnail generation via FFmpeg, and a custom local HTTP server for video playback. State is persisted using Hive, with sophisticated conflict resolution for settings and watched threads. The codebase demonstrates high craftsmanship in areas like custom gesture recognizers, a generic priority queue for rate limiting, and a rich post-span rendering system. However, it relies on forked dependencies (Dio, Hive, flutter_inappwebview) and contains many generated files and platform-specific workarounds that introduce maintenance risk.
The LLM identified 3 files worth highlighting for reuse:
Implements a local HTTP server (VideoServer) that proxies and caches video files (MP4, HLS) with range-request support. It downloads media in parallel chunks and serves them to the Flutter video player, enabling efficient streaming without relying on external servers. The server is self-contained, uses Dart's dart:io, and can be extracted into any Flutter project needing local media streaming.
A generic priority queue for managing async tasks with configurable concurrency (series, parallel, or limited parallel). Supports cancellation, error handling, and nested tasks. Decoupled from the app's networking, it can be reused in any Dart project requiring controlled task execution with prioritization.
A custom URL linkifier that parses text to detect URLs, with loose regex matching, TLD validation from a built-in list, and support for reddit-safe mode. It is a self-contained module that can be extracted into any Dart/Flutter project needing robust URL detection without external dependencies.