Inspiration

Every Reddit moderator knows the feeling — you open the mod queue and there are hundreds of items staring back at you, with no way to tell what's urgent and what's trivial. Mod teams burn out. Rules get enforced inconsistently. Repeat offenders slip through the cracks because no one has time to manually track violation history. I built ModGuard because moderators deserve better tools. The people who keep Reddit's communities healthy are volunteers doing an incredibly demanding job with outdated utilities. I wanted to build something that genuinely gives them time back.

How I Built It

ModGuard is built entirely on Reddit's Devvit platform using TypeScript and Redis for persistent state. The architecture has four core layers:

  1. Event Triggers Every post and comment submission fires through a scoring pipeline that evaluates the author's risk profile in real time.
  2. Rule Engine A condition-action evaluator that checks content against moderator-defined rules — supporting keyword matching, regex, account age, karma thresholds, and user violation scores.
  3. Scoring Engine Each user carries a dynamic violation score from 0 to 100, calculated as: Snew=min(100,Scurrent+Δv×Mr) Snew=min(100, Scurrent+Δv×M r) Where Δvis the violation weight and Mr is a recency multiplier (1.5×(1.5× for violations within 24 hours)).

Score decay over time rewards good behavior: Sdecayed=max(0,Scurrent−(Ddays×rdecay)Sdecayed=max(0, Scurrent−(D days ×r decay))

  1. Dashboard A custom post type renders a live command center with tabbed navigation — Overview, Smart Queue, Rules, and Action Log.

🚧 Challenges No native Redis key scanning — Redis on Devvit doesn't support pattern-based key iteration, so I had to maintain manual index lists for tracked users Form field types — Select fields sometimes return arrays even for single selections, requiring defensive Array.isArray() guards throughout Real-time dashboard updates — Custom posts don't auto-refresh, so I designed the UI to show the most recent snapshot clearly 📚 What I Learned Devvit's trigger system is surprisingly powerful for building event-driven moderation pipelines Redis is more than fast enough for real-time user scoring at subreddit scale .The best mod tools are the ones that require zero ongoing effort from the mod team after setup

Built With

Share this project:

Updates