OpenBeats is an open source Music streamer.
- 18th July 2020 - Logging in all services serialized.
- 18th July 2020 - Completely migrated openbeats from DigitalOcean(k8s) to AWS(docker-compose reverse proxy configurations).
- 17th July 2020 - development made easy with the comman docker-compose up in the docker-compose/development directory.
- 17th July 2020 - Now you can completely spin developement of entire service locally using docker-compose/development mode.
- 17th July 2020 - production and development configuration done using docker-compose - separate nginx-reverse proxies (development made easy).
- 14th July 2020 - converted from Microservice architecture to Monolithic with docker-compose.
- microservices architecture
- monorepo implementation
- Kubernetes deployment
- custom domain with multi subdomain ingress controller for kubernetes services
Auth
Register
method: post,
bodyType: JSON
JSON-Structure:
{
"name": "name",
"email": "email@email.com",
"password": "password"
}
Login
method: post,
bodyType: JSON
JSON-Structure:
{
"email": "email@email.com",
"password": "password"
}
Forget Password
method: post,
bodyType: JSON
JSON-Structure:
{
"email": "email@email.com",
}
Reset Password
method: post,
bodyType: JSON
JSON-Structure:
{
"reset_password_token":"<reset_password_token>",
"password":"<new_password>"
}
User Playlist Endpoints
Create empty playlist
method: POST
bodyType: JSON
structure:
{
"name": "playlistname",
"userId": "user_id_get_from_auth"
}
Add songs to playlist
method: POST
bodyType: JSON
structure:
{
"playlistId": "5e23496773d1d7231c86c05c",
"songs":[
<Array of songs - get from ytcat search result>
]
}
songs structure sample :=
{
"title": "Ed Sheeran - Shape of You [Official Video]",
"thumbnail": "https://i.ytimg.com/vi/JGwWNGJdvx8/hqdefault.jpg?sqp=-oaymwEjCPYBEIoBSFryq4qpAxUIARUAAAAAGAElAADIQj0AgKJDeAE=&rs=AOn4CLBDr2laWVr1FOfo6vsZFHCQVOlH5w",
"duration": "4:24",
"videoId": "JGwWNGJdvx8",
"channelName": "Ed Sheeran",
"channelId": "/channel/UC0C-w0YjGpqDXGB8IHb662A",
"uploadedOn": "2 years ago4,577,461,044 views",
"views": "4,577,461,044 views",
"description": "Tickets for the Divide tour here - http://www.edsheeran.com/tourStream or Download Shape Of You: https://atlanti.cr/2singles ..."
}
Get All playlist metadata
https://api.openbeats.live/playlist/userplaylist/getallplaylistmetadata/<-USER-ID-GET-FROM-AUTH>
method: GET
param: user id (get from auth)
Get songs from playlist
https://api.openbeats.live/playlist/userplaylist/getplaylist/<-PLAYLIST-ID-GET-FROM-PLAYLIST-METADATA>
method: GET
param: playlist id (get from playlist metadata endpoint *previous endpoint*)
Change name of the playlist
method: POST
bodyType: JSON
structure:
{
"playlistId": "<GET-FROM-PLAYLIST-ENDPOINT>",
"name": "<NEW-NAME-FOR-PLAYLIST>"
}
Delete song from playlist
method: POST
bodyType: JSON
structure:
{
"playlistId": "<GET-FROM-PLAYLIST-ENDPOINT>",
"songId": "<GET-FROM-PLAYLIST-ENDPOINT>"
}
Delete Entire playlist
https://api.openbeats.live/playlist/userplaylist/delete/<-PLAYLIST-ID->
method: GET
param: playlist id ( get from playlist metadata endpoint or playlist endpoint *userPlaylist* )
Opencc
https://api.openbeats.live/opencc/<-audio-id->
fallback
https://api.openbeats.live/fallback/<-audio-id->
downcc
https://api.openbeats.live/downcc/<-audio-id->?title=<-song-title->
**song-title**(query param)
due to redis integration , only stream url can be fetchef from redis
title can't be fetched, so send title in query to give user meaningful downloaded file.
**note:**
song-title should be uriencoded before appending it to query param to avoid spacing conflicts.
ytcat
https://api.openbeats.live/ytcat?q=<-search-query->
suggester
https://api.openbeats.live/suggester?k=<-keyword->
TopCharts
Get all charts metadata
method: GET
Get chart Songs
https://api.openbeats.live/playlist/topcharts/<-CHART-ID->
method: GET
params: CHART-ID can be obtained from top charts metadata.
Recently Played
Get recently played for logged in user
method: Get
Album Endpoints
Create an album
method: POST
bodyType: JSON
structure:
{
"name": "<NAME-OF-AN-ALBUM>",
"userId": "<CAPTAINAPP-LOGINED-USER-ID>",
"songs": "<ARRAY-OF-SONG-OBJECT>"
"searchTags": "<ARRAY-OF-SEARCH-TAG-ID>",
"featuringArtists": "<ARRAY-OF-FEATURING-ARTIST-TAG-ID>",
"albumBy": "<ARTIST-ID>"(If album is specific to a particular Artist),
}
Get All album
https://api.openbeats.live/playlist/album/all?type=<-album-fetch-type-here->&page=<-page-no->&limit=<-album-size-limit->
method: Get
query param: page, limit (necessary => ex:- page=1&limit=10)
query param: 'type' => popular or latest (if type param is not added fetch will done basis on default configurations)
Get All album by search tag
https://api.openbeats.live/playlist/album/findbysearchtag/:searchtag
method: Get
Route params: searchtag
Get specific album
method: Get
Route params: <ALBUM-ID>
query params: edit=true(If called for update will populate searchTag and featuring artist and also album by)
Update an album
method: PUT
Route params: <ALBUM-ID>
bodyType: JSON
structure:
{
"name": "<NAME-OF-AN-ALBUM>",
"userId": "<CAPTAINAPP-LOGINED-USER-ID>",
"songs": "<ARRAY-OF-SONG-OBJECT>"
"searchTags": "<ARRAY-OF-SEARCH-TAG-ID>",
"featuringArtists": "<ARRAY-OF-FEATURING-ARTIST-TAG-ID>",
"albumBy": "<ARTIST-ID>"(If album is specific to a particular Artist),
}
delete album
method: DELETE
Route params: <ALBUM-ID>
Artist Endpoints
Create an artist
method: POST
bodyType: JSON
structure:
{
"name": "<NAME-OF-AN-ARTIST>",
"thumbnail": "<IMAGE-URL-OF-ARTIST>"
}
Fetch an artist by artistId or startsWith(return 10 docs only)
method: GET
query param: tagId or startsWith(string case insensitive)
Get All artist
https://api.openbeats.live/playlist/artist/all?type=<-artists-fetch-type-here->&page=<-page-no->&limit=<-artists-size-limit->
method: Get
query param: page and limit (necessary params)
query param: 'type' => popular or latest (if type param is not added fetch will done basis on default configurations)
Update an artist
method: PUT
Route params: <ARTIST-ID>
bodyType: JSON
structure:
{
"name": "<NAME-OF-AN-ARTIST>",
"thumbnail": "<IMAGE-URL-OF-ARTIST>
}
delete artist
method: DELETE
Route params: <ARTIST-ID>
Album releases by an artist
https://api.openbeats.live/playlist/artist/<:id>/releases
method: GET
Route params: <ARTIST-ID>
Album featuring by an artist
https://api.openbeats.live/playlist/artist/<:id>/featuring
method: GET
Route params: <ARTIST-ID>
SearchTag Endpoints
Create an SearchTag
method: POST
bodyType: JSON
structure:
{
"searchVal": "<VALUE-OR-KEYWORD-TO-SEARCH>",
}
Get all SearchTag
method: GET
query param: page and limit
Fetch seaechtag by seaechtagID or startsWith(return 10 docs only)
method: GET
query param: searchId or startsWith(string-case insensitive)
Update an searchtag
method: PUT
Route params: <ARTIST-ID>
bodyType: JSON
structure:
{
"searchVal": "<VALUE-OR-KEYWORD-TO-SEARCH>"
}
delete searchtag
method: DELETE
Route params: <ARTIST-ID>
Mycollections Endpoints
Add an Album to the user collection
method: POST
bodyType: JSON
structure:
{
"userId": "<USER-ID>",
"albumId": "<ALBUM-ID>",
}
Get all The Albums in the Collections
https://api.openbeats.live/auth/metadata/mycollections(?meatadata=true)
method: GET
header: "x-auth-token: user-auth-token" (mandatory)
queryParams: ?meatadata=true => for only getting albums Ids without population
Remove an Album from the Collections
method: DELETE
bodyType: JSON
structure:
{
"userId": "<USER-ID>",
"albumId": "<ALBUM-ID>",
}