A CS 309 Project by Team
3_swarna_1
Music Social Platform is a collaborative music discovery and rating application that allows users to rate songs, create group playlists, chat with friends, and discover new music through integration with the Deezer API. Think Spotify meets social media – where music becomes a shared experience.
The app includes:
- Song rating system (1-5 stars) with real-time updates via WebSockets
- Friend management and private messaging
- Group playlist creation and collaboration
- Music trivia games
- Profile customization
- Deezer API integration for song discovery
- ✅ Rate songs and see real-time average ratings update
- ✅ Search for songs by title or artist
- ✅ Add songs to personal favorites
- ✅ View top-rated and randomly selected songs
- ✅ Create and join group playlists with friends
- ✅ Real-time chat with friends
- ✅ Play music trivia games (from OpenTDB API)
- ✅ Customize profile with bio and background color
- ✅ Live rating updates when users rate songs
- ✅ Instant messaging between friends
- ✅ Real-time song list updates for all connected users
- ✅ Deezer API – Fetch songs, charts, and random tracks
- ✅ OpenTDB API – Generate music trivia questions
| Controller | Purpose | Key Endpoints |
|---|---|---|
| SongController | Manage songs, Deezer integration | /songs, /songs/fetch-charts, /songs/search |
| RatingController | Handle song ratings | /ratings/rate, /ratings/{songId}/average |
| SongSocket | Real-time rating updates | WebSocket: /rate/{email} |
| RatingSocket | Per-song rating WebSocket | WebSocket: /rate/{email}/{songId} |
| ChatSocket | Real-time messaging | WebSocket: /chat/{email}/{friendEmail} |
| FriendController | Manage friendships | /users/{userId}/addFriend, /users/{userId}/friends |
| GroupPlaylistController | Collaborative playlists | /users/{userId}/playlists, /playlists/{id}/songs |
| ProfileController | User profiles | /users/{userId}/profile/bio, /users/{userId}/profile/color |
| FavoritesController | Personal song collections | /users/{userId}/favorites |
| TriviaController | Music trivia games | /trivia/generate, /trivia/{id}/submit |
- User – User accounts and authentication
- Song – Music tracks with ratings
- Rating – User ratings for songs
- Friend – Friend relationships between users
- Message – Chat messages between friends
- GroupPlaylist – Collaborative playlists with multiple users
- Favorites – User's favorite songs collection
- Trivia – Generated trivia games with questions and answers
- Profile – User profiles with bio and customization
| Layer | Tech Used |
|---|---|
| Backend Framework | Spring Boot (Java) |
| Real-Time Communication | WebSockets (Jakarta EE) |
| Database | JPA / Hibernate (configurable) |
| API Documentation | Swagger / OpenAPI 3 |
| External APIs | Deezer API, OpenTDB API |
| Build Tool | Maven |
| Version Control | Git & GitLab |
- User signs up and creates a profile with bio and color preference
- Discovers music through:
- Deezer charts (fetched hourly)
- Random song suggestions
- Search by title/artist
- Rates songs (1-5 stars) – ratings update in real-time for all users
- Adds friends by email – mutual acceptance required
- Creates group playlists with friends and collaboratively adds songs
- Chats with friends in real-time
- Plays trivia games – 5 music questions per game
- Saves favorites for quick access to preferred songs
GET /songs– Get all songsGET /songs/top-rated– Get top-rated songsGET /songs/random– Get random songsGET /songs/search?query=– Search songsPOST /songs– Create new songPOST /songs/fetch-random– Fetch random songs from DeezerPOST /songs/fetch-charts– Fetch Deezer chartsPOST /songs/fetch-from-deezer/{deezerTrackId}– Fetch specific song from DeezerGET /songs/fetch/{deezerTrackId}– Get song by Deezer IDDELETE /songs/{songId}– Delete song
POST /ratings/rate?songId=&userEmail=&rating=– Rate a songGET /ratings/{songId}/average– Get average rating
POST /users/{userId}/addFriend– Send friend requestGET /users/{userId}/friends– Get friends listPUT /users/{userId}/friends/email/{friendEmail}– Update friendDELETE /users/{userId}/friends/{friendEmail}– Remove friend
POST /users/{userId}/playlists– Create playlistGET /users/{userId}/playlists/myPlaylists– Get user's playlistsPUT /users/{userId}/playlists/{playlistId}/updateName– Update playlist namePOST /users/{userId}/playlists/{playlistId}/addUser– Add user to playlistGET /playlists– Get all playlistsGET /users/{userId}/playlists/{playlistId}/users– Get users in playlistGET /users/{userId}/playlists/{playlistId}/songs– Get songs in playlistGET /users/{userId}/playlists/{playlistId}– Get playlist detailsPOST /users/{userId}/playlists/{playlistId}/songs/{songId}– Add song to playlistDELETE /users/{userId}/playlists/{playlistId}/songs/{songId}– Remove song from playlistDELETE /users/{userId}/playlists/{playlistId}/remove– Leave playlist
GET /profiles/users/{userId}/friendCount– Get friend countGET /users/{userId}/profile/bio– Get bioPOST /users/{userId}/profile/bio– Create bioPUT /users/{userId}/profile/bio– Update bioDELETE /users/{userId}/profile/bio– Delete bioGET /users/{userId}/profile/color– Get background colorPUT /users/{userId}/profile/color– Update background color
GET /users/{userId}/favorites– Get favoritesPOST /users/{userId}/favorites/songs/{songId}– Add to favoritesDELETE /users/{userId}/favorites/songs/{songId}– Remove from favorites
POST /trivia/generate– Generate trivia gamePUT /trivia/{id}/submit– Submit answersGET /trivia/{id}– Get trivia by IDGET /trivia/fetch– Get all triviaDELETE /trivia/{id}– Delete trivia
GET /messages?email=&friendEmail=– Get chat history between users
| Endpoint | Purpose | Message Format |
|---|---|---|
ws://server/rate/{email} |
Receive real-time song rating updates | Server sends: {"id":1,"title":"Song","artist":"Artist","rating":4.5,"cover":"url"} |
ws://server/rate/{email}/{songId} |
Get updates for specific song | Client sends: {"rating":5}Server sends rating updates |
ws://server/chat/{email}/{friendEmail} |
Real-time messaging between friends | Client sends plain text Server sends: sender@email.com [HH:mm:ss]: message |
Base URL: http://localhost:8080
# Get all songs
curl http://localhost:8080/songs
# Rate a song
curl -X POST "http://localhost:8080/ratings/rate?songId=1&userEmail=test@example.com&rating=5"
# Fetch Deezer charts
curl -X POST http://localhost:8080/songs/fetch-charts
# Search for songs
curl "http://localhost:8080/songs/search?query=love"
# Create a playlist
curl -X POST http://localhost:8080/users/1/playlists \
-H "Content-Type: application/json" \
-d '{"name":"My Playlist","users":["friend@example.com"]}'
# Generate trivia
curl -X POST http://localhost:8080/trivia/generate
# Submit trivia answers
curl -X PUT http://localhost:8080/trivia/1/submit \
-H "Content-Type: application/json" \
-d '["Answer 1","Answer 2","Answer 3","Answer 4","Answer 5"]'
# Add song to favorites
curl -X POST http://localhost:8080/users/1/favorites/songs/1
# Update profile color
curl -X PUT http://localhost:8080/users/1/profile/color \
-H "Content-Type: application/json" \
-d '{"backgroundColor":"FF5733"}'
# Send friend request
curl -X POST http://localhost:8080/users/1/addFriend \
-H "Content-Type: application/json" \
-d '{"friendEmail":"friend@example.com"}'
# Get chat history
curl "http://localhost:8080/messages?email=user@example.com&friendEmail=friend@example.com"