streaming-api

3.0.0-alpha4 • Public • Published

Streaming API

The APIs supporting Ownzones Discover platform.

Essentially it serves two purposes:

  • Admin - API for managing VOD content for Connect admin web app.
  • Consumer - API for accessing VOD content for consumer apps.

The code is on GitHub (team-platform), tasks are tracked in Jira, discussion on Slack (#team-discover-ro and #team-platform-ro channels), and Grumpy tracks issues in progress and owners of test namespaces.

Deployment is done via kube-customer, we do CI with CircleCI, and servers are monitored using Papertrail, Sentry and Honeycomb.

Getting Started

  • Prerequisites:

    node@10.15
    elasticsearch@5.6
    postgresql@9.5
    redis
    
  • Clone the repository, install dependencies:

    git clone https://github.com/OwnZones/streaming-api
    cd streaming-api
    yarn install --frozen-lockfile
  • Create a config/local.ts file:

    export const config = {
      db: {
        username: '<your postgres username>',
        password: '<your postgres password>',
        database: '<your postgres database>',
        manageDatabase: true, // set `true` to generate initial db structure
      },
      cache: {
        enabled: true,
      },
      ses: {
        enabled: true,
      },
      swf: {
        decidersTaskListSuffix: 'streaming-api-decider-suffix',
      },
      mediaconvert: { // some tests and features will fail if this is not setup
        accountId: '', // ask team members for credentials
        iamRole: '',
        queueArn: '',
        region: '',
        accessKeyId: '', // ask @DevOps for credentials
        secretAccessKey: '',
      },
      search: {
        forceRefresh: true, // this is set only for tests
      },
      web: {
        admin: {
          mockAuthenticationEnabled: true, // override IAM authentication
        },
      },
    };
  • Start the project locally:

    NODE_ENV=local yarn run serve
  • Recreate the database structure:

    NODE_ENV=local bin/ts-node.sh dbInit.ts # `manageDatabase: true` in config

Test suite

Please write tests for new code. Your PR will probably be rejected otherwise. Tests run automatically on every git push in CircleCI and a Docker image is created and uploaded.

To run tests locally, you need the config file set up, then run:

NODE_ENV=local yarn test

To run a single test or suite, either run them directly from WebStorm, or run:

yarn install -g jest
NODE_ENV=local jest --runTestsByPath <path-to-test-suite> --verbose

Related projects

The Admin API lives behind graphql-gateway, which merges the schema with the schema from zypline-api (which handles admin actions for the Connect product) and iam-service (which handles user authentication). The Admin API is consumed by zypline-web.

The consumer Streaming API is used by the consumer applications:

Environments

streaming-api is deployed as part of the OwnZones platform on several test and production environments. All production and testing servers are deployed in Kubernetes clusters. See documentation in kube-customer for details. Scripts to help with accessing the servers are in the streaming-api-scripts repo.

devN

staging

demo

connect (aka production)

Environment variables

Environment Variables List

Readme

Keywords

none

Package Sidebar

Install

npm i streaming-api

Weekly Downloads

0

Version

3.0.0-alpha4

License

ISC

Unpacked Size

9.5 MB

Total Files

899

Last publish

Collaborators

  • theclaw37