Coder Social home page Coder Social logo

ansor4 / exchange Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sepans/exchange

0.0 2.0 0.0 3.53 MB

Artsy Order Management

License: MIT License

Dockerfile 0.07% Ruby 99.40% HTML 0.02% Shell 0.31% TypeScript 0.12% JavaScript 0.01% SCSS 0.06% Jinja 0.01%

exchange's Introduction

Exchange CircleCI codecov

Exchange is responsible for the various types of e-commerce interactions available on the Artsy platform. It uses Ruby, Rails, Postgresql, and exposes a GraphQL API.

Meta

Setup and Start

  • Clone the project:

    $ git clone [email protected]:artsy/exchange.git
    
  • Read and/or run the setup script:

    cat ./bin/setup
    ./bin/setup
  • Run Procfile.dev via foreman to start the web (rails) and worker (sidekiq) services:

    foreman start -f Procfile.dev

Tests

Once setup, you can run the tests like this:

$ bundle exec rspec

Shared Configuration

Exchange uses shared configuration to distribute common and sensitive configuration values. The setup script will download .env.shared and also initialize .env (from .env.example). The .env file is for custom configuration and any overrides.

If a new sensitive (or common) environment variable needs to be added for development, remember to also update the shared configuraton in S3. Find update instructions here. This is only required when expanding shared development environment configuration.

Did You Change Models?

We use the PaperTrail gem to maintain a log of data changes to important models within the main relational database.

Analytics Notification

If you changed something in the /models make sure to inform #data (analytics) team about it in case it impacts their reports.

Did You Change GraphQL Schema?

Metaphysics is the current consumer of Exchange GraphQL schema and keeps a copy of latest schema in https://github.com/artsy/metaphysics/tree/master/src/data, if you have changed Exchange GraphQL schema, make sure you also update the copy of this schema in Metaphysics. In order to do so follow these steps:

  1. In exchange run
rake graphql:schema:idl
  1. rename schema.graphql file generated โ˜๐Ÿผ to exchange.graphql
mv schema.graphql exchange.graphql
  1. copy file above to your local update Metaphysics under src/data and make a PR to Metaphysics with this change.

There is a guide on how to add exchange operations to Metaphysics here

Talking to Exchange ๐Ÿค‘

In order to talk to Exchange GraphQL endpoint:

  • Run ./bin/setup.
  • Start local server ./bin/server.
  • If you work at Artsy, get proper Gravity User Token following these instructions (the client application name is "Exchange Staging").
  • Install and run GraphiQL app brew cask install graphiql.
  • In GraphiQL app, go to http://localhost:3000/api/graphql, you should ge unauthorized error.
  • Edit HTTP Headers and add Authorization header and set it to Bearer <token> where <token> is your Gravity token generated few steps above.

Working at Artsy?

GraphQL Queries

We share our GraphQL sample queries using Insomnia shared workspace. You can import latest queries from environments_and_requests.json

Get Access To Exchange

Access to Exchange Admin is limited to users with the role "Sales Admin". Ask someone with Role Manager permissions to grant your user "Sales Admin" permissions.

Debugging

Something went wrong? Ideally in the JSON response returned from Exchange there will be enough info to describe what went wrong. In case that was not useful, you can:

  1. Check Sentry (password in 1Pass) and look for Exchange (staging or production) and see the error.
  2. Follow exchange logs by doing
hokusai staging logs -f

If you think there is something we could improve in this error case, feel free to open an issue with details about what you did and what went wrong.

Rationale for Closed Source

This repo is closed source in order to avoid leaking potentially sensitive information about partnerships and new features through normal development.

exchange's People

Contributors

ansor4 avatar artsy-peril[bot] avatar ashfurrow avatar ashkan18 avatar dagmark avatar damassi avatar dependabot-preview[bot] avatar dleve123 avatar ds300 avatar eessex avatar erikdstock avatar iskounen avatar izakp avatar joeyaghion avatar jonallured avatar jpotts244 avatar kajatiger avatar leamotta avatar lilyfromseattle avatar mdole avatar orta avatar pepopowitz avatar peril-staging[bot] avatar renovate-bot avatar saolsen avatar sepans avatar starsirius avatar sweir27 avatar williardx avatar zephraph 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.