Skip to content

guilherme-brandao/crypto-vote-platform

Repository files navigation

Crypto Voting Platform

Live ranking system where the user can add cryptos, upvote your favorates and downvote the other ones.

Tech Used

  • Golang
  • MongoDB
  • gRPC

Endpoints

POST /crypto

Request

curl -XPOST http://ec2-54-89-58-88.compute-1.amazonaws.com:8080/crypto --header "Content-Type: application/json"  --data '{
    "name": "Ethereum",
}'

Response

{
  "id": "5fd6ac5c6884b412d6ec1475",
  "name": "Ethereum"
}

GET /crypto/:id

Request

curl http://ec2-54-89-58-88.compute-1.amazonaws.com:8080/crypto/6057708661402e9c75b80109

Response

{
  "id": "6057708661402e9c75b80109",
  "name": "Bitcoin",
  "upvotes": 3,
  "downvotes": 1,
  "score": 2
}

POST /upvote/:id

Request

curl -XPOST http://ec2-54-89-58-88.compute-1.amazonaws.com:8080/upvote/6057708661402e9c75b80109 

Response

{
  "success": true
}

POST /downvote/:id

Request

curl -XPOST http://ec2-54-89-58-88.compute-1.amazonaws.com:8080/downvote/6057708661402e9c75b80109 

Response

{
  "success": true
}

GET /cryptos

Request

curl http://ec2-54-89-58-88.compute-1.amazonaws.com:8080/cryptos

Response

{
  "id": "6057708661402e9c75b80109",
  "name": "Bitcoin",
  "upvotes": 2,
  "downvotes": 1,
  "score": 1
}{
    "id": "6057708f61402e9c75b8010a",
    "name": "Ethereum",
    "upvotes": 12,
    "downvotes": 2,
    "score": 10
}{
    "id": "6057709461402e9c75b8010b",
    "name": "Litcoin",
    "upvotes": 10,
    "downvotes": 1,
    "score": 9
}

DELETE /delete/:id

Request

curl http://ec2-54-89-58-88.compute-1.amazonaws.com:8080/delete/6057708661402e9c75b80109 

Response

{
  "success": true
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages