/ads-cms-backend

The Accenture Digital Signage Backend project

Primary LanguageJavaScript

Accenture Digital Signage Backend

Prerequisites

Getting started

git clone https://github.com/ismarslomic/ads-cms-backend.git
cd ads-cms-backend
heroku login // only first time
git clone git@heroku.com:ads-cms-backend.git distHeroku
npm install
grunt build:heroku
cd distHeroku
node server

You should be able to test REST API for the ADS CMS Backend. Open a web browser and go to http://localhost:5000/api/player

Grunt tasks

All of these tasks should be ran from the root folder of the project.

  • grunt build:heroku - builds and optimization of the code in app folder. Destination folder is distHeroku
  • grunt deploy:heroku - build and deploy of distHeroku folder to Heroku application ads-cms-frontend
  • grunt run:heroku - scales the Heroku application to 1 dyno and runs it in the web browser
  • grunt stop:heroku - scales the Heroku application down to 0 dyno and stops the application

API

Tip: use Chrome Rest Console to test the REST API.

HTTP Action Route Description
GET /api/player Read all MPs
GET /api/player/:id Read Media Player by ID
PUT /api/player/:id Update existing Media Player by ID
POST /api/player Create new Media Player
DELETE /api/player/:id Delete existing Media Player by ID

Information Model

Media Player

    name: {
    type: String,
    trim: true
    },
    ip: String,
    location: {
       floor: {
           type: Number,
           min: 2,
           max: 4
       },
       zone: {
           type: String,
           default: 'external'
       }
    },
    isActive: {
       type: Boolean,
       default: false
    },
    created: {
       type: Date,
       default: Date.now
    },
    updated: {
       type: Date,
       default: Date.now
    }
          

Example

[
      {
       "name": "Ruby",
       "ip": "127.0.0.100",
       "_id": "5240cef5b17cf20200000001",
       "__v": 0,
       "updated": "2013-09-23T23:29:57.541Z",
       "created": "2013-09-23T23:29:57.540Z",
       "isActive": true,
       "location": {
           "floor": 2,
           "zone": "external"
       }
      },
      {
       "name": "Scala",
       "ip": "127.0.0.101",
       "_id": "5240cef5b17cf20200000002",
       "__v": 0,
       "updated": "2013-09-23T23:29:57.546Z",
       "created": "2013-09-23T23:29:57.546Z",
       "isActive": true,
       "location": {
           "floor": 2,
           "zone": "external"
       }
      }
]

Frontend

Heroku