Project Story

What Inspired Us
Automoderator is arguably the most powerful tool available to Reddit moderators. It handles everything from simple keyword filtering to complex spam detection. However, configuring Automoderator requires writing raw YAML. For many non-technical moderators, learning YAML syntax, managing indentation, and remembering specific Regex patterns is a massive barrier to entry. Even for experienced mods, a single indentation error can break the configuration.

We were inspired to build AutomodFlow to democratize subreddit moderation. We wanted to lower the barrier to entry so that any moderator could build sophisticated moderation logic visually, without writing a single line of code.

How We Built It
We built AutomodFlow as a hybrid application leveraging modern web technologies and the new Devvit SDK.

  1. The Core Logic (Devvit): We used the Devvit SDK to create Custom Post triggers that serve as our application bridge, allowing us to authenticate the user and write configuration data directly back to the subreddit's config/automoderator wiki page.
  2. The Visual Interface (React + Vite): We utilized React and React Flow to create the interactive, node-based DAG (Directed Acyclic Graph) canvas.
  3. The Compiler: The core technical achievement is our custom, two-way YAML compiler. We wrote parsing logic that translates Reddit's strict Automoderator YAML into normalized JSON states that React Flow can render visually. Conversely, as users drag drop rules, our engine compiles the graph back into valid, optimized, Reddit-compliant YAML in real-time.

What We Learned
Building a two-way compiler for YAML was incredibly complex. We had to account for Reddit's specific Automod syntaxes—like modifiers ~title (regex): or nested author: objects—and map those conceptual structures to visual graph nodes. We learned a tremendous amount about Graph traversal algorithms (to determine which conditions lead to which actions) and the intricacies of the Devvit API for managing subreddit wikis.

Furthermore, we learned how to encode visual coordinates directly into the YAML as base64-encoded metadata comments (e.g., # automodflow: eyJ...), ensuring that when a moderator reloads their page, their visual layout is perfectly preserved without needing an external database.

Challenges We Faced
Our biggest challenge was "State Rehydration." Many moderators already have thousands of lines of Automoderator rules. Converting existing YAML into visual nodes required us to build an extremely robust parser that could handle edge cases, implicit combinations, and comments without corrupting the user's data. Ensuring that complex graph logic (e.g. multiple distinct conditions pointing to the same single remove action) correctly compiled back into the optimized, redundant YAML blocks required for Reddit was a mathematical challenge.

Built With

Share this project:

Updates