Giter Club home page Giter Club logo

swish's Introduction

Swish, video reimagined

Why?

Traditionally, online platforms have offered their services free of charge in exchange for running ads and collecting data. For the user, this model is inherently flawed. Since the user is not providing revenue, they are not the customer. In fact, since they themselves (their eyes) are the objects being sold, they are the product. This means that user needs are rarely met, as long as they keep viewing ads. Instead, priority is given to the businesses running ads, which resulted in the many policy controversies platforms like YouTube have had in recent years. What content is allowed, and how valuable content is, is determined solely by the customer: advertisers. This means that content is unfairly moderated and demonitized, even if users are eager to view it.

Swish is an answer to this business model. It seeks to reimagine the content platform as a service that facilitates an exchange of content between a viewer and a creator, not another way to sell eyes to advertisers.

How does it work?

Everyone pays a subscription fee (TBD, currently $3) every month. We take a small portion (TBD, currently $1) to pay for operating expenses. The rest is proportionally divided between the creators the user watches based on watch time.

What does this mean?

Support the creators you love even more

$2 out of the $3 monthly fee goes directly to the content creators you watch.

No ads, no privacy violations

We have no ads and no reason to collect data. To us, users are more than just eyes: they're customers.

Become the customer, not the product

Start being treated as a customer, not a product. Your voice matters, and decisions are made with only you and your opinions in mind.

Development

Development of Swish is divided into phases. Each phase has a minor semantic version associated with it. The final commit of each phase is tagged.

Phase 1 (v0.1.0)

This is the initial phase of Swish. A basic app was built and backed by a Firebase API. Most of what was developed here is intended to be replaced or updated.

Goals

  • Build basic mobile app and Firebase backend
  • Settle on transcoding, search, database, and compute solutions
    • Settled on Algolia for search, Mux for transcoding, Firestore for database, and Firebase for compute

Phase 2 (v0.2.0)

Difficulties with authentication and flexibility meant that a new backend had to be developed. A microservice architecture that ran on GKE was settled on. The mobile app needed to be updated and a web app needed be made.

Goals

  • Build new API
  • Update mobile app to use new API
  • Develop webapp
  • Finish basic CRUD functionality of the entire service

Phase 3 (v0.3.0)

Phase 3 brings time tracking. Video players send a request every second to the backend containing what second of the video a user just watched, called a segment. The backend then stores each segment in a Redis database.

Goals

  • Setup segment storage and processing
  • Add watch time tracking to web and mobile platforms

Phase 4 (v0.4.0)

Phase 4 brings payment. Payments are processed by Stripe. < More info as this gets closer >

Goals

  • Setup payment processing through Stripe
  • Send money to a channel's balance based on watch time

Phase 5 (v0.5.0)

Phase 5 brings YouTube integration. Swish allows users to search and view YT videos on the Swish platform. However, to avoid legal trouble, it'll use the standard YT embed. This means that ads will be shown, and data will be collected. Time tracking and payment allocation is still done on YT videos viewed through Swish. When a YT video is first viewed through Swish, a video record will be created for it and a channel record will be created for the channel it's apart of. Earnings through watch time will be allocated as usual to the channel. A YT creator would then be able to come to Swish, setup an account, link his or her google account with his or her Swish account, and finally link the original YT channel and the Swish channel. This serves as a way for Swish to verify this account as the true owner of the channel. The YT creator would then be able to claim any earnings they would have earned for the last month from their YT videos embedded in Swish. The linking process also imports all of the channels YT videos to Swish and marks any existing ones as true Swish videos, removing ads.

It's important to note that once a user links their YT channel to their Swish channel, they will be permanently unable to run YT videos on that linked Swish channel. This is to prevent creators from being able to make revenue off of both ads and watch time, which goes against Swish's core mission.

Goals

  • Add YT integration

swish's People

Contributors

dependabot[bot] avatar shetaye avatar

Watchers

 avatar

swish's Issues

Use a Secret Management solution

Swish talks to several services as of now (Mux, Algolia, GCS), and the number of tokens/keys/secrets it will have to keep track of will only grow as it's feature set grows. Passing secrets in as non-source-controlled environment variables worked fine for development, but a full Secrets Management solution should be implemented during the transition to K8 deployment.

(From GitLab)

Implement Auth

User authentication + authorization checks have to be implemented in the APIGatewayService. User authorization checks also have to be implemented in relevant services (VideoContentService, VideoDataService, etc.). This means that user auth information must be passed to subsequent services from APIGatewayService.
(From GitLab)

Standardize Unit Test Configuration

Some of the unit tests (in particular my first, the VideoDataService unit test) have a lot of hard coded values. Hard coded values are non-configurable, so those should all become variable values tied to one const declared at the beginning of the test.

(From GitLab)

Write Unit Test for uploadIcon

uploadIcon in ChannelContentService needs a unit test. It should test the uploading and piping activity.
(From GitLab)

Implement SearchService

The SearchService needs implementation. It needs to manage Algolia search index entries.
(From GitLab)

Add Resource Limits

Resources need limits. Users should only be able to have a set number of channels, channels should only be able to have a set number of videos, etc. Limits need to be implemented both as a hard check on the backend and a soft error on the client.

Counts that need limiting:

  1. Channel count (per user)
  2. Video count (per channel)
  3. Upload size (per video)
  4. Video duration (per video)
  5. Upload size (per channel icon)

(From GitLab)

Add log out button

Both mobile and web platforms need a log out button. The web app is more urgent.

Fix Random Webapp 401s

This is probably caused by the auth token expiring or getting cancelled, but I thought the auth module was supposed to handle both those cases.

Standardize Editor Configuration

Editor configuration files (VSCode, linting files, prettierr files, etc.) need to be configured in a standard way regarding JS/TS rules and indentation. All files should exist at a root level.
(From GitLab)

Add GA Support

Add support for Google Analytics in both the web and mobile apps

Write Tests for Errors

Errors need tests too! Services should be tested in a way to stimulate error responses and those errors should be validated as correct (Only the type and the fact it returns an error, actual error message details don't need to be tested).
(From GitLab)

Write Error Handling

The backend will need error handling code that goes beyond always returning a 500 and the Node error message.

Standard errors need to implemented for 404 Not Found, 400 Bad Request, and 500 Internal Server Error. Error handling should also be able to work with the chained nature of the services, nesting errors until reaching the API Gateway service, where it will be parsed into a client-readable form.
(From GitLab)

Cleanup Documentation

Documentation should not be split between TypeDoc and many README.MDs. What could be done is:

  • Consolidate all documentation into READMEs and remove TypeDoc annotations

or

  • Remove all the READMEs and move to untyped JSDoc annotations. If we're moving forward with annotations, it makes far more sense to use JSDoc for its much larger assortment of features rather than TypeDoc.

(From GitLab)

Add SEO to Web App

The web app needs to be accessible by crawlers. This means bypassing auth once a connecting client can be identified as a crawler, and serving them a stripped down web page meant for indexing.

Write CI/CD Pipeline

A Gitlab CI/CD pipeline configuration file is needed. This also means a CI/CD pipeline needs to be designed.
(From GitLab)

Full API Integration Test

The API needs a full integration test. The DB, Algolia index, GCS Bucket, and Mux Asset List need to be cleared. Once everything is cleared, all API endpoints should be individually tested and checked off as working as expected. The following needs testing:

  1. Expected non-error functionality
  2. Authorization bounds (401s)
  3. Error states (404s)
    (From GitLab)

Create Seperate Dev and Prod environments

The Swish backend (and later frontend) will require a logical (or virtual) separation between production data. To do so, all services used must be namespaced into separate environments.

Algolia: Algolia supports separate indices. One index will be made for each environment, and upon startup, the application will specify a different index ID depending on the loaded environment.

  • 2 indices: dev_swish, prod_swish

Mux: Mux supports separate "environments". Mux environments act as separate namespaces for all their video resources. One Mux environment will be made for each environment, and upon startup, the application will choose the correct API credentials depending on the loaded environment. This also means there will be different webhook secrets, so 2 event pipelines are needed.

  • 2 environments: Development, Production
  • 2 google functions: dev-muxWebhookPortal, prod-muxWebhookPortal
  • 2 PubSub topics: dev-mux-events, prod-mux-events
  • 2 PubSub subscribers (1 for each topic): dev-swish-api, prod-swish-api

CDN: Google Cloud Storage has separate buckets. One bucket will be made for each environment, and upon startup, the application will choose the correct bucket ID depending on the loaded environment.

  • 2 buckets: dev-swish, prod-swish

Database: While Google Firestore does not support any native namespacing, I can create my own by prefixing. Collections will be prefixed so the application can choose where to look for resources depending on the execution environment.

  • 2 prefixes: dev, prod

(From GitLab)

Add Support for Channel Icons

Adding support for Channel icons includes buildup of ChannelContentService. At the moment it contains nothing but a markup file. It needs an implementation of the /uploadIcon endpoint. That endpoint needs corresponding code in the APIGatewayService. ChannelDataService also has to be updated, since channel schema will change with the addition of a new field for channel content.
(From GitLab)

Prevent unlimited uploads on one video

The API allows unlimited uploads to a single video. While this isn't possible using the UI, if someone were to RE the API they could rack up quite the bill for us.

Touchup Mobile UI

The mobile UI needs significant touchups before it's ready to be released.

Player:
The video player needs a complete redesign. A new video control popup and fullscreen are needed. Internal hooks ready for Phase 3 time tracking are necessary.

Loading:
Spinners need to be replaced with gray wireframes.

Zero states:
When the backend returns an empty response for a query, a proper zero-state message (Icon with a small piece of text) should be shown.

Error states:
When the backend service returns an error, an error message should be shown.

Tab bar:
The tab bar should be redesigned to look nicer.

(From GitLab)

Transition to Terraform

As Swish uses increasingly many services (GKE, GCS, Auth0, Redis, etc.), it's becoming more and more appealing to manage all these resources through an IaC service like Terraform.

Content Is Cloned

When uploading a video through the web UI, 2 Mux assets are created and 2 content records are created. Only one is attached to the video, so the other is left dangling. This is urgent as it uses double the resource (transcoding is one of the more resource heavy tasks)

Transition Mobile App to New API

The Mobile app needs to be transitioned to the new API. This means ripping out the old service code and replacing it with the direct equivalent. Some changes will have to happen relating to the video and channel queries (they are used to query their resources instead of a dedicated endpoint like what was being done with Firebase Functions). The upload for both videos and channel art must be moved to a service container. As of right now upload code is mostly stuck in the widget directly, which is undesirable.
(From GitLab)

Handle Mux Callback

This depends on the application test environment being accessible by Mux

Currently, Mux does not send us transcoding completion events. We should have a webhook that responds to such events and properly updates the DB (creates/updates the content records)
(From GitLab)

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.