All Projects → brave-intl → publishers

brave-intl / publishers

Licence: MPL-2.0 license
Publisher interface for Brave Payments

Programming Languages

ruby
36898 projects - #4 most used programming language
SCSS
7915 projects
javascript
184084 projects - #8 most used programming language
Slim
82 projects
typescript
32286 projects
HTML
75241 projects

Creators

Creators powers the https://creators.brave.com platform and enables content creators to be tipped from Brave users using the Brave Rewards system.

It allows a creator to connect channels where they are hosted content as well as a wallet through which we deposit auto-contribute suggestions.

The ledger for current creator balance is stored in bat-ledger, also known as eyeshade.

Creators is powered by Ruby on Rails and React.

Getting Started 🔧 Setup

Development with Docker and docker-compose is recommended for anyone just getting started. If for any reason you wish to run the stack locally see Local Installation Instructions. Creators has a complex set of interactions however and has another application (Eyeshade) as a core integration/service dependency that is most readily accessed via docker-compose.

Running locally with docker-compose

  1. install docker and docker compose.
  2. Ensure openssl is installed. brew install openssl
  3. In your browser, navigate to brave://flags. Make sure Allow invalid certificates for resources loaded from localhost. is enabled.
  4. Run make
  5. Create an admin user. make admin EMAIL="[email protected]"

If for any reason some step in the command chain breaks, simply review the Makefile and execute each command utilized by Makefile:defaultindividually.


The critical pieces

The advanced pieces

Gotchas

Feature Flags

When logging in as a creator, you may need to enable feature flags on that creator's account to be able to access the full set of UI options on the site. Feature flags are stored as a json object on the Publisher model. To update the flags for a user, run something like:

$ make docker-shell
$ rails c
$ p = Publisher.where(email: '[email protected]').first
$ p.update!({ feature_flags: {"gemini_enabled"=>true, "bitflyer_enabled"=>true, "promo_lockout_time"=>"2020-11-23", "referral_kyc_required"=>true}})

Macbook M1, Docker-compose, and Sorbet

We recommend both the usage of Sorbet for static analysis/linting as well as docker-compose for local development, however at the time of writing (3/21/22) the Sorbet binary is not available for Linux running on ARM processes (i.e. within docker-compose). There is an open issue and an incomplete PR that adds support for aarch64 systems. For now, linting/tests have been configured to run on every push to the remote so that developers can gain some of the benefit of static type analysis using sorbet.

We recommend continuing to develop using Sorbet type annotations and explicit types.

Gemfile

If however, you are developing on an M1 using docker-compose and find yourself in the position of needing to update a dependency/Gemfile, you are going to run into a wall. Several gems (including Sorbet) are installed conditionally based on the chipset of the device. Thus, your local development Gemfile will be different from what is run in CI/CD and Sorbet is required for builds. Unfortunately for the moment the only way to properly update the Gemfile is to either install locally or to use an device that is using an x86 chipset.

Errata

  • Legacy Docs - Preserved content that requires review/updates
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].