$ show coralproject/talk
Coral is an open-source, multi-tenant comment moderation platform developed by Vox Media. It provides a full-stack application with embedded commenting widgets (stream), a comprehensive admin panel for moderation, configuration, and community management, an authentication system supporting local, OAuth2/OIDC, Google, Facebook, SSO, and account management pages. The system architecture consists of a Node.js/Express server with Apollo GraphQL, MongoDB for persistence, Redis for caching and pub/sub, and Bull for job queues. The client uses React with Relay for GraphQL data fetching, and is organized into several bundles: stream (the embeddable comment widget), admin, auth, account, install, count, and embed. The core data flow involves comments being submitted via GraphQL mutations, processed through a modular pipeline (spam detection, word list filtering, toxicity analysis via Perspective API, external moderation phases, and pre-moderation rules), stored in MongoDB, and then distributed via GraphQL subscriptions and notifications (email, Slack, webhooks). The codebase is extensive and well-tested, though it exhibits some legacy patterns (recompose HOCs, partial migration from class components to hooks, duplicated utility code between client and server scripts).
The LLM identified 3 files worth highlighting for reuse:
Provides a clean error class hierarchy (CoralError, TraceableError, MultiError, InvalidRequestError, etc.) and an abstract ErrorReporter with Sentry integration. This is a self-contained, reusable error handling pattern that can be extracted into any JavaScript/TypeScript project to standardize error types and reporting. It demonstrates non-obvious skill by separating error definitions from reporting mechanics, supporting multiple reporters, and including a global error reporter.
Implements a PromisifiedStorage abstraction over browser storage APIs (localStorage, sessionStorage, InMemoryStorage, IndexedDBStorage) with utilities like combinePromisifiedStorage and prefixStorage for scoping. This module is fully self-contained, has unit tests, and can be extracted into any web application to provide a consistent, testable storage interface. It demonstrates clean separation of concerns and handles asynchronous storage operations uniformly.
Defines a phase-based comment processing pipeline where each phase (spam, wordList, toxic, repeatPost, externalModeration, etc.) is a factory function that returns a processing function. Results from phases are merged using mergePhaseResult, allowing independent, composable processing steps. This pattern is reusable for any sequential data transformation pipeline (e.g., ETL, validation chains) and demonstrates a clean, extensible design that avoids tight coupling between stages.