Skip to content
/ positron Public

Positron is Artsy Writer or the editorial tool and API for Artsy.

License

Notifications You must be signed in to change notification settings

artsy/positron

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Positron

Positron is Artsy Writer or the editorial tool for Artsy.

ArtsyWriter

Meta

Build Status codecov

Setup

Clone the project:

git clone git@github.com:artsy/positron.git && cd positron

Run the setup script:

scripts/setup.sh

NOTE: for nvm users, after setup finishes: nvm use

Start the server:

yarn start

Prepare database

Using staging database

In order to write articles, you will need to be a member of a channel. If you are an Artsy dev, you can point MONGOHQ_URL env to the staging database. Connecting to staging database requires VPN, please see details on setting up a VPN connection here.

Using a local database

With MongoDB running locally, follow these steps to create a dummy channel:

  1. Create a collection called channels in a positron db in your mongo database (You can use the mongo shell or a simple UI like Robomongo.)
  2. Add a document with the following fields:
{
  name: "Test Channel",
  type: "team", // this can be either editorial, team, support, or partner
  user_ids: [new ObjectId("<your_user_id>")]
}

If you are using Hokusai dev, edit the database as mentioned in this step, then restart the stack.

Start the server using Hokusai Dev

COMMIT_HASH=$(git rev-parse --short HEAD) hokusai dev start

This starts a new Docker Compose stack that boots MongoDB, ElasticSearch and Positron. Changes made to source-code are not automatically reloaded. To shut down, press ctrl+c or execute hokusai dev stop.

Positron should now be running at http://localhost:3005/, open a browser and navigate to it. That will redirect you to staging, login as an Artsy administrator and it will redirect you to http://localhost:3005 logged into Writer.

If you are an Artsy Admin, you should see the default partner gallery channel (David Zwirner). If you aren't an artsy admin you'll possibly get an Unauthorized page. You need to do one more mongo operation: edit the users collection and set your user's channel_ids to [ new ObjectId("<your_above_channel_id>") ]. Once that's done you should be able to see the main writer interface.

Run tests

Using Yarn

Mongo must be running in the background for tests to work.

yarn test

Using Hokusai

hokusai test

Debugging

Server side

Start the server using

yarn dev

This will start the server on port 3005 with inspect option.

  • In Chrome navigate to: chrome://inspect
  • Under Remote Target you should see ./index.js. Clicking on inspect link (below "Target") will open Chrome developer tools.

Now anywhere in your server side code you can put debugger and you should be able to debug!

Running tasks

Use the task command to run scripts written in ES6 or Coffeescript. This is helpful for running backfills.

yarn task scripts/backfill.js

Additional docs

You can find additional documentation about Positron in doc.