Git Product home page Git Product logo

sing-me-a-song's Introduction

Sing Me a Song

This is an application where you can post and get music recommendations. It has a scoring system so you can vote for your favorite songs.

Technologies

  • NodeJS
  • ExpressJS
  • nodemon
  • pg
  • dotenv
  • cors
  • Jest
  • prettier
  • eslint

Running locally

  1. Clone this repo
git clone https://github.com/Deltinha/sing-me-a-song.git
  1. Install dependencies
npm install
  1. Navigate to the repository folder and run the following commands to create a database
sudo -u postgres createdb -T template0 sing_me_a_song

sudo -u postgres psql sing_me_a_song < 'dump.sql'
  1. Create a new file called .env in the root folder using .env-example as template. Feed the newly created file with the info of your database.
  2. To run in development mode
npm run dev

Documentation

POST /recommendations

You can insert a recommendation by using this endpoint. The body contents should be a JSON object following the example below.

{
  "name": "Maroon 5 - Memories",
  "youtubeLink": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
}

POST /recommendations/:id/upvote

You can increase a recommendation's score using this endpoint.

POST /recommendations/:id/downvote

You can decrease a recommendation's score using this endpoint.

GET /recommendations/random

You can get a single random recommendation by using this endpoint.

{
	"id": 15,
	"name": "Olivia Rodrigo - good 4 u",
	"youtubeLink": "https://www.youtube.com/watch?v=Yb6dZ1IFlKc",
	"score": 25
}

GET /recommendations/top/:amount

You can get the top recommendations by using this endpoint.

[
	{
		"id": 10,
		"name": "Maroon 5 - Memories",
  		"youtubeLink": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
		"score": 32
	},
	{
		"id": 15,
		"name": "Olivia Rodrigo - good 4 u",
		"youtubeLink": "https://www.youtube.com/watch?v=Yb6dZ1IFlKc",
		"score": 25
	},
	...
]

sing-me-a-song's People

Contributors

deltinha avatar

Watchers

 avatar

Forkers

brunomguimaraes

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.