Inspiration

Reddit gives moderators exactly one tool to understand their community's moderation activity: a raw, chronological text log.

u/randomguy — post removed — 2 hours ago
u/spammer123 — banned — 3 hours ago

No graphs. No alerts. No patterns. No way to know your subreddit is being raided until the damage is already done. Moderators of communities ranging from 500 to 5,000,000 members all face the exact same problem — they fly completely blind.

I wanted to build the tool I'd want if I were a moderator: a real-time intelligence command center that transforms raw mod actions into actionable insights, automated responses, and predictive warnings — all without leaving Reddit.

Nothing like it exists on Devvit today. That's why I built ModVigil.


What it does

ModVigil is a comprehensive moderation intelligence dashboard built natively on Reddit's Devvit platform with zero external dependencies. Every mod action automatically feeds into a live data pipeline, and moderators get intelligence they've never had before.

🚨 Anomaly Detection

  • Spike Alerts — Learns your subreddit's normal moderation volume per hour/day-of-week, then fires an emergency modmail to the entire mod team the moment activity hits 3× baseline. Catches raids and brigades before they peak.
  • Raid Prediction — A velocity-based 0–100 risk score that tracks post velocity, comment velocity, and new account joins in real time to predict coordinated attacks before they happen.

🤖 Automated Discipline

  • Progressive User Warnings — 2 removals → friendly PM, 3 removals → final warning, 4+ removals → flagged for manual mod review. No auto-banning. Humans always make the final call.
  • Auto-Flag Suspicious Users — Surfaces high-removal-rate accounts in a dedicated dashboard panel before mods have to go looking.

👥 Team Intelligence

  • Ghost Mod Detection — Identifies moderators inactive for 30+ days. One-click "Nudge" sends them a gentle PM reminder.
  • New Mod Welcome PM — Auto-onboards new moderators with a quick-start guide the moment they're added.
  • Mod Performance Insights — Per-moderator approval rate vs team average, days active, and post vs comment specialization.

📊 The Dashboard

  • 7×24 Coverage Heatmap — Red cells = dangerous uncovered hours. Orange intensity = moderation volume. See your entire week at a glance.
  • Circular Health Score Gauge — Algorithmic 0–100 score (coverage + volume weighted), color-coded: green (ELITE 90+), yellow (STABLE 70–89), red (CRITICAL <70).
  • 7-Day Activity Radar — Animated SVG bar chart showing weekly moderation trends.
  • Actionable Recommendations — URGENT / IMPORTANT / SUGGESTED cards telling mods exactly what to do next.
  • AutoMod Rule Suggestions — Analyzes removal patterns and generates ready-to-paste AutoMod YAML automatically.
  • Time Savings Calculator — Shows exactly how many hours and dollars ModVigil has saved the team since install.
  • 30-Day Trend Analysis — Volume, approval rate, and health score with month-over-month % change.
  • Benchmarking — Percentile rank vs all other subreddits running ModVigil.

📬 Automated Reporting

  • Weekly Digest — Every Monday at 9am UTC, a formatted intelligence report posts automatically with week-over-week comparisons and top removal reasons.
  • Transparency Mode — Toggle to post the digest publicly, building community trust through open moderation data.

How we built it

ModVigil is built entirely on Reddit's Devvit platform (SDK v0.12.23) using TypeScript and React 19, with no external APIs or dependencies.

Data Pipeline Every ModAction event feeds into pipeline.ts, which atomically records actions into time-bucketed Redis sorted sets keyed by YYYY-MM-DD:HH. This enables sub-millisecond aggregation at any time granularity without expensive full-key scans.

Intelligence Layer Three self-rescheduling scheduler jobs run continuously:

  • spikeChecker (every 15 min) — compares current-hour action count vs a 7-week rolling baseline stored per dayOfWeek:hour
  • baselineUpdater (hourly) — recalculates the rolling average using 7 weeks of historical data
  • weeklyDigest (every Monday 9am UTC) — generates and posts the formatted intelligence report

Dashboard A React 19 webview communicates with the Devvit server via postMessage. All visualizations (heatmap, bar chart, circular gauge, raid risk meter) are pure SVG — no Chart.js, no D3, no CDN imports — because Devvit's sandbox blocks external resources via CSP.

Storage Design All Redis keys are namespaced by subredditId for multi-tenant safety. Heatmap data is pre-aggregated into hash fields (heatmap:{date} → fields 0023) so the dashboard makes 7 hGetAll calls instead of 168 individual lookups — a 10–20× performance improvement.

Error Handling Every trigger, scheduler job, and Redis operation is wrapped in try/catch with typed safe defaults. The dashboard never shows a blank screen — it shows graceful "awaiting data" states with clear next steps.


Challenges we ran into

No external libraries allowed. Building a heatmap, circular SVG gauge, animated bar chart, and real-time pulse indicator using only inline SVG and CSS took significantly more effort than reaching for Chart.js — but it's exactly why ModVigil works perfectly inside Devvit's sandboxed webview where CDN imports are blocked.

Devvit's self-rescheduling scheduler requires careful design. Jobs don't auto-repeat — each one must schedule its own next run inside a finally block so rescheduling always happens even if the job body throws. Getting this wrong silently kills the job forever with no error message.

Atomic Redis operations under concurrency. Since ModAction triggers fire concurrently during traffic spikes, counters must use zIncrBy (atomic) instead of get + increment + set (race-condition-prone). Missing this would cause undercounting during raids — exactly when accuracy matters most.

The baseline cold-start problem. Spike detection needs historical data to set a baseline, but a fresh install has none. The solution: require a minimum of 5 actions in the current hour before spike detection activates, and provide a one-click demo data generator that seeds 7 days of realistic activity instantly for judges to test with.

Type-safe webview communication. Devvit's postMessage API requires serializable JSONObject payloads, but TypeScript interface types don't satisfy the index signature automatically. Required careful casting at the boundary without polluting the internal type system with [k: string]: unknown everywhere.


Accomplishments that we're proud of

  • Zero external dependencies — ModVigil runs entirely on Reddit's infrastructure. No API keys, no third-party services, no maintenance burden for the mods who install it. It cannot break because an external service went down.

  • Raid prediction before it peaks — The velocity-based risk scoring gives mods a 15–30 minute warning window before a spike reaches full force, turning reactive moderation into proactive defense.

  • AutoMod YAML generator — Pattern-matching removal data and generating ready-to-paste AutoMod rules is the kind of feature that directly and measurably reduces a moderator's weekly workload.

  • Works instantly on install, zero config — The scheduler starts within 60 seconds of install. Data flows immediately. No setup wizard, no credentials, no subreddit-specific configuration required to get value from day one.

  • Full graceful degradation — Every component handles zero data, partial data, and error states without crashing or showing a blank screen. ModVigil was designed to never embarrass a moderator in front of their community.


What we learned

Building for Devvit taught me to design within tight platform constraints and turn those constraints into architectural advantages. The "no external APIs" rule that initially seemed limiting became ModVigil's core strength: zero-dependency architecture means it will never break because a third-party service changed its API or went down.

I also learned that the best moderation tool is one that helps humans make better decisions, not one that tries to replace human judgment. Every automation in ModVigil — warnings, spike alerts, flagging — surfaces information and recommends actions, but always leaves the final decision to the moderator. That philosophy shaped every design choice.

Finally, building all visualizations in pure SVG was a masterclass in understanding exactly how charting libraries work under the hood — and a reminder that the fundamentals are usually simpler than the abstractions built on top of them.


What's next for ModVigil — Moderation Intelligence for Reddit

  • ML-Powered Sentiment Forecasting — Analyze the linguistic patterns of removed content to predict controversies and coordinated attacks 30–60 minutes before they materialize.

  • Timezone-Optimized Recruitment AI — Cross-reference 30-day coverage heatmaps with active-user data to recommend exactly which users to invite as moderators to fill specific coverage gaps.

  • Real-Time Command Center Event Bus — Sub-100ms dashboard updates using a server-side Redis event buffer, giving mods a live ticker of every action happening in the sub right now.

  • Cross-Subreddit Network Intelligence (Global Shield) — A collaborative defense layer where known bad actors flagged in one subreddit are automatically surfaced (not banned) when they appear in another subreddit running ModVigil.

  • Reddit Developer Funds — With ModVigil's engagement model, it's a strong candidate for Reddit's Developer Funds program, which rewards apps for reaching engagement milestones and ensures long-term maintenance.

Built With

Share this project:

Updates