# tetrapak-immersive-room-controller-service

> This is the main Room Controller Service for the Tetra Pak Immersive Room.

Latest version **1.2.0** (published 2019-10-22) · ISC license · 0 weekly downloads

## Install

```sh
npm install tetrapak-immersive-room-controller-service
pnpm add tetrapak-immersive-room-controller-service
yarn add tetrapak-immersive-room-controller-service
bun add tetrapak-immersive-room-controller-service
```

## Health

**Score 5/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: insecure dependencies; abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2019-10-22 |
| First published | 2019-10-22 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 10 |
| Unpacked size | 81.7 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | imagination |

## Links

- npm: https://www.npmjs.com/package/tetrapak-immersive-room-controller-service
- npm.io page: https://npm.io/package/tetrapak-immersive-room-controller-service

## Dependencies (10)

- [cors](https://npm.io/package/cors.md) ^2.8.4
- [raven](https://npm.io/package/raven.md) ^2.6.3
- [express](https://npm.io/package/express.md) ^4.16.3
- [request](https://npm.io/package/request.md) ^2.87.0
- [winston](https://npm.io/package/winston.md) ^3.0.0
- [deepmerge](https://npm.io/package/deepmerge.md) ^2.1.1
- [socket.io](https://npm.io/package/socket.io.md) ^2.1.1
- [body-parser](https://npm.io/package/body-parser.md) ^1.18.3
- [winston-daily-rotate-file](https://npm.io/package/winston-daily-rotate-file.md) ^3.3.1
- [tetrapak-immersive-room-controller-app](https://npm.io/package/tetrapak-immersive-room-controller-app.md) git+https://imagination-tetrapak:63y9VcN5nmBRkckfUpDP@bitbucket.org/imagination/tetrapak-immersive-room-controller-app.git

## Recent versions

- 1.2.0 (latest) — 2019-10-22

## README

# Intro

This is the main Room Controller Service for the Tetra Pak Immersive Room.

This service handles various functionality of the immersive room ecosystem e.g.

* XP Content Retrieval
* Inter-App Communication
* XPKit Integration
* State Management

## XP Content Retrieval

The Room Controller Service provides an API for retrieving content from the XPC CMS. The API provides various end points for retrieving the content e.g. journeys, polls and videos.

The end points (internally) will either retrieve data from a "live" provider or from "mocked up" data.

### API Endpoints

#### Content Endpoints

| What | Method | URL | Response |
| --- | ------- | --- | ------- |
| All Journeys | GET | `GET http://{address}:{port}/api/content/journey` | JSON |
| A Single Journey | GET | `GET http://{address}:{port}/api/content/journey/:id` | JSON |
| All Polls | GET | `GET http://{address}:{port}/api/content/poll` | JSON |
| A Single Poll | GET | `GET http://{address}:{port}/api/content/poll/:id` | JSON |
| All Videos | GET | `GET http://{address}:{port}/api/content/video` | JSON |
| A Single Video | GET | `GET http://{address}:{port}/api/content/video/:id` | JSON |

#### General Endpoints

| What | Method | URL | Response |
| --- | ------- | --- | ------- |
| Server Config | GET | `GET http://{address}:{port}/api/config` | JSON |


# Configuration

The service is controlled via the values set in the `config.json`.

The following sections exist in the config file...

## server

```
"server": {
    "port": 9080
},
```

| key | Details |
| --- | ------- |
| **port** | The port number that the available endpoints are accessed from |


## mockdata

```
"mockdata": {
  "enabled": true,
  "port": 9090,
  "baseURL": "http://localhost:9090"
}
```

| key | Details |
| --- | ------- |
| **enabled** | Denotes whether the content api should return mocked data otherwise the data will come from the xpc endpoint |
| **port** | The port number that the mock data service api will run from |

## xpc

```
"xpc": {
  "baseURL": "http://1.2.3.4"
}
```

| key | Details |
| --- | ------- |
| **baseURL** | The XPC Player API base endpoint. If the above `mockdata.enabled` if false, then the content will be retrieved from this `baseURL` endpoint. | 

# Deployment

The service runs within NodeJS and managed by PM2. See [Technical Spec Server Setup](https://docs.google.com/document/d/1somSaE41rsFA8ot0ttOD192cQZ5fTLEC8MckA6BMoU0/edit#heading=h.fq7d2j3wmrb2) for details.

---
_Source: https://npm.io/package/tetrapak-immersive-room-controller-service · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
