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.
nodemust be installed and available in$PATH(>= v8)gitmust be installed and available in the$PATH.- GNU coreutils (
rm,mkdir,chmod,wc) must be available. tarorbsdtarmust be available (BSD version is preferred.. on Debian install with$ aptitude install bsdtar)- Install the
pinoCLI to prettify logging output by running$ npm install -g pino-pretty
- Install CouchDB and run it (tested with
v2.2). - Create database named
npmsby executingcurl -X PUT http://admin:admin@localhost:5984/npms - Setup npm replication from
https://replicate.npmjs.com/registrytonpmdatabase incontinuousmode. - Setup the necessary views by creating the document
_design/npms-analyzer-npmin thenpmdatabase with the contents ofhttps://github.com/npms-io/npms-analyzer/blob/master/config/couchdb/npm-analyzer.json - Setup the necessary views by creating the document
_design/npms-analyzer-npmsin thenpmsdatabase with the contents ofhttps://github.com/npms-io/npms-analyzer/blob/master/config/couchdb/npms-analyzer.json
Note: for the replication to work, you might need to tweak auth-plugins in the CouchDB config:
[replicator]
auth_plugins = couch_replicator_auth_noop
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:15672and login withguest/guestand see if everything is ok.
NOTE: You may put the Elasticsearch app into the gitignored dev folder while developing!
- Install Elasticsearch (tested with
v6.4) - Install the head to perform various manual operations in a web GUI
- Add these configurations to the
elasticsearch.yml:action.auto_create_index: -npms-current,-npms-new,+*
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.