GithubHelp home page GithubHelp logo

soundem-api's Introduction

soundem-api Deploy

Running Locally

Install requirements

$ pip install -r requirements.txt

Create .env

Create a .env in the root of the project based on sample.env.

Populate database with sample fixture

$ python manage.py populate_db

Run development server

$ python manage.py runserver

Endpoints

Deployed to https://soundem-api.herokuapp.com

POST /api/v1/register

Request

{
  "email": "[email protected]",
  "password": "abc123"
}

Response

{
  "user": {
    "email": "[email protected]",
    "id": 1,
    "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6MX0.G01VbljXYZa-Cfd-HveE4U0mHGFLrgo36M838S3K5RE"
  }
}

POST /api/v1/login

Request

{
  "email": "[email protected]",
  "password": "abc123"
}

Response

{
  "user": {
    "email": "[email protected]",
    "id": 1,
    "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6MX0.G01VbljXYZa-Cfd-HveE4U0mHGFLrgo36M838S3K5RE"
  }
}

GET /api/v1/artists

Response

{
  "artists": [
    {
      "albums": [
        1
      ],
      "bio": "",
      "id": 1,
      "name": "Lana del Rey"
    },
    {
      "albums": [
        2
      ],
      "bio": "",
      "id": 2,
      "name": "AJ Davila"
    }
  ]
}

GET /api/v1/albums

Response

{
  "albums": [
    {
      "id": 1,
      "name": "Ultraviolence",
      "songs": [
        1,
        2,
        3
      ]
    },
    {
      "id": 2,
      "name": "Terror Amor",
      "songs": [
        4,
        5
      ]
    }
  ]
}

GET /api/v1/songs

Response

{
  "songs": [
    {
      "album": 1,
      "favorite": false,
      "id": 1,
      "name": "Pretty When You Cry"
    },
    {
      "album": 1,
      "favorite": false,
      "id": 2,
      "name": "Money Power Glory"
    },
    {
      "album": 1,
      "favorite": false,
      "id": 3,
      "name": "West Coast"
    },
    {
      "album": 2,
      "favorite": false,
      "id": 4,
      "name": "Animal"
    },
    {
      "album": 2,
      "favorite": false,
      "id": 5,
      "name": "Dura Como Piedra"
    }
  ]
}

PUT /api/v1/songs/:id/favorite

Response

{
  "song": {
    "album": 1,
    "favorite": true,
    "id": 1,
    "name": "Pretty When You Cry"
  }
}

soundem-api's People

Contributors

jpadilla avatar gcollazo avatar

Watchers

James Cloos avatar Marcos A. López Cruz avatar

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.