Inspiration

I was inspired to create an interactive shopping experience that engages Reddit users in a fun way. The idea of combining random sneaker designs with celebrity collaborations seemed like a perfect way to spark conversations and gather opinions on hypothetical products.

What it does

My Would You Buy app creates interactive polls featuring randomly generated sneaker product ideas. Each poll displays a unique sneaker image alongside product details, including a brand, color scheme, celebrity collaboration, and price point. Users can vote "Yes" or "No" on whether they would purchase the product and see real-time results displayed as percentage bars once they've voted.

How we built it

I built this app using Reddit's Devvit platform with the following components:

  • Custom Post Type to create the interactive poll interface
  • Reddit API to handle user authentication and post creation
  • Redis database to store votes and track user participation
  • Media capabilities to display random sneaker images from the assets folder
  • React-like components with useState hooks for state management
  • Menu items that allow moderators to easily create new polls

Challenges we ran into

During development, I faced several technical hurdles:

  • Getting images to display consistently required implementing proper error handling and fallbacks
  • Ensuring product details remained the same when refreshing the page meant carefully managing metadata storage
  • Balancing the layout to accommodate both the product image and voting interface within limited space
  • Finding the right approach to generate random content for new posts while keeping existing posts consistent

Accomplishments that we're proud of

I'm particularly proud of creating a seamless voting experience that persists across sessions and provides immediate visual feedback. The implementation of Redis transactions ensures vote counts are accurate even with concurrent users, and the random product generation creates unique and sometimes amusing product concepts that spark engagement.

What we learned

This project taught me how to effectively use Devvit's capabilities, including:

  • Working with Devvit's Blocks UI system for creating interactive interfaces
  • Managing state across user sessions with useState hooks
  • Storing and retrieving data using Redis for persistence
  • Handling media assets and implementing proper error recovery
  • Creating a responsive layout that works well on different devices

What's next for Would_You_Buy

Future enhancements could include:

  • Adding more product categories beyond sneakers
  • Implementing comment sections for users to discuss product ideas
  • Creating leaderboards for most popular product concepts
  • Adding analytics to track voting patterns
  • Exploring real-time capabilities to show live voting activity

Built With

Share this project:

Updates