- Get the recommendations list
- Create a recommendation
- Upvote and Downvote any recommendation
- Remove a song when the score is lower than -5
- Get the top 10 list
- Get a random recommendation
POST /recommendations
Body | Type | Description |
---|---|---|
name |
string |
Required. |
youtubeLink |
string |
Required. must conform to youtube regex |
POST /recommendations/:id/upvote
Params | Type | Description |
---|---|---|
id |
integer |
Required. |
POST /recommendations/:id/downvote
Params | Type | Description |
---|---|---|
id |
integer |
Required. |
GET /recommendations
[
{
"id": 1,
"name": "Danny Don't You Know - NSP",
"youtubeLink": "https://www.youtube.com/watch?v=kT8cX2-_7pQ",
"score": 9
},
{
"id": 2,
"name": "Cool Patrol - NSP",
"youtubeLink": "https://www.youtube.com/watch?v=-tW0G9XWaj0",
"score": 10
},
{
"id": 3,
"name": "Thunder & Lightning - NSP",
"youtubeLink": "https://www.youtube.com/watch?v=-rSGoP5iGZQ",
"score": 13
}
]
GET /recommendations/:id
Params | Type | Description |
---|---|---|
id |
integer |
Required. |
id: 3
[
{
"id": 3,
"name": "Thunder & Lightning - NSP",
"youtubeLink": "https://www.youtube.com/watch?v=-rSGoP5iGZQ",
"score": 13
}
]
GET /recommendations/random
[
{
"id": 2,
"name": "Cool Patrol - NSP",
"youtubeLink": "https://www.youtube.com/watch?v=-tW0G9XWaj0",
"score": 10
}
]
GET /recommendations/top/:amount
Params | Type | Description |
---|---|---|
amount |
integer |
Required. |
amount: 3
[
{
"id": 3,
"name": "Thunder & Lightning - NSP",
"youtubeLink": "https://www.youtube.com/watch?v=-rSGoP5iGZQ",
"score": 13
},
{
"id": 2,
"name": "Cool Patrol - NSP",
"youtubeLink": "https://www.youtube.com/watch?v=-tW0G9XWaj0",
"score": 10
},
{
"id": 1,
"name": "Danny Don't You Know - NSP",
"youtubeLink": "https://www.youtube.com/watch?v=kT8cX2-_7pQ",
"score": 9
}
]
Clone the project
git clone https://github.com/DarlonGomes/sing-a-song-test
Go to the project directory
cd sing-a-song-test/
Go to the back-end directory
cd back-end
Install dependencies
npm install
Run prisma migrations
npx prisma migrate dev
Start the server
npm run start
Start Jest test
npm run test
Start E2E test
npm run E2E
Go to the front-end directory
cd front-end
Install dependencies
npm install
Start the server
npm start
Start Cypress - ( use E2E tests command in backend )
npx cypress open
- Jest: integration tests
- Jest: unit tests
- Jest: mock data
- Cypress: E2E tests
- Cypress: create a command
- Cypress: DOM elements
- Darlon Gomes is a student at Driven Education and is putting effort into switch careers. Nowadays he works with Fine Woodworking looking forward to become a Fullstack Dev.