diff --git a/Backend/src/cameraStream/cameraStream.gateway.spec.ts b/Backend/src/cameraStream/cameraStream.gateway.spec.ts index 5644419..4333802 100644 --- a/Backend/src/cameraStream/cameraStream.gateway.spec.ts +++ b/Backend/src/cameraStream/cameraStream.gateway.spec.ts @@ -1,7 +1,6 @@ import { Test, TestingModule } from '@nestjs/testing'; import { CameraStreamGateway } from './cameraStream.gateway'; import { JwtModule } from '@nestjs/jwt'; - import { DatabaseService } from '../database/database.service'; describe('WebStreamGateway', () => { diff --git a/Frontend/.env -example b/Frontend/.env -example deleted file mode 100644 index 146cc92..0000000 --- a/Frontend/.env -example +++ /dev/null @@ -1 +0,0 @@ -NEXT_PUBLIC_BACKEND_URL=https://10.0.0.235:8080/ \ No newline at end of file diff --git a/Frontend/package.json b/Frontend/package.json index 127dbfe..b5614bb 100644 --- a/Frontend/package.json +++ b/Frontend/package.json @@ -3,9 +3,9 @@ "version": "0.1.0", "private": true, "scripts": { + "css:start": "next start", "dev": "next dev", "build": "next build", - "start": "next start", "lint": "next lint", "docker:start": "npm i && npm run build && npm run start" }, diff --git a/README.md b/README.md index 672389a..6d0bbeb 100644 --- a/README.md +++ b/README.md @@ -9,27 +9,40 @@ The CSS is mainly composed of three 5 components:

detected.
5. **NVR & IPCameras**: These are the cameras that captures videos of the surrounding.
-In order to successfully run the full project components in your local machine, launch the components in the following order:

- 1. Install your IP Cameras in the areas desired and connect it to the network.
- 2. Run the media server.
- 3. Run the backend.
- 4. Run the frontend.
- 5. Run the machine learning component.
+In order to successfully run the full project components in your local machine, launch the components in the following order:
+1. Install your IP Cameras in the areas desired and connect it to the network.
+4. Run the frontend and DB dockerized images.
+3. Run the backend.
+5. Run the machine learning component.
Below, you will get full details on how to run each component. # Prerequisites -You should first install node.js in your machine. -You can get more information [here](https://nodejs.org/en/learn/getting-started/how-to-install-nodejs) +You should first install [node.js](https://nodejs.org/en/learn/getting-started/how-to-install-nodejs) and [docker](https://docs.docker.com/get-docker/) in your machine. -You should also have docker installed in your machine. +# Frontend and DB +The frontend is the part of the camera security system that enables user to interact with the system visually. -# Backend +### 1- Define environment variables +To run the frontend you need to have the following environment variables defined in a `.secrets.yml` file in the root directory. You can use the following example + +```yaml +NEXT_PUBLIC_BACKEND_URL=https://localhost:8080/ +``` + +### 2- Run the application + +Install the required packages by running: +```shell +docker compose up -d +``` -## Just Run +# Backend +The backend is the part of the camera security system that is responsible for authentication, logging detection events, and establish communication between the frontend and the media server to access the IP Cameras. -To run the backend you need to have the following environment variables defined in a .env file in the root directory of the backend. You can use the following example +### 1- Define environment variables +To run the backend you need to have the following environment variables defined in a `.env` file in the root directory of the backend. You can use the following example ```yaml # mongodb+srv is the protocol when connecting to cloud mongodb @@ -52,20 +65,11 @@ TELEGRAM_TOKEN=api_token BCRYPT_SALT=... # Put the IP address of the NVR NVR_IP_ADDRESS= -## Frontend -NEXT_PUBLIC_BACKEND_URL=http://localhost:8080/ ``` -Then you can run - - -### 2- Define environment variables -In order to run the application you will need to define the environment variable by creating -.env file in the root Backend directory. -Copy the content of .env_example found in the Backend root directory and change the variable values -accordingly. You can also run the backend by just adding the telegram token and leave the rest of the config as it is. +You can also run the backend by just adding the telegram token and leave the rest of the config as it is. -### 3- Install packages and Run the application +### 2- Run the application Run the application using the following commands: @@ -73,47 +77,12 @@ Run the application using the following commands: cd Backend npm run css:start ``` -Note: If you are running the backend locally make sure that you followed the steps in the [Media Server Section](#media-server). -# Frontend +# Machine Learning +The machine learning component is responsible for analyzing the camera streams and check if an object is detected. -This is the frontend part of the camera security system. It is this part that enables -user to interact with the system visually. +It is simple to start it using the following commands: -### 0- Prerequisite -You should first install node.js in your machine. -You can get more information [here](https://nodejs.org/en/learn/getting-started/how-to-install-nodejs) -### 1- Open terminal - -First open the terminal and move to the frontend directory. - -If you are currently in root directory of this repo. Type the following in the terminal to change directory: -```yaml -cd ./Frontend/ -``` - -### 2- Define environment variables -In order to run the application you will need to define the environment variable by creating -.env file in the root Frontend directory. - -Copy the content of .env_example found in the Frontend root directory and change the variable values -accordingly. -```yaml -NEXT_PUBLIC_BACKEND_URL=http://localhost:8080/ -``` - -### 3- Install packages - -Install the required packages by running: -```yaml -npm install -``` - -### 4- Run the application - -Run the application using this command: - -```yaml -npm run dev -``` -Note: If you are running the backend locally make sure that you followed the steps in the [backend section](#backend). +```shell +python ImageRecognition/main.py +``` \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index d36914f..2f3df86 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,12 +6,13 @@ services: image: mongo:latest restart: always ports: - - "27017:27017" + - "27018:27017" volumes: - ./mongo-data:/data/db env_file: - .secrets.yml +# WE can only dockerize this in a linux machine # backend: # container_name: backend # platform: linux/amd64 @@ -32,9 +33,9 @@ services: # - | # apt update # apt install ffmpeg -y -# npm run docker:start -# +# npm run css:start # + frontend: container_name: frontend image: node:21-alpine @@ -48,5 +49,5 @@ services: - ./Frontend:/home/node env_file: - .secrets.yml - command: npm run docker:start + command: npm run css:start