{"id":18314387,"url":"https://github.com/pc9795/watchdog","last_synced_at":"2026-05-02T03:03:12.459Z","repository":{"id":38604271,"uuid":"221575254","full_name":"pc9795/watchdog","owner":"pc9795","description":"A monitoring tool to keep an eye :eyes: on web sites/servers :globe_with_meridians: . Reference for Spring boot with Akka and Akka web services.","archived":false,"fork":false,"pushed_at":"2023-03-02T17:03:39.000Z","size":2262,"stargazers_count":0,"open_issues_count":17,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-15T06:41:29.723Z","etag":null,"topics":["akka","akka-http","spring-boot"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pc9795.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-14T00:08:11.000Z","updated_at":"2021-10-16T10:32:45.000Z","dependencies_parsed_at":"2024-11-05T16:52:55.683Z","dependency_job_id":null,"html_url":"https://github.com/pc9795/watchdog","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pc9795%2Fwatchdog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pc9795%2Fwatchdog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pc9795%2Fwatchdog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pc9795%2Fwatchdog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pc9795","download_url":"https://codeload.github.com/pc9795/watchdog/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248045220,"owners_count":21038552,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["akka","akka-http","spring-boot"],"created_at":"2024-11-05T16:32:38.849Z","updated_at":"2026-05-02T03:03:12.376Z","avatar_url":"https://github.com/pc9795.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Prerequisites\n### 1. Install Maven\nCheck installation is working by `maven --version`. Our version is 3.5.2.\n### 2. Install JDK 11\nSome Akka modules we used are not backward compatible with JDK 8. Make sure to point your `JAVA_HOME` environment variable \nto the JDK 11 installation. Check the version using `java --version`\n### 3. Install Angular CLI\nTo install Angular CLI we need `npm`. \n* Install node for your operating system it will install `npm` along with it. Check the installation using \n`node --version` and `npm --version`. Our node version is v10.15.3 and npm version is 6.4.1.\n* Run `npm install -g @angular/cli`. Check version using `ng --version`. Our Angular CLI version is 7.3.9.\n### 4. Install Cockroach DB and Mongo DB\nWe used docker containers instead of original installed application. \n\nDocker-compose configuration for starting a single node cluster without authentication.\n```\ncockroachdb:\n    image: cockroachdb/cockroach\n    command: start-single-node --insecure\n    ports:\n      - \"26257:26257\"\n      - \"8080:8080\"\n```\nDocker-compose configuration for starting a single node mongodb cluster without authentication\n```\n mongo:\n    image: mongo\n    ports:\n      - \"27017:27017\"\n```\n\n\n## Run locally\nWe have created a script `local_run.sh` to automate this process. But as this script will run 4 processes in backend:\nclient-service, monitoring-service, notifications-service and frontend so the logs could be intermingled. In case of \nany failures it will be hard too debug so following are detail steps used in script. Anyways you can use that script\nfor reference. That script is supposed to be run from `backend` folder so all paths are relative to that.\n### 1. Installing parent project\nGo to the `backend` directory and run `mvn -N install`. It will install `watchdog` parent project to local maven \nrepository.\n### 2. Building core module\nGo to the `backend/core` directory and run `mvn clean compile install`. It will install `core` module to local maven \nrepository.\n### 3. Running notifications-service\nGo to the `backend/notifications-service` and run `mvn clean compile`. After it run `mvn exec:java` it will start the\nmicro service. You can check it is working or not by `http://localhost:8559/alive` it will show OK.\nNOTE: Currently the main line which sends the email is commented out in \n`backend\\notifications-service\\src\\main\\java\\service\\notification\\utils\\Utils.java` line no 36.\n```\nLOGGER.info(String.format(\"Going to send message:%s\", message));\n//todo uncomment\n//Transport.send(messageObj);\nLOGGER.info(\"Message sent successfully...\");\n```\nIf you wish to send real emails then we have created a temporary email id which is configured in properties file. \nYou have to first uncommment this line and create an environment variable by the name: **WATCHDOG_EMAIL_PASSWORD**.\nThe password/value of this variable is in Appendix section of the project report. Please restart your IDE after creating\nthe environment variable as some tend to load them on start.\n### 4. Running monitoring-service\nIf you are using Docker tool box and  created containers for MongoDB and CockroachDB then everything is fine. \nThe values in `application.properties` will work. In any other case or database connection things. Go to\n`backend\\monitoring-service\\src\\main\\resources\\application.properties` and adjust following values accordingly.\n```\nspring.jpa.generate-ddl=true\nspring.datasource.url=jdbc:postgresql://192.168.99.100:26257/defaultdb\nspring.datasource.username=root\nspring.data.mongodb.uri=mongodb://192.168.99.100:27017/local\n```\nFor the first run we need `spring.jpa.generate-ddl` to be `true` as it will automatically create the schema in \nCockroach DB. For further runs we can turn-off this. We are using the default databases for both Cockroach DB(`defaultDB`)\nand Mongo DB(`local`). We are not using any authentication so if you are then adjust the Spring properties accordingly.\n\nGo to the `backend/monitoring-service` and run `mvn clean compile`. After it run `mvn spring-boot:run` it will start the\nmicro service. You can check it is working or not by `http://localhost:8558/alive` it will show OK.\n### 5. Running client-service\nFor configuring databases in `application.properties` follow instructions given in **Running monitoring-service**. Go to\nthe `backend/client-service` and run `mvn clean compile`. After it run `mvn spring-boot:run` it will start the micro \nservice. You can check it is working or not by `http://localhost:8081/swagger-ui.html` it will show OK.\n\nNOTE: To test out this service using Postman is a good idea. As we integrated Swagger but it doesn't support polymorphic\nREST resources. So the instructions written on it will not work. Sample for all requests are given in \n`Watchdog.postman_collection.json` in the `backend` director. Install Postman and import this collection to test out\nvarious REST APIs.\n### 6. Running front-end code\nGo to the `fronend` directory and run `ng serve`. It will take a while as there is problem in `ng` commands: \n`https://github.com/angular/angular-cli/issues/3484`. You can see a message that a server is running at `localhost:4200`.\nYou can create an user from the front-end and then use our application.\n\nAccess the application at `localhost:4200`\n\n## Run using docker\n### 1. Setting up the front-end configuration\nUpdate the url of the exposed client-service in `frontend/src/environments/environment.prod.ts`.\n```\nexport const environment = {\n  production: true,\n  server: 'http://192.168.99.100:8081/'\n};\n```\nWe are using docker tool box so the client service is accessed by `http://192.168.99.100:8081/`. The host is the hostname\nof the docker-machine. So adjust it accordingly.\n\n### 2. Build the project.\nUse the `build.sh`. That's it. We tried to carefully create this build script. It is assumed to be run at the \n`backend/` directory. If you want to debug a particular part you can follow through the script it is well documented \nor you can reach out to us.\n\nAccess the application at `192.168.99.100:8081`. NOTE: We are using docker toolbox so adjust you URL accordingly.\n\n## Deploy on AWS\n### 1. Create an AWS instance\nCreate an AWS EC2 instance with Ubuntu 64 bit AMI and t2.small instance with 2 GB ram.\n### 2. Update AWS url in front-end\nUpdate the url of the instance in `frontend/src/environments/environment.prod.ts`\n```\nexport const environment = {\n  production: true,\n  server: 'http://\u003cip of instance\u003e:\u003cport of client service\u003e/'\n};\n```\n### 3. Packaging up the Project\nComment the last line of `build.sh` which triggers a docker build.\n```\n# Using docker compose to create containers for all service.\ndocker-compose -p watchdog up --build\n```\nRun `build.sh` and then compress **backend** folder using 7z in your local machine. NOTE: Build script will package \nfront-end code inside client-service.\n### 4. Setting up the instance\n* Move the artifact **backend.7z** to instance using ssh.\n* `sudo apt update -y` to Update `apt` repositories\n* `sudo apt install docker.io -y` to Install docker\n* `sudo apt install docker-compose -y` to Install docker-compose\n*  `sudo apt-get install p7zip-full` to Install 7zip \n* `7z x backend.7z`  to extract project\n### 5. Running the project\n* Go to the root of extracted project(`backend/`) and run `sudo docker-compose -p watchdog up --build`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpc9795%2Fwatchdog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpc9795%2Fwatchdog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpc9795%2Fwatchdog/lists"}