-
Notifications
You must be signed in to change notification settings - Fork 9
Architecture
Farhad Makiabady edited this page Nov 2, 2018
·
1 revision
- Linux VM:
I use
Ubuntu 16.04
.
- Download and install `java 8
- Set up elasticsearch
- upload api-server and a compiled screenerClient. Put the client in a folder. Call it "build" or something. Start the
api-server
withnohup
or someother process management, egnodemon
. - Set up a reverse proxy as pictured above (I use caddyserver).
- execute the seed program on your database.
You should then have the database set for use. If everything worked, you should have
1 test question
, with1 test program
and answering that test questiontrue
should give you1 result
.
- Reverse Proxy: This is your user and admin entry point to the app, and your developer's remote entry point into Elasticsearch. Read a sample config
- listen on
0.0.0.0:80
,www.<yourdomain>.x
,yourdomain.x
etc... - forward
/api
tolocalhost:3000
- forward
/protected
tolocalhost:3000
. Use basic auth (this is administrator stuff) - serve the
build folder
statically e.g../build
to root for static files. The build folder is the compiledscreenerClient
. http.root - (optional route): forward
/elastic
tolocalhost:9200
. Strip the/elastic
part of the path when forwarding, eg "without /elastic". Set basic auth.
- api-server:
- listens on
localhost:3000
- handles the backend logic and talks to the database.
- written in typescript and ran in node.
- ** important: ** this program uses
in memory
caching forprograms
and thescreener
. If you alter the database directly, you will need to restart the server to see newprograms
orscreener
.- point of improvement: make state-less
- requires node/npm
- Elasticsearch:
- listens on
localhost:9200
- default config
- point of improvement: lower shards
- used as datastore
- user to percolate (reverse search)
- requires java 8
- screenerClient:
- build the screenerClient app using
npm run build
- transfer the compiled program to the
linux vm
. - serve the files statically with the proxy server.
- requires npm/node
- utils:
- clone the yeg-relief/utils repo.
- there are various database utility programs
- the upload ones only (as of yet) work locally hardcoded during development
- point of improvement: use the
config.json
file to maintain endpoints.
- point of improvement: use the
- running the
seed program
locally is advised.ts-node ~/utils/seed/run.ts
this will set the database up for use.
- user:
- Will use the app by entering their data into a form that has been created by the
admins
. - Accesses the sight on port
80
or443
(http or https)
Getting Started
Admin Guide
Developer Documentation