Giter Site home page Giter Site logo

kaws's Introduction

kaws

Named after the artist, kaws is a backend service that powers artsy.net collection pages. What are collections you ask? A Collection is a prefiltered version of Artsy's Collect page for marketing purposes.

CircleCI

Prerequisites

  • node.js 8.12.0 or newer
  • yarn 1.10.1 or newer
  • MongoDB 4.x

Getting started

First, make sure to install dependencies:

yarn

We use the .env file to load environment-specific variables. Copy .env.example to .env so dotenv will automatically load them upon app boot:

cp .env.example .env

Usually you do not have to change them, but if you need, update the variables to match your local development setup.

Once this is done, the next step would be to load test data. The collection data is maintained by Artsy's marketing team in Google Drive as a spreadsheet (you need an @artsymail.com account). Download it as a CSV file (in this case saved as collections.csv) and try running the command below to load the data to your local MongoDB instance:

yarn update-database ./collections.csv

Finally, start the server by running the command below:

yarn dev

Then open http://localhost:4000/playground and you should see Apollo's GraphQL Playground. Try running the GraphQL query below, and if you see "KAWS, Companions" and "Pablo Picasso, Lithographs" you are good to go!

query {
  collections {
    id
    slug
    title
  }
}

Testing

yarn jest

Did you change the GraphQL schema?

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

  1. In kaws run
yarn dump-schema
  1. copy the _schema.graphql file generated โ˜๐Ÿผ to kaws.graphql
cp _schema.graphql kaws.graphql
  1. move the file above to your local Metaphysics under src/data and make a PR to Metaphysics with this change.

Updating the sitemap for Collect

When we update the production database with the update-database command, we also need to inform Google of the updates so newly added collections will be crawled. This could be done with the update-sitemap command. This comamnd needs to be run in the k8s container as it neeeds to point to the production databse:

hokusai production run 'yarn update-sitemap'

kaws's People

Contributors

artsyit avatar damassi avatar dblandin avatar eessex avatar iskounen avatar izakp avatar joeyaghion avatar l2succes avatar mdole avatar mzikherman avatar orta avatar peril-staging[bot] avatar xtina-starr avatar yuki24 avatar zephraph avatar

Watchers

 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.