Below you will find a list of items that you must do to get the project working on your local machine. The production setup document is not present in the repository for security reasons.
This project uses config for configuration. You may create config/local.json5
file to override the configuration as necessary, especially to define githubTokens
.
git
must be installed and available in the$PATH
.- GNU coreutils (
rm
,mkdir
,chmod
,wc
) must be available. tar
orbsdtar
must be available (BSD version is preferred.. on Debian install with$ aptitude install bsdtar
)- Install the
pino
CLI to prettify logging output by running$ npm install -g pino
- Install CouchDB and run it (tested with
v1.6.1
). - Add user
admin
withadmin
as password by executingcurl -X PUT http://localhost:5984/_config/admins/admin -d '"admin"'
. After doing this, operations done in the web interface require you to login (login is at bottom right corner). - Create database named
npms
by executingcurl -X PUT http://admin:admin@localhost:5984/npms
- Change default maximum replication retries to infinite by executing
curl -X PUT http://admin:admin@localhost:5984/_config/replicator/max_replication_retry_count -d '"infinity"'
- Setup npm replication by executing
curl -X PUT http://admin:admin@localhost:5984/_replicator/npm -d '{ "source": "https://replicate.npmjs.com/registry", "target": "http://admin:admin@localhost:5984/npms", "create_target": true, "continuous": true }'
- Setup the necessary views by creating the document
_design/npms-analyzer
in thenpms
database with the contents ofhttps://github.com/npms-io/npms-analyzer/blob/master/config/couchdb/npms-analyzer.json
NOTE: You may put RabbitMQ standalone
into the gitignored dev
folder while developing!
- Install RabbitMQ and run it (tested with
v3.6.1
). - Install the management plugin which is very useful by running
rabbitmq-plugins enable rabbitmq_management
- Head to
http://localhost:15672
and login withguest/guest
and see if everything is ok.
NOTE: You may put the Elasticsearch
app into the gitignored dev
folder while developing!
- Install Elasticsearch (tested with
v2.3.1
) - Install the head plugin to perform various manual operations in a web GUI
- Add these configurations to the
elasticsearch.yml
:action.auto_create_index: -npms-current,-npms-new,+*
script.engine.groovy.inline.search: on
script.engine.groovy.inline.update: on
If you plan to run this in production, you should add $ npms-analyzer tasks enqueue-missing
and $ npms-analyzer tasks clean-extraneous
to crontab. These tasks ensure that, in case of errors, the npms
packages are in sync with the packages from the npm
registry.