Inspiration
We love trivia and discovering new music. The idea of testing knowledge about a specific artist’s work each day, while providing a fun and communal challenge, felt like the perfect blend of music appreciation and friendly competition. We wanted to bring a unique twist to daily trivia and share the thrill of earning points for correct answers.
What it does
"Do You Know Music?" displays a daily trivia question about a selected artist. All participants see the same question, and their scores are tracked on a leaderboard. After submitting an answer, users immediately find out if they’re correct, and their score updates accordingly. Every week, the scoreboard resets to give everyone a fresh chance to climb the ranks.
How we built it
We used Devvit’s custom post type system to create an interactive quiz interface, integrating with the OpenAI API to fetch fresh trivia questions daily. Redis is leveraged to store the question, the answer, and the user scores. The logic ensures that the same question persists for 24 hours for all users, and scores are cleared every week.
Challenges we ran into
One of the main challenges was figuring out how to maintain a single shared question across all users without making constant API calls. We also needed a robust mechanism for resetting the leaderboard and ensuring data consistency. Managing state between server calls and ensuring synchronous updates to Redis proved tricky.
Accomplishments that we're proud of
We’re proud of efficiently caching the daily question and answer set, significantly reducing API calls. We’re also thrilled that we created a weekly reset system, encouraging ongoing engagement and a fair competition. The end result is a seamless, fun experience that everyone can enjoy.
What we learned
This project taught us how to integrate external APIs (like OpenAI) into the Devvit environment, how to use Redis effectively for caching and state management, and how to build a user-friendly custom post type. We also gained insight into balancing functionality with performance in a collaborative environment.
What's next for "Do You Know Music?"
We plan to add user-configurable artists, multiple difficulty levels, and more diverse music-related content. Implementing hints, streak bonuses, and seasonal leaderboards are also on our roadmap, turning "Do You Know Music?" into an even more dynamic and engaging trivia experience where other subreddits can easily implement it.
Built With
- devvit
- openai

Log in or sign up for Devpost to join the conversation.