Inspiration Our inspiration stemmed from the simple joy of fortune cookies and the endless, often profound, and sometimes hilarious, insights found on Reddit's r/ShowerThoughts. We wanted to create a playful and engaging way to bridge these two concepts, offering users a unique experience of "cracking open" wisdom from the internet.

What it does "Crack a Thought" is an interactive application where users can virtually pull a lever on a whimsical vending machine to dispense a fortune cookie. Upon tapping the cookie, it "cracks" open to reveal a random "shower thought" fetched directly from Reddit's r/ShowerThoughts subreddit. Users then have the option to share this thought as a new post on Reddit, complete with attribution to the original author and score, or simply crack another cookie for more inspiration.

How we built it The application is built using a modern web stack tailored for the Devvit platform. The frontend is a React application, powered by Vite and styled with Tailwind CSS, providing a dynamic and visually appealing user interface. The backend is a Node.js Express server, running within the Devvit environment, which handles API requests for fetching shower thoughts from Reddit and posting new content back to Reddit. We utilized Devvit's Redis for caching shower thoughts to optimize performance and reduce API calls. The Devvit SDK was crucial for integrating with Reddit's functionalities, such as submitting posts and managing user context.

Challenges we ran into One of the primary challenges was understanding and working within the unique constraints of the Devvit platform, particularly regarding the separation of concerns between the Devvit app, the client-side webview, and the serverless backend. Ensuring seamless communication and data flow between these distinct environments required careful planning. Additionally, integrating with the Reddit API and handling rate limits, as well as designing the interactive fortune cookie and vending machine animations, presented interesting technical and creative hurdles.

Accomplishments that we're proud of We are particularly proud of the interactive and engaging user experience, from the satisfying "lever pull" animation to the visual effect of the cookie cracking open. Successfully integrating with the Reddit API to fetch and post content within the Devvit ecosystem was a significant achievement. The application's ability to provide a continuous stream of fresh, thought-provoking content in a fun format is something we're very happy with.

What we learned This project provided valuable insights into building applications on the Devvit platform, including best practices for structuring projects, managing state across different environments, and leveraging Devvit's built-in services like Redis. We deepened our understanding of React animations and responsive design with Tailwind CSS. Furthermore, we gained practical experience in consuming and interacting with external APIs, specifically the Reddit API, and handling potential errors and edge cases.

What's next for Crack a Thought For future development, we envision expanding the types of content users can discover, perhaps including quotes, jokes, or other forms of short-form wisdom. We could also implement user profiles to track favorite thoughts or allow users to contribute their own "shower thoughts." Enhancing the social sharing features beyond Reddit, and potentially introducing a "daily thought" notification system, are also exciting possibilities.

Built With

Share this project:

Updates