You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. Install the babel-cli: ```npm i -g babel-cli```
9
+
10
+
1. Install RethinkDB.
11
+
12
+
1. Start a RethinkDB instance. To start a rethinkdb instance, run the command:
13
+
14
+
```
15
+
rethinkdb
16
+
```
17
+
18
+
19
+
20
+
It will creates its working files in the current directory.
21
+
22
+
1. Verify you can access the RethinkDB admin console at http://localhost:8080
23
+
24
+
## Project Setup
25
+
26
+
1. In the cloned *agilegps* folder, run ```npm install``` to install the dependencies from package.json.
27
+
28
+
2. Run ```npm run webpack```. This builds the front end based on the package.json scripts section which is using webpack.
29
+
30
+
## Schema Setup
31
+
32
+
1.```cd agilegps/src/tools```
33
+
34
+
1. Run ```babel-node schema.js``` to create the DB, tables, and indexes. It’s safe to run this multiple times because it does not drop any DB objects. Verify that the tables exist in the RethinkDB admin console. It should only take a few seconds to run.
35
+
36
+
1. Run ```babel-node createAnAdmin.js admin password``` to create an Admin user.
37
+
38
+
## Building the Front End
39
+
1.```npm run watch``` from the root of the project will run webpack in watch mode, continually rebuilding the front end as changes are made.
40
+
1.```npm run webpack``` from the root of the project runs webpack once, to rebuild the front end a single time.
41
+
42
+
43
+
## Building the Back End
44
+
1.```npm run build``` from the root of the project will run babel. The built version is used by processes.json for production usage since it uses less memory than *node-babel*.
45
+
46
+
## Running the Application
47
+
48
+
1. ```cd agilegps/src/server```
49
+
1. ```node runner``` starts the web server, listening for file system code changes and automatically restarting the web server process on change, for easier development.
50
+
1. ```babel-node server``` starts the server without listening for file system changes.
51
+
1. ```babel-node debug server``` runs the server in the debugger.
52
+
2. Node 6.3.0 and later has V8 Inspector integration which allows attaching Chrome DevTools to Node.js instances for debugging and profiling: https://nodejs.org/api/debugger.html#debugger_v8_inspector_integration_for_node_js
53
+
1. You should be able to access and login to the app at http://localhost:3000
54
+
55
+
## Running the Message Listener
56
+
57
+
The message listener (also known as the message gateway or just gateway) receives messages from tracker devices and inserts into the database. The message listener can be started and stopped independently of the web server.
58
+
59
+
1. ```cd agilegps/src/listener```
60
+
1. Run: ```babel-node listen.js```
61
+
1. To debug, ```babel-node debug listen.js```
62
+
63
+
## Deploying to Production
64
+
65
+
The *processes.json* file is pre-configured for PM2 which is a convenient way to run the app in production. PM2 can be installed to automatically run the app at system startup, log process output, etc.
66
+
67
+
1. Put your Google Maps API key in ```config/geocoding.js```
68
+
69
+
1. Configure *agilegps/config/web.json*
70
+
1. isReverseProxied - if you are behind a reverse proxy, set this to true
71
+
1. cluster - true to use all CPUs
72
+
1. jwtSecret - you should generate a random long string here. This string is used to sign the JWT tokens.
73
+
1. cookieKeys - you should generate an array of two strings. These are used to sign the session cookies. The array allows you to rotate in new keys.
0 commit comments