All Projects → artsy → Metaphysics

artsy / Metaphysics

Licence: mit
Artsy's GraphQL API

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Metaphysics

Next Shopify Storefront
🛍 A real-world Shopping Cart built with TypeScript, NextJS, React, Redux, Apollo Client, Shopify Storefront GraphQL API, ... and Material UI.
Stars: ✭ 317 (+3.93%)
Mutual labels:  graphql, expressjs
Next Apollo Auth
Authentication Boilerplate with Next.js and Apollo GraphQL
Stars: ✭ 159 (-47.87%)
Mutual labels:  graphql, expressjs
Fullstack Graphql
🌈 Simple Fullstack GraphQL Application. API built with Express + GraphQL + Sequelize (supports MySQL, Postgres, Sqlite and MSSQL). WebApp built with React + Redux to access the API. Written in ES6 using Babel + Webpack.
Stars: ✭ 955 (+213.11%)
Mutual labels:  graphql, expressjs
Express Graphql Typescript Boilerplate
A starter kit for building amazing GraphQL API's with TypeScript and express by @w3tecch
Stars: ✭ 163 (-46.56%)
Mutual labels:  graphql, expressjs
Production Ready Expressjs Server
Express.js server that implements production-ready error handling and logging following latest best practices.
Stars: ✭ 101 (-66.89%)
Mutual labels:  graphql, expressjs
Graphql Rest Proxy
Turn your REST API into GraphQL - A Proxy Server that pipes request from GraphQL to REST with GraphQL DSL, performant nested children, mutations, input types, and more.
Stars: ✭ 218 (-28.52%)
Mutual labels:  graphql, expressjs
Express Graphql Mongodb Boilerplate
A boilerplate for Node.js apps / GraphQL-API / Authentication from scratch - express, graphql - (graphql compose), mongodb (mongoose).
Stars: ✭ 288 (-5.57%)
Mutual labels:  graphql
Circleci Cli
Use CircleCI from the command line
Stars: ✭ 297 (-2.62%)
Mutual labels:  graphql
Rest Api Tutorial
This is a sample source code for the article published on Toptal: https://www.toptal.com/nodejs/secure-rest-api-in-nodejs
Stars: ✭ 288 (-5.57%)
Mutual labels:  expressjs
Googlekeepclone
A clone of Google Keep with its original Material Design aesthetics
Stars: ✭ 281 (-7.87%)
Mutual labels:  graphql
Nest Angular
NestJS, Angular 6, Server Side Rendering (Angular Universal), GraphQL, JWT (JSON Web Tokens) and Facebook/Twitter/Google Authentication, Mongoose, MongoDB, Webpack, TypeScript
Stars: ✭ 307 (+0.66%)
Mutual labels:  graphql
Github Wrapped
Take a look back at all the contributions you as an individual made to the open-source community
Stars: ✭ 304 (-0.33%)
Mutual labels:  graphql
Graphcms Examples
Example projects to help you get started with GraphCMS
Stars: ✭ 295 (-3.28%)
Mutual labels:  graphql
Graphql Wg
Working group notes for GraphQL
Stars: ✭ 291 (-4.59%)
Mutual labels:  graphql
Generator Express No Stress Typescript
🚄 A Yeoman generator for Express.js based 12-factor apps and apis using Typescript
Stars: ✭ 297 (-2.62%)
Mutual labels:  expressjs
Mern Social
A MERN stack based social media application [Full-Stack React Projects]
Stars: ✭ 288 (-5.57%)
Mutual labels:  expressjs
Graffiti
Minimalistic GraphQL framework
Stars: ✭ 306 (+0.33%)
Mutual labels:  graphql
Awesome Vue Graphql
A curated collection of resources, clients and tools that make working with `GraphQL and Vue.js` awesome
Stars: ✭ 289 (-5.25%)
Mutual labels:  graphql
Graphql Apis
📜 A collective list of public GraphQL APIs
Stars: ✭ 3,525 (+1055.74%)
Mutual labels:  graphql
Graphql Wp
GraphQL endpoint for WordPress
Stars: ✭ 303 (-0.66%)
Mutual labels:  graphql

Metaphysics

Metaphysics is a GraphQL-compliant API that wraps various Artsy APIs. You can try it here against our staging API.

It is built on express, express-graphql, and graphql. With graphiql providing a sandbox to work with.

It is currently used in production all over the place in Artsy.net, and the Artsy iOS App

Meta CircleCI codecov

Getting Setup

To get yourself set up with all the project's dependencies:

git clone https://github.com/artsy/metaphysics
cd metaphysics

# Run the setup script

source ./scripts/setup.sh

This will pull the environment variables from aws into .env.shared. It will also overwrite .env with the values in .env.example. If you need to override any of these values or add new .env values place them in the .env file.

Development

With your dependencies set up, you can run Metaphysics by running:

yarn dev

Which will start the server on http://localhost:3000

You can also use hokusai by running the below command.

hokusai dev start

Be sure that memcached is no longer running before starting hokusai by running

brew services stop memcached

Recommended: You can run the commands inside the terminal in VS Code, then the debugger will be hooked up by default.

Setting up your local GraphiQL

We recommend the graphiql.app client for testing queries locally.

You will need to set up headers with both:

  • x-access-token - Open https://staging.artsy.net, sign in and evaluate sd.CURRENT_USER.accessToken in a dev console (CMD+Shift+C in Chrome).
  • x-user-id - As above, but sd.CURRENT_USER.id.

If you're new to GraphQL, you can checkout Artsy's GraphQL Workshop.

Introspection Setup

Getting docs for the schema on MP in your playground of choice (Postman, Insomnia, Altair, etc) is called introspection.

Introspection is available by default when developing.

Introspection on staging and production are for internal use only, so artsy devs can use it to make development for MP clients (eigen, force, etc) easier, but it is and should not be used by any of the clients or anyone else.

In order to set this up in your playground of choice (Postman, Insomnia, Altair, etc), you need to send the following header:

Authorization: Bearer <secret>

and replace <secret> with the value you get from hokusai using

hokusai staging env get INTROSPECT_TOKEN
hokusai production env get INTROSPECT_TOKEN

or the contents of Metaphysics INTROSPECT_TOKEN in 1Password.

Sample Queries

Once you have the GraphiQL client running against your local service, you can verify things are working by executing these queries:

Get popular artists

{
  popular_artists {
    artists {
      name
    }
  }
}

Get your account information

{
  me {
    name
    email
  }
}

If any of these queries fail, it's probable that you misconfigured your x-access-token or x-user-id HTTP headers.

Docs

Docker and Kubernetes setup

This is deployed using Hokusai to manage Docker and Kubernetes. To replicate this:

  • Install Docker for Mac and Hokusai

    $ brew tap caskroom/cask && brew cask install docker
    $ pip install hokusai
    

    If you are using your system Python distribution, you may need to run this as:

    $ sudo pip install hokusai --ignore-installed
    
  • Configure Hokusai

    export AWS_ACCESS_KEY_ID={{ MY_AWS_ACCESS_KEY_ID }}
    export AWS_SECRET_ACCESS_KEY={{ MY_AWS_SECRET_ACCESS_KEY }}
    hokusai configure --kubectl-version {{ kubectl_version }} --s3-bucket {{ kubectl_config_s3_bucket }} --s3-key {{ kubectl_config_s3_key }}
    hokusai check
    

    Artsy staff should find follow the instructions in https://github.com/artsy/potential/blob/master/platform/Kubernetes.md#hokusai

Testing

  • Run tests in the Docker Compose test stack via Hokusai:

    hokusai test
    
  • Or, to run tests locally: npm test to run the entire suite npm run watch to spin up the test watcher

About Artsy

This project is the work of engineers at Artsy, the world's leading and largest online art marketplace and platform for discovering art. One of our core Engineering Principles is being Open Source by Default which means we strive to share as many details of our work as possible.

You can learn more about this work from our blog and by following @ArtsyOpenSource or explore our public data by checking out our API. If you're interested in a career at Artsy, read through our job postings!

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].