What is RedLex?
RedLex is an all-in-one moderation toolkit for Reddit communities, built entirely on Devvit. It brings seven mod tools into a single app — all accessible through Reddit's native context menus, with no external UI or webview required.
Inspiration
Moderation is mostly invisible work. Mod teams deal with the same problems every day — tracking repeat rule-breakers, handing off context between shifts, explaining removals to confused users — but Reddit's built-in tools don't cover any of it well. RedLex was built to fill those gaps with tools that feel native to Reddit rather than bolted on.
What it does
⚖️ Strike Ledger
Track rule violations per user with a structured strike system.
- Add a strike via right-click on any post or comment
- Username and post URL are auto-prefilled from context
- Severity levels: warning, minor, major
- User receives a private message notification on every strike
- View full strike history per user from the post or subreddit menu
📰 Weekly Community Digest
Weekly roundup of top community content — with optional AI summaries.
- Two modes: AI (OpenAI GPT-3.5 Turbo) or Template
- Fetches the week's top posts from the subreddit
- AI mode calls
api.openai.comand generates a natural language summary - Template mode builds a smart digest locally — no API key needed
- Weekly scheduler + manual trigger
- Setup form to configure your OpenAI API key and preferred mode
📋 Shift Handoff Notes
Leave notes between mod shifts so nothing gets missed.
- Add a note with a text body and priority (normal / urgent)
- View all unresolved notes at a glance
- Resolve notes by ID once handled
- Notes stored per subreddit
📜 Transparency Log
Automatically log every mod action to a public post in the subreddit.
- Hooks into the
onModActiontrigger — no manual logging needed - Creates and maintains a single pinned log post
- Post body is updated live with each new action
- Action emoji mapping:
removelink→ 📛,removecomment→ 💬,banuser→ 🔨,approvelink→ ✅
🎉 Community Milestones
Celebrate subscriber milestones automatically.
- Configure which subscriber counts to celebrate (e.g. 100, 500, 1000)
- Milestone check runs on every new post submission via
onPostSubmit - Posts a celebration thread when a milestone is hit
- Each milestone is only ever celebrated once
📊 Mod Action Digest
A weekly summary of mod team activity, posted automatically.
- Tracks every mod action with the acting moderator's name via the onModAction trigger
- Groups actions by moderator and counts each type (removals, bans, approvals)
- Two modes: AI (OpenAI GPT-3.5 Turbo) for a natural language summary, or Template for a clean markdown table with no API key needed
- Posts a formatted digest to the subreddit every Monday at 9AM via the scheduler
- Manual "Generate Digest Now" option for on-demand reports at any time
- Configure post title, AI mode, and OpenAI API key via the Configure Mod Digest menu item
- Resets the action log after each digest so each week starts fresh
💬 Rule Explainer
Automatically send a friendly DM to users when their post is removed.
- Triggers on every
removelinkmod action viaonModAction - Matches the removal reason against configurable rule templates using keyword matching
- Falls back to a default message if no template matches
- DM explains exactly which rule was broken and how to repost correctly
- Fully configurable: enable/disable, custom signoff, per-rule templates
- Add and view rule templates directly from the subreddit menu
How I built it
RedLex is built on Devvit 0.12.22 using the @devvit/web server model with
Hono as the backend framework and TypeScript throughout. All persistent
state lives in Redis via @devvit/web/server — no external database needed.
The entire UI is handled through Devvit's native forms and toasts.
The app hooks into three Devvit triggers:
onModAction— powers the transparency log and rule explainer DMsonPostSubmit— powers the milestone checker- Scheduled tasks — fire the mod digest and community digest every Monday at 9AM
What I learned
- How to structure a large Devvit app across multiple route files cleanly
- How Devvit's form registration system works under the hood
- The constraints and strengths of building entirely within Reddit's platform
- How to use OpenAI's API within Devvit's external allowlist restrictions
Built With
- devvit
- hono
- node.js
- openai
- redis
- typescript
- vite
Log in or sign up for Devpost to join the conversation.