Skip to content

An open-source, comprehensive Interledger service for wallet providers, enabling them to provide Interledger functionality to their users.

License

Notifications You must be signed in to change notification settings

stronghold-nine/rafiki

 
 

Repository files navigation

Rafiki

Table of Contents

  1. What is Rafiki?
  2. Getting Started
    1. Workspaces
      1. How to share scripts between workspaces?
    2. Code quality
      1. Linting
      2. Formatting
      3. Testing
      4. Commit hooks
      5. Language
      6. CI
  3. Packages
    1. Accounts
    2. Backend
    3. Connector
    4. Frontend
  4. Owners

What is Rafiki?

rafiki

Rafiki is an open source package that exposes a comprehensive set of Interledger APIs. It's intended to be run by wallet providers, allowing them to offer Interledger functionality to their users.

Rafiki is made up of several components including an Interledger connector, a high-throughput accounting database, and an API which can be accessed directly by users to implement Interledger applications.

Rafiki also allows for delegated access, offering OAuth-based flows to grant third-party applications access to Interledger functionality on a user's account.

Getting Started

This project uses yarn 2. We use zero-installs which means you won't need to install dependencies when you clone the repo. This does have security implications that are fairly easy to mitigate.

DO NOT use npm install, this will cause the project to spontaneously self-destruct.

git clone [email protected]:coilhq/rafiki.git

# Build dependencies with install scripts
yarn install --immutable --immutable-cache

Workspaces

We use yarn workspaces to manage the monorepo. The workspace command should be used when you want to run yarn commands in specific workspaces:

# Run a command within the specified workspace.
yarn workspace <workspaceName> <commandName> ...

# Add a package (knex) to a single workspace(backend):
yarn workspace backend add knex

# Run build script on a single workspace(backend):
yarn workspace backend build

How to share scripts between workspaces?

Any script with a colon in its name (build:foo) can be called from any workspace. Additionally, $INIT_CWD will always point to the directory running the script.

We utilize this to write shared scripts once:

# Lint in the current workspace
cd packages/backend
yarn lint # runs yarn lint:local

# OR use the workspaces command
yarn workspace backend lint # runs yarn lint:local in the packages/backend directory

Code quality

All the code quality tools used in the project are installed and configured at the root. This allows for consistency across the monorepo. Allows new packages to be added with minimal configuration overhead.

We try not to put config files in workspaces, unless absolutely necessary.

Linting

Eslint is used for linting.

./.eslintrc.yml # config
./.eslintignore # ignore file

Eslint config should not be overridden in any packages.

Formatting

Prettier is used for formatting.

./.prettierrc.yml # config
./.prettierignore # ignore file

Prettier config should not be overridden in any packages.

Testing

Jest is used for testing.

./jest.config.js # config used to configure projects and run all tests
./jest.config.base.js # (base jest config, imported by other packages)
./packages/*/jest.config.js # jest config file for package * (extends base.config.base.js)

Jest config at the root is intended to be a base config that should be extended by each package to suit the package's testing requirements.

Commit hooks

Husky provides git hooks.

./.husky/commit-msg # linting commit messages
./.husky/pre-commit # perform functions before committing

Commitlint is used for linting commit messages so that they conform to conventional commits.

./commitlint.config.js # config

Lint-staged is used for linting and formatting staged files on commit.

./.lintstagedrc.yml # config

https://commitlint.js.org

Language

Typescript is the chosen language.

./tsconfig.json # config

Typescript config at the root is intended to be a base config that should be extended by each package to suit the package's requirements.

CI

We use Github actions to manage our CI pipeline.

The workflows can be found in .github/workflows


Packages

Accounts

TODO

Backend

TODO

Connector

TODO

Frontend

TODO


Owners

@cairinmichie @kincaidoneil @matdehaast @sentientwaffle @sharafian @wilsonianb

About

An open-source, comprehensive Interledger service for wallet providers, enabling them to provide Interledger functionality to their users.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 96.9%
  • JavaScript 2.9%
  • Shell 0.2%