2016-11-22 10:18:09 +08:00
|
|
|
# K2 - The local sync engine for Nylas N1
|
2016-06-21 03:19:01 +08:00
|
|
|
|
2016-07-08 03:08:48 +08:00
|
|
|
# Initial Setup:
|
2016-06-22 08:44:09 +08:00
|
|
|
|
2016-07-08 03:08:48 +08:00
|
|
|
## New Computer (Mac):
|
2016-06-22 08:44:09 +08:00
|
|
|
|
2016-07-08 03:08:48 +08:00
|
|
|
1. Install [Homebrew](http://brew.sh/)
|
2016-07-08 07:06:04 +08:00
|
|
|
4. Install [NVM](https://github.com/creationix/nvm) `brew install nvm`
|
2016-11-22 10:18:09 +08:00
|
|
|
5. Install Node 6 via NVM: `nvm install 6`
|
2016-07-09 00:00:57 +08:00
|
|
|
6. Install Redis locally `brew install redis`
|
2016-06-21 03:19:01 +08:00
|
|
|
|
2016-07-12 09:36:08 +08:00
|
|
|
## New Computer (Linux - Debian/Ubuntu):
|
|
|
|
1. Install Node 6+ via NodeSource (trusted):
|
|
|
|
1. `curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -`
|
|
|
|
1. `sudo apt-get install -y nodejs`
|
|
|
|
2. Install Redis locally `sudo apt-get install -y redis-server redis-tools`
|
|
|
|
|
2016-07-08 03:08:48 +08:00
|
|
|
# Developing Locally:
|
2016-06-25 02:57:24 +08:00
|
|
|
|
|
|
|
```
|
2016-11-22 10:18:09 +08:00
|
|
|
npm install
|
|
|
|
npm start
|
2016-06-25 02:57:24 +08:00
|
|
|
```
|
2016-07-08 03:08:48 +08:00
|
|
|
|
2016-07-09 00:12:11 +08:00
|
|
|
We use [pm2](http://pm2.keymetrics.io/) to launch a variety of processes
|
|
|
|
(sync, api, dashboard, processor, etc).
|
|
|
|
|
|
|
|
You can see the scripts that are running and their arguments in
|
|
|
|
`/pm2-dev.yml`
|
|
|
|
|
|
|
|
To test to see if the basic API is up go to: `http://lvh.me:5100/ping`. You
|
|
|
|
should see `pong`.
|
|
|
|
|
|
|
|
`lvh.me` is a DNS hack that redirects back to 127.0.0.1 with the added
|
|
|
|
benefit of letting us use subdomains.
|
|
|
|
|
2016-07-08 03:08:48 +08:00
|
|
|
# Deploying
|