Inspiration

I built SubReddit Immune System because Reddit moderators are overwhelmed. They manually read through hundreds of posts, react to toxic comments after the damage is done, get hit by coordinated raids with no warning, and burn out silently with no one tracking their workload. I wanted to build the immune system that every subreddit is missing — something that detects threats before they spread, just like the human immune system fights infection before you even feel sick.

What it does

SubReddit Immune System is a 9-feature real-time moderation dashboard built natively on Devvit. Mods open it as a custom post inside their subreddit and get instant access to:

  • 🏥 Health Dashboard — scans 25 recent posts, calculates a live Health Score (0–100), and shows community status: Healthy / At Risk / Critical
  • ☣️ Toxicity Detection — scans both posts AND comments for toxic keywords, showing risk level (High/Medium/Low) and exact trigger words
  • 🚨 Raid Detection — tracks unique authors and account age badges (🚨 new accounts flagged in red), calculates a Raid Risk Score
  • 😮‍💨 Mod Burnout Tracker — reads the mod log and flags overloaded moderators so teams can redistribute work
  • ⚡ One-Tap Mod Actions — Remove, Lock, Approve, and Ban buttons directly on every flagged item
  • 🔑 Custom Keyword List — mods edit their own toxic keyword list inside the app, saved per-subreddit
  • 🤖 Auto-Mod Rules — set a risk threshold, pick an action (auto-remove or auto-lock), and run automatically
  • 📋 Action History Log — every mod action is logged with timestamp and who performed it
  • 📈 Health History — bar chart of health scores over time, saved automatically on every scan

How I built it

Built entirely on Devvit using a clean client-server architecture. The WebView UI is written in TypeScript with vanilla DOM manipulation. The Devvit Server handles all Reddit API calls — fetching posts, scanning comments, reading the mod log, looking up account ages, and executing Remove / Lock / Approve / Ban. Redis (Devvit's built-in KV store) persists custom keywords, automod rules, action logs, and health snapshots — all scoped per-subreddit.

Challenges I ran into

The hardest bug was a double-prefix issue. Devvit's getComments() returns comment IDs that sometimes already include the t1_ prefix. When I re-added t1_ before calling reddit.remove(), I got t1_t1_abc123 — which Reddit's API rejected silently. The fix was a normalizeRedditId() helper that strips all existing prefixes before applying the correct one based on content type.

Comment scanning at scale risked timeouts, so I limited scans to the 5 most recent posts per run. Raid detection required a getUserByUsername() call per unique author, so I capped it at 25 recent posts to keep it fast.

Accomplishments that I'am proud of

  • Built 9 fully working features end-to-end in a single hackathon
  • Fixed comment removal correctly — required deep understanding of Reddit's ID prefix system
  • Auto-mod engine that takes real actions on Reddit automatically
  • Clean dark-themed UI that feels native to Reddit with zero learning curve for mods
  • All data persisted per-subreddit in Redis so settings and history survive across sessions

What I learned

The biggest technical lesson was understanding Reddit's content ID system — every post has a t3_ prefix and every comment has a t1_ prefix, and getting that wrong breaks everything silently. I also learned how to architect a full client-server app inside Reddit's sandboxed environment, use Redis for persistent cross-session state, and build a UI within Devvit's WebView constraints. Most importantly: always normalize IDs before touching Reddit's API.

What's next for SubReddit Immune System

  • Scheduled auto-mod — run the engine every hour automatically, not just on-demand
  • Health score alerts — notify mods when score drops below a set threshold
  • Multi-language keyword support — toxic content isn't only in English
  • Community leaderboard — reward positive contributors to encourage healthy behavior
  • Devvit App Directory listing — so any subreddit can install it in one click

Built With

Share this project:

Updates

Submission history