A social music app where friends share songs, build collaborative playlists, and track listening stats.
This is the starter repo for Project 5: Mixtape Bug Hunt. The app has five open issues in its tracker. Your job is to find, fix, and document at least three of them.
ai201-project5-mixtape-starter/
├── app.py # Flask app factory and DB setup
├── models.py # SQLAlchemy models for all entities
├── routes/
│ ├── songs.py # Song sharing, search, and rating routes
│ ├── playlists.py # Playlist creation and song management
│ ├── users.py # User profiles, streaks, notifications
│ └── feed.py # Friends listening now, activity feed
├── services/
│ ├── streak_service.py # Listening streak logic
│ ├── feed_service.py # Friends listening now feed logic
│ ├── search_service.py # Song search logic
│ ├── notification_service.py # Notification creation and retrieval
│ └── playlist_service.py # Playlist retrieval logic
├── tests/
│ ├── test_streaks.py
│ ├── test_search.py
│ └── test_playlists.py
├── seed_data.py # Populates DB with test data
├── requirements.txt
└── .gitignore
The bugs live in the services/ layer. The routes call services — if something is broken in an endpoint, trace it back to the service it calls.
Create and activate a virtual environment:
python -m venv .venv
# macOS / Linux
source .venv/bin/activate
# Windows (Command Prompt)
.venv\Scripts\activate.bat
# Windows (Git Bash)
source .venv/Scripts/activateInstall dependencies:
pip install -r requirements.txtSeed the database with test data:
python seed_data.pyRun the app:
FLASK_APP=app:create_app flask runmacOS note: If the app starts but requests hang or return connection refused, try
http://127.0.0.1:5000instead ofhttp://localhost:5000. On macOS,localhostsometimes resolves to an IPv6 address that Flask isn't listening on.
Run tests:
pytest tests/| # | Title | Affected service |
|---|---|---|
| 1 | My listening streak keeps resetting | streak_service.py |
| 2 | Friends Listening Now shows people from yesterday | feed_service.py |
| 3 | The same song keeps showing up twice in search | search_service.py |
| 4 | I got notified when a friend added my song to a playlist but not when they rated it | notification_service.py |
| 5 | The last song in a playlist never shows up | playlist_service.py |
Full issue descriptions are in the Project 5 brief. Read them carefully before opening any service file.
Start with models.py to understand the data model. Then trace a feature through from its route to its service. For example:
- A user rates a song →
POST /songs/<song_id>/rate→routes/songs.py→notification_service.rate_song() - A user views a playlist →
GET /playlists/<id>/songs→routes/playlists.py→playlist_service.get_playlist_songs()
Understanding the full call chain is part of the exercise — don't skip to the service file directly.
Create a branch named bugfix/mixtape for your fixes. Each bug fix should be its own commit using conventional format:
fix: correct Sunday boundary condition in streak reset logic
See the project brief for full submission requirements.