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.
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
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
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
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.
Eslint is used for linting.
./.eslintrc.yml # config
./.eslintignore # ignore file
Eslint config should not be overridden in any packages.
Prettier is used for formatting.
./.prettierrc.yml # config
./.prettierignore # ignore file
Prettier config should not be overridden in any packages.
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.
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
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.
We use Github actions to manage our CI pipeline.
The workflows can be found in .github/workflows
TODO
TODO
TODO
TODO
@cairinmichie @kincaidoneil @matdehaast @sentientwaffle @sharafian @wilsonianb