Welcome to the Music Streaming API, a robust backend system designed for a seamless music streaming experience. This API empowers users to search, stream, create playlists, and discover new music, complete with personalized recommendations and playback history.
- Register: Create an account with a username, email, and password.
- Login: Secure authentication using JWT.
- Profile Management: Update profile details such as bio and profile picture.
- Endpoints:
- POST
/api/auth/signup
: Register a user. - POST
/api/auth/login
: Authenticate a user. - GET
/api/profile/{username}
: Retrieve user profile details. - PUT
/api/profile/{username}
: Update user profile details.
- POST
- Endpoints:
- Stream Songs: High-quality audio streaming with chunked transfer encoding.
- Search Songs: Find songs by title, artist, album, or genre.
- Retrieve Songs: Fetch song details by ID.
- Endpoints:
- GET
/api/songs
: Retrieve all songs. - GET
/api/songs/search?queryParam=value
: Search for songs. - GET
/api/songs/{id}
: Fetch details of a specific song.
- GET
- Endpoints:
- Create Playlists: Organize your favorite songs into playlists.
- Add Songs to Playlist: Add songs to an existing playlist.
- Shuffle Playlists: Shuffle songs within a playlist.
- Endpoints:
- POST
/api/playlists/create
: Create a new playlist. - POST
/api/playlists/{playlistId}/addSong
: Add a song to a playlist. - GET
/api/playlists/user/{username}
: Fetch playlists by user. - GET
/api/playlists/{playlistId}/shuffle
: Shuffle songs in a playlist.
- POST
- Endpoints:
- Recommendations: Personalized song recommendations based on:
- Playback history.
- Genre preferences.
- Follow Artists: Stay updated with your favorite artists.
- Endpoints:
- GET
/api/discover/recommend/genre
: Get recommendations by genre. - GET
/api/discover/recommend/user/{username}
: User-specific recommendations. - POST
/api/discover/followArtist
: Follow an artist. - GET
/api/discover/recommendations
: Fetch recommendations based on playback history.
- GET
- Endpoints:
- Stream Songs: Play songs in real time with play, pause, skip, and repeat functionalities.
- Playback History: Track and retrieve songs you’ve listened to.
- Endpoints:
- GET
/api/stream/play/{songId}
: Stream a song. - GET
/api/playback-history
: Retrieve playback history.
- GET
- Endpoints:
- We’ve included a detailed Postman Test Suite to help you test all the API features seamlessly.
- Java with Spring Boot for backend development.
- MySQL/PostgreSQL for database management.
- JWT for secure authentication.
- Postman for API testing.
- Java 17+
- Maven/Gradle
- MySQL/PostgreSQL
- Postman (optional)
-
Clone the repository:
git clone https://github.com/VinayHajare/Music-Streaming-API.git cd music-streaming-api
-
Configure the database in
application.properties
:spring.datasource.url=jdbc:mysql://localhost:3306/music_streaming_db spring.datasource.username=your-username spring.datasource.password=your-password
-
Build and run the project:
mvn spring-boot:run
-
Import the Postman Test Suite for testing.
- Use the Postman Test Suite for end-to-end API testing.
- Ensure all endpoints return the expected responses and data.
- Dockerize the application using a
Dockerfile
. - Deploy on platforms like:
- AWS ECS
- Heroku
- Azure App Services
- Configure environment variables for secure deployment.
This project is licensed under the MIT License. See the LICENSE file for details.