Positron is Artsy Writer or the editorial tool for Artsy.
- State: production
- Production: https://writer.artsy.net/ | Kubernetes
- Staging: https://stagingwriter.artsy.net/ | Kubernetes
- Logs:
- Monitoring:
- MongoDB: Atlas
- Github: https://github.com/artsy/positron/
- CI: CircleCI; merged PRs to artsy/positron#main are automatically deployed to staging. PRs from
stagingtoreleaseare automatically deployed to production. Start a deploy... - Point Person: @mc-jones, @dzucconi
Clone the project:
git clone [email protected]: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
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.
With MongoDB running locally, follow these steps to create a dummy channel:
- Create a collection called
channelsin apositrondb in your mongo database (You can use the mongo shell or a simple UI like Robomongo.) - 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.
COMMIT_HASH=$(git rev-parse --short HEAD) hokusai dev start
This starts a new Docker Compose stack that boots MongoDB, OpenSearch 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.
Mongo must be running in the background for tests to work.
yarn test
hokusai test
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 oninspectlink (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!
Use the task command to run scripts written in ES6 or Coffeescript. This is helpful for running backfills.
yarn task scripts/backfill.js
You can find additional documentation about Positron in doc.
