Skip to content

Release v0.1.0 #12

Merged
merged 5 commits into from Apr 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
70 changes: 54 additions & 16 deletions README.md
@@ -1,38 +1,76 @@
# 303COM Personal Project

> :lock: A modern home security system capable of real time threat detection
<div align="center">
<img width="70" src="https://github.coventry.ac.uk/raw/eggintod/303COM/master/assets/logo.png">
<h3 align="center">303COM Personal Project</h3>
<p align="center">:lock: A modern home security system capable of real-time threat detection<p>
<br>
<img width="460" align="center" src="https://github.coventry.ac.uk/raw/eggintod/303COM/release_0.1.0/assets/demo.png">
</div>

## Research Question

Are Home CCTV Security Systems able to provide useful real-time Threat Alerts by combing Motion Detection and Facial Recognition?
Are Home CCTV Security Systems able to provide useful real-time Threat Alerts by combing Motion Detection and Facial Recognition?

## Install

## Getting Started
### Prerequisite

To run this project you must have the required prerequisites:

- [docker](https://www.docker.com/)
- [node.js](https://nodejs.org/en/)
- [Docker](https://www.docker.com/)
- [Node.js](https://nodejs.org/en/)

### Install Dependencies
### Close Source Code

This may take some time, it installs [OpenCV](https://opencv.org/) via [opencv4nodejs](https://github.com/justadudewhohacks/opencv4nodejs) and [TensorFlow](https://www.tensorflow.org/), these take a while to download and install.
``` shell
git clone https://github.coventry.ac.uk/eggintod/303COM.git
```

### Install Dependencies

``` shell
npm i
```

### Managing the Development Environment
Sit back and have a cuppa :coffee: this may take some time, **OpenCV** will take some time to build in your `node_modules` folder.

### Starting the System

To simply start the server in the development environment run the npm script:
``` shell
npm run start:dev
npm run start
```

Enabling the webcam attached the the development machine is done via the `DEV_WEBCAM=true/false` environment variable, however a easy to use npm script has been created:
The [Docker](https://www.docker.com/) docker demon should be running so **MongoDB** instances can be created.

### Viewing Logs

``` shell
npm run start:dev:webcam
npm run logs:view
```
To clean the docker volumes and containers from your machines docker engine use the npm script:

Logs are written to `/logs/events.log`,

### Clearing Logs

``` shell
npm run clean:dev
npm run logs:clear
```

### Development Environment

This project is released under the [MIT](https://github.coventry.ac.uk/eggintod/303COM/blob/master/LICENSE) license. Feel free to do ask you wish. You may fine some of the following tips useful while hacking around inside this source code:

#### Monitor Source Changes

```shell
npn run start:dev
```

Starts the system using [nodemon](https://github.com/remy/nodemon/), a helping hand that watched for changes to `*.js` files and restarts your node for you.

#### Development Webcam

```shell
npm run start:dev:webcam
```

Attach your bult-in webcam to the system.
Binary file added assets/demo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions package.json
@@ -1,10 +1,10 @@
{
"name": "303com",
"version": "0.0.2",
"version": "0.1.0",
"description": "A smart home security system 🔒🎥",
"main": "index.js",
"scripts": {
"start": "node index.js",
"start": "./scripts/env_start",
"start:dev": "./scripts/dev_env_start",
"start:dev:webcam": "DEV_WEBCAM=true npm run start:dev",
"clean:dev": "./scripts/dev_env_clean",
Expand Down
24 changes: 24 additions & 0 deletions scripts/env_start
@@ -0,0 +1,24 @@
#!/bin/sh

NODE_ENV=production

trap remove_dev_env_db INT

function remove_dev_env_db() {
echo ``
echo '> Removing Database 303COM_dev_env_db_mongo'
docker stop 303COM_dev_env_db_mongo
docker rm 303COM_dev_env_db_mongo

exit
}

echo '> Creating Database volume 303COM_dev_env_db'
docker volume create 303COM_dev_env_db


echo '> Starting Database 303COM_dev_env_db_mongo'
docker run --name 303COM_dev_env_db_mongo -v 303COM_dev_env_db:/data/db -p 27017:27017/tcp -d mongo:latest

echo '> Starting Development Node.js Server with nodemon'
node index.js