Sing me a song is API to post songs from youtube and get random or top songs recommendations ranked by 'points'. It is also possible to Upvote or Downvote a song.
Response is 70% a random song recommendation above 10 in points and 30% a random song. Response example:
[
{
"id": 8,
"name": "Bon Jovi - Livin' On A Prayer",
"ytblink": "https://www.youtube.com/watch?v=lDK9QqIzhwk",
"points": 12
}
]
Response is the top amount recommendations ranked by points. Response example for amount = 3:
[
{
"id": 8,
"name": "Bon Jovi - Livin' On A Prayer",
"ytblink": "https://www.youtube.com/watch?v=lDK9QqIzhwk",
"points": 12
},
{
"id": 9,
"name": "Three Days Grace - Pain",
"ytblink": "https://www.youtube.com/watch?v=Ud4HuAzHEUc",
"points": 10
},
{
"id": 10,
"name": "Breaking The Habit - Linkin Park",
"ytblink": "https://www.youtube.com/watch?v=v2H4l9RpkwM",
"points": 8
}
]
Requires a body like:
{
"name": "Bon Jovi - Livin' On A Prayer",
"youtubeLink": "https://www.youtube.com/watch?v=lDK9QqIzhwk"
}
Response is the data of the posted body. Response example:
[
{
"id": 8,
"name": "Bon Jovi - Livin' On A Prayer",
"ytblink": "https://www.youtube.com/watch?v=lDK9QqIzhwk",
"points": 0
}
]
Increases the points of recommendation by 1.
Response is the data of the upvoted recommendation. Response example for id = 8:
[
{
"id": 8,
"name": "Bon Jovi - Livin' On A Prayer",
"ytblink": "https://www.youtube.com/watch?v=lDK9QqIzhwk",
"points": 1
}
]
Decreases the points of recommendation by 1. If a recommendation gets below -5 points, it is deleted from the DB
Response is the data of the downvoted recommendation (for deleted ones is 400 status code). Response example for id = 8:
[
{
"id": 8,
"name": "Bon Jovi - Livin' On A Prayer",
"ytblink": "https://www.youtube.com/watch?v=lDK9QqIzhwk",
"points": 0
}
]
The following tools were used in the construction of the project-api:
Server (NodeJS)
Utilities
- Editor: Visual Studio Code
- npm
- Clone this repository
https://github.com/pedrohotz/SingMeASongAPI.git
- Install the dependencies executing command
npm i
-
Create a .env file in folder (root) like the .env.example file and fill with your values.
-
Create a postgres database.
-
Run dump to populate DB.
- Start the API
npm run start
- To run Tests
npm run test
- Fork the project.
- Create a new branch with your changes:
git checkout -b feat/myFeatureName
- For each feature implemented, make a commit specifying what was done
- Submit your changes:
git push -u origin feat/myFeatureName
Developed by Pedro Hotz Bronzato.