Redacted Lore: The Collaborative Journal

🕵️ Inspiration

The internet is full of "perfect" stories, but I wanted to build something that embraced mystery and imperfection. I was inspired by the concept of SCP Foundation archives and the idea of "lost media"—stories where the missing pieces are just as important as the visible ones.

I wanted to create a collaborative experience where the community doesn't just write a story, but uncovers it. The mechanic of automatic redaction became the core hook: forcing users to work around censored keywords like secret or identity creates a unique constraint that drives creativity in unexpected directions.

🏗️ How I Built It

This project is a hybrid application leveraging the full power of the Reddit Developer Platform (Devvit):

  • Frontend (The "Journal"): I built a custom React application running inside a Devvit Webview. The UI is designed to mimic a tactile, paper journal with page-turn animations and typewriter effects. I used a Finite State Machine (FSM) to handle the transition from the "Cover" state to the "Reading" and "Writing" phases.

  • Backend (The "Redactor"): The backend logic resides in Devvit Blocks. It acts as the gatekeeper, receiving user submissions and passing them through a regex-based Redaction Engine before storage.

  • Persistence: I utilized Redis (via the Devvit plugin) to create a persistent, append-only log of the story. This ensures that the lore is shared across all users and survives page reloads.

  • Realtime Sync: To make the experience feel alive, I integrated the Realtime Plugin. When one user submits a line, it is instantly broadcast to every other reader currently viewing the journal, creating a sense of communal discovery.

🧠 Challenges I Faced

This was my first deep dive into the Devvit Blocks-to-Webview bridge, and it presented significant architectural hurdles:

  1. The "Disconnected" State: One of the hardest bugs was managing the handshake between the React iframe and the Reddit parent window. I had to implement a robust PING/PONG protocol to ensure the UI only unlocked once the user's session was fully authenticated.

  2. State Synchronization: Keeping the local React state in sync with the server-side Redis data was tricky. I learned to treat the server as the "Source of Truth" and the UI as a reflection of that state, rather than trying to manage two separate histories.

  3. Handling "The Unknown": Debugging the SUBMIT_ENTRY flow required handling edge cases where data was wrapped in unexpected layers by the platform. I built a "Deep Unwrap" utility to ensure user submissions were never lost, even if the payload structure shifted.

🎓 What I Learned

Building Redacted Lore taught me that constraints—whether in storytelling or in code—are actually catalysts for innovation. Working within the boundaries of the Reddit platform forced me to be creative with how I managed state and user feedback.

I also learned the importance of resilience in distributed systems. By implementing automatic retries and robust error handling for the Redis connection, I ensured that the "Redacted Journal" remains open for entries, even when the network tries to close it.

Built With

Share this project:

Updates