Code Monkey home page Code Monkey logo

galoy-plugin-merchant's Introduction

galoy-plugin-merchant

This project contains two main projects:

  1. The graphql subgraph for the merchants data http://localhost:4003/graphql
  2. A frontend component that consumes the graphql data via the Supergraph http://localhost:4000/graphql using the apollo client
  me {
    phone
    merchants {
      address
      name
      acceptsBitcoin
    }
  }

This allow separations of concerns and for sub-components. The plugins can be developed independently of the Galoy core banking application.

This enables a plugin/extension and microservice architecure.

Image

Run the merchants subgraph

  1. make start
  2. This should start http://localhost:4003/graphql
  3. you can test this query
{
  merchants {
    id
    name
    address
    acceptsBitcoin
  }
}

Install the react-native component

Now we can install the component into galoy-mobile app.

  1. Add this to galoy-mobile/tsconfig.json (note that it's a relative link to the location you have the galoy-plugin-merchant code)

"paths": {

  "@app/*": ["app/*"],
  "react-native-galoy-merchant": ["../galoy-plugin-merchant/src/react-native-galoy-merchant/src"]

}

  1. Also add it to the package.json as a dependency
{

  "dependencies": {

    "react-native-galoy-merchant": "file:../galoy-plugin-merchant/src/react-native-galoy-merchant/src",

}

  1. Add this to the metro.config

extraNodeModules: {
  
  "react-native-galoy-merchant": path.resolve(__dirname, "../galoy-plugin-merchant/src/react-native-galoy-merchant/src")

}

  1. yarn install
  2. Live reload does not yet work (@todo) so run yarn upgrade react-native-galoy-merchant to reflect changes in the galoy-mobile app.

Usage

import { Merchants } from "react-native-galoy-merchant"

export const MerchantsComponenet = () => {
  return (
    <Merchants />
  )
}
<Merchants>

NPM Package

If you deploy to npm or yarn you can, for example, run yarn add react-native-galoy-merchant in your project.

Tooling

This was created using this templating tool: react-native-module-template. See docs here: https://github.com/demchenkoalex/react-native-module-template

galoy-plugin-merchant's People

Contributors

ntheile avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.