Back-end server that handles the camera apis. Main functions are:
- It provides a list of all taken photos.
- It accepts requests from the user to take photos.
- It accepts requests from the alarm system api to take photos when motion is detected or garage door was opened while armed.
- It sends push notification to the raspberry pi camera clients asking to take photo(s).
- It manages Amazon AWS S3 storage. It provides api to store and fetch the camera photos.
I suggest you first read about the different components of the home automation application.
This will help you understand better the general architecture and different functions of the system.
Click here and follow the installation instructions for the server micro-service, before moving to the next step.
AUTH_PUBLIC_KEY (required): content of auth server's publickey.
AWS_ACCESS_KEY_ID (required): AWS S3 credentials to store images taken by the cameras.
AWS_BUCKET_NAME (required): AWS S3 bucket name to store the images.
AWS_SECRET_ACCESS_KEY (required): AWS S3 credentials to store images taken by the cameras.
DATABASE_URL (required): url to postgres database. Default: postgres://postgres:@localhost/home_automation
LOGIN_URL (required): url to the authentication server. Default: if NODE_ENV = production
=> none
, otherwise: http://localhost:3001
NODE_ENV (required): set up the running environment. Default: production
. production
will enforce encryption using SSL and other security mechanisms.
PORT (required): server's port. default: 3007
POSTGRESPOOLMIN (required): postgres pool minimum size. Default: 2
POSTGRESPOOLMAX (required): postgres pool maximum size. Default: 10
POSTGRESPOOLLOG (required): postgres pool log. Values: true
/false
. Default: true
PRIVATE_KEY (required): Generated private key. Public key should be shared with the authentication server. See here.
UI_URL (required): url to the UI server. Default: if NODE_ENV = production
=> none
, otherwise: http://localhost:3000