Inspiration

Music has always been a central part of my life, so the idea of a music-based game was a recurring thought. In November 2024, I serendipitously discovered Spotify’s API. After experimenting with it for a few days, I decided to build the project I’d always craved. Research showed that Gen Z spends about 15.5% of a 24-hour day either gaming or listening to music (or roughly 29.27% of their waking hours), which reinforced the idea of creating an application that blends immersive music listening with interactive gaming. I even envisioned future integrations with platforms like Apple’s iMessage, enabling friends and strangers to connect over music-related games—along with potential applications in karaoke settings and other events. I view this submission as just a prototype of what could evolve into a fully integrated tool. A big shout-out goes to my peers whose creative energy and collaborative spirit were instrumental during the incubation of this idea.

What it does

ègwú is a music-centric gaming platform that transforms your listening habits into interactive gameplay. The application leverages your Spotify data to generate personalized game challenges, including: Complete the Lyrics (Voice and Text): Test your knowledge by filling in missing lyrics, with challenges generated by AI. Artist Guess: A game inspired by spotle.io where you guess an artist from your most-listened artists, guided by genre, origin, and progressive clues. Crossword: Solve crosswords generated from your favorite song lyrics, with clues and word placements refined for clarity. Trivia: Answer multiple-choice questions crafted from the biographies of your most-listened artists, complete with explanations for each correct answer. Each mode is designed to provide an engaging blend of music discovery and interactive fun, supported by robust data fetching, caching, and real-time analytics.

How we built it

I started by forming a mental model of the project and developing a detailed 45-day roadmap. I selected a tech stack comprising Django, Django REST Framework, React, and PostgreSQL, and generated API keys for the external services I planned to integrate.

Backend Project Structure:

Created two separate folders: one for the Backend (handling game logic, database operations, data fetching, and caching) and one for the Frontend (managing client rendering and partial game logic). Django Apps:

Spotify App: Handles user login using Spotify’s OAuth. Asynchronously fetches user data (username, image URL, and listening habits) and integrates additional APIs (Genius with web scraping, Wikipedia, Discogs, Last.fm) to enrich the metadata. Manages JWT authentication across the project. Implements a processing_status endpoint to notify the frontend when data fetching is complete, directing the user to the game dashboard.

Spotify_games App: Imports the user model from the Spotify app and uses the JWT token for seamless authorization. Defines game logic for various modes: Complete the Lyrics (Voice/Text): Uses Google PaLM AI to generate challenges from randomly selected lyrics and validates user input via audio transcription (using the AudioSegment library) or text comparison. Artist Guess: Randomly selects an artist from the user’s most-listened list and provides progressive clues (using a color-coded hint system) based on user guesses. Crossword: Generates crossword puzzles from song lyrics with AI-assisted clue and word generation. Trivia: Crafts multiple-choice questions from artist biographies, complete with correct answers and detailed explanations. Implements robust caching and analytics mechanisms to enhance performance. Frontend Initialized a React project using Vite. Developed a user-friendly interface for interacting with the various game modes, despite my limited proficiency in React.

Challenges we ran into

Asynchronous Data Fetching: Handling threading issues during asynchronous data fetching proved challenging, requiring careful management of concurrent operations.

Operational Costs and API Limitations: The high cost of AI APIs and the lack of explicit responses from free versions made integrating and refining the AI-generated challenges a complex task.

Solo Development: Perhaps the most significant hurdle was completing the project unaided, which required managing all technical and creative challenges independently.

Accomplishments that we're proud of

Integrated Multi-API Architecture: Successfully combining data from Spotify, Genius, Wikipedia, Discogs, and Last.fm to provide enriched user data and gameplay experiences.

Robust Game Logic Across Multiple Modes: Developed and implemented multiple game modes—each with its own unique set of challenges and validations—using AI services and real-time processing.

Efficient Authentication and Data Handling: Implemented JWT-based authentication and efficient data fetching/caching mechanisms, ensuring smooth integration between the frontend and backend.

Rapid Prototyping and End-to-End Functionality: Delivered a fully functional prototype that seamlessly blends music streaming with interactive gaming, all within a tight development schedule.

What we learned

This project was a tremendous learning experience. I deepened my expertise in Django and Python while gaining hands-on experience with Django REST Framework, React, and Redis. I learned about:

Authentication Mechanisms: JWT tokens, cookies, and secure API creation.

Advanced Programming Techniques: Object-oriented programming (abstraction, inheritance), asynchronous programming, and effective use of decorators.

Problem-Solving and Patience: Overcoming threading issues, managing API limitations, and embracing structured problem-solving approaches.

Ultimately, I discovered that with focused determination and perseverance, I can overcome any technical challenge

What's next for ègwú

Looking ahead, I plan to:

Expand Game Modes: Incorporate additional game challenges and refine existing ones based on user feedback.

Enhance Social Integration: Explore integrations with platforms like Apple’s iMessage to allow for real-time, social gaming experiences.

Optimize Performance: Continue enhancing caching mechanisms, analytics, and overall performance for a smoother user experience.

Broaden Music Data Sources: Consider integrating additional music APIs and expanding the range of metadata for even more personalized gameplay.

Scale Up for Wider Adoption: Prepare the platform for scalability, ensuring it can handle increased traffic and a broader user base as it evolves from a prototype into a full-fledged application.

Built With

Share this project:

Updates