Positron is Artsy Writer or the editorial tool for Artsy.
- State: production
- Production: https://writer.artsy.net/ | Kubernetes
- Staging: http://stagingwriter.artsy.net/ | Kubernetes
- Logs:
- Monitoring:
- MongoDB: Atlas
- Github: https://github.com/artsy/positron/
- CI: CircleCI; merged PRs to artsy/positron#master are automatically deployed to staging. PRs from
staging
torelease
are automatically deployed to production. Start a deploy... - Point Person: @eessex
- Set up Hokusai
git clone [email protected]:<your username>/positron.git && cd positron
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
.
- Install NVM
- Install Node 10
nvm install 10
nvm alias default 10
- Fork Positron to your Github account in the Github UI.
- Clone your repo locally (substitute your Github username).
git clone [email protected]:craigspaeth/positron.git && cd positron
- Copy
.env.example
to.env
in the root of the project and edit allREPLACE
values with sensitive configuration obtained frompositron-staging
. Use the following command:
hokusai staging env get | grep -E `cat .env.example | grep REPLACE | cut -f1 -d= | xargs | tr ' ' \|` | sed -e 's/:\ /=/g' | sed -e 's/ //g'
- Install node modules
yarn install
- Positron uses MongoDB as a database. To install MongoDB using homebrew do the following, if you would prefer to install manually check the documentation at MongoDB
brew install mongodb
- Start the MongoDB database
mongod
- Install and run elasticsearch
brew install elasticsearch
brew services start elasticsearch
- Create a dummy channel In order to write articles, you will need to be a member of a channel. If you are an Artsy dev, it might be easier to point your MONGOHQ_URL to the staging database. Otherwise, here are the steps to backfill some required data:
- Create a collection called
channels
in apositron
db 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: [ObjectId("<your_user_id>")]
}
- Start the server
yarn start
- 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 pointed to the staging database, 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 [ ObjectId("<your_above_channel_id>") ]
. Once that's done you should be able to see the main writer interface.
- Run tests
yarn test
- Make sure you have mongo running in the background or most tests will not work.
Start the server using
yarn dev
This will start the server on port 3005
with inspect
option.
- In your Chrome go to: Chrome Inspect
- Under Remote Target now you should see
./index.js
, click oninspect
link below it which will open a 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.