{"id":25012544,"url":"https://github.com/bibekaryal86/router-usage-statistics-java","last_synced_at":"2025-10-20T02:31:24.569Z","repository":{"id":44913660,"uuid":"432026721","full_name":"bibekaryal86/router-usage-statistics-java","owner":"bibekaryal86","description":"Simple Web Service using JSoup to Login and Retrieve Data from an API, and Save to MongoDb. Then retrieve the data from MongoDb to present as HTML page or serve JSON response.","archived":false,"fork":false,"pushed_at":"2023-07-13T03:23:20.000Z","size":173,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2023-07-13T04:25:34.288Z","etag":null,"topics":["gradle","java","jetty","mailjet","mongodb","quartz-scheduler"],"latest_commit_sha":null,"homepage":"http://routerstat.appspot.com/?isCheck=true","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/bibekaryal86.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}},"created_at":"2021-11-26T02:02:33.000Z","updated_at":"2023-07-13T03:26:11.000Z","dependencies_parsed_at":"2022-09-03T23:30:29.181Z","dependency_job_id":null,"html_url":"https://github.com/bibekaryal86/router-usage-statistics-java","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bibekaryal86%2Frouter-usage-statistics-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bibekaryal86%2Frouter-usage-statistics-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bibekaryal86%2Frouter-usage-statistics-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bibekaryal86%2Frouter-usage-statistics-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bibekaryal86","download_url":"https://codeload.github.com/bibekaryal86/router-usage-statistics-java/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237248991,"owners_count":19279111,"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":["gradle","java","jetty","mailjet","mongodb","quartz-scheduler"],"created_at":"2025-02-05T06:16:45.133Z","updated_at":"2025-10-20T02:31:19.277Z","avatar_url":"https://github.com/bibekaryal86.png","language":"Java","readme":"# router-usage-statistics-java\n\nThe project started as a POC for web scraping using JSoup where the objective as to be able to scrape internet data \nusage from router page. The reason for need being that the router's UI was only displaying the last three days of data \nusage only.\n\nThe app is one of the two repos used to save-retrieve-display data:\n* https://github.com/bibekaryal86/router-usage-statistics-java (save/retrieve data) (this)\n* https://github.com/bibekaryal86/router-usage-statistics-spa (view data)\n\nIn local network only, the App logs into Asus Router, gets daily data usage and saves to MongoDb repository on a \nscheduled time.\n\nIn local network and in the cloud, the app provides a way to query the saved data and present the data in HTML or JSON\nformat. The HTML data can be viewed directly from the browser, or the JSON data can be consumed by other front-end\napplication (SPA) for display purposes.\n\nThere are added logic to check whether data updated or not, and send email using MailJet if needed. Also, to test, SMS can be sent using Sinch.\n\nThe App does not use any frameworks or any view layer technology. The App runs on embedded Jetty, uses Quartz, JSoup, \nMongoDb driver, and MailJet API. The obvious choice would be to use Springboot, however, decided against it in order to keep the\napp's JVM memory footprint as low as possible so that it can continuously run in Google Cloud Platform's free tier.\n\nMongoDb supports BigDecimal objects, should have used that for dataUpload/dataDownload/dataTotals instead of String to \navoid all the conversions during calculations. And, of course, Java should not be used to create html code!\n\nWhen running the app, the following environment variables are needed:\n* port (for running locally only, if preferred)\n* profile (eg: local, docker, cloud)\n* time zone (eg: TZ=America/Denver)\n* mongodb database name\n* mongodb username\n* mongodb password\n* router login username (for running locally only)\n* router login password (for running locally only)\n* email address to send/receive (currently same email used to send/receive)\n* email sender/receiver name (current same name used to send/receive)\n* MailJet API Key (public)\n* MailJet API Key (private)\n  Additional environment variables for Sinch SMS\n* phone number provided by Sinch to send SMS\n* phone number to receive SMS\n* Sinch Plan Id\n* Sinch Auth Token\n\nThese variables are included in app.yaml for GCP, Dockerfile or docker-compose.yml for docker, and should be included in the command when running the app locally.\n\nFor example: java -jar -DPORT=7001 -DPROFILE=docker -D\"TZ=America/Denver\" -DDBNAME=mongodb_database_name -DDBUSR=mongodb_username -DDBPWD=mongodb_password -DJSUSR=router_login_username -D\"JSPWD=router login password\" -DAPI_KEY_PUB=mailjet_public_key -DAPI_KEY_PRV=mailjet_private_key -D\"EMAIL=whateversoandso@gmail.com\" -D\"NAME=Whatever SoAndSo (MAILJET)\" -DSENDER=11234567890 -DRECEIVER=10987654321 -DSINCH_PLAN=plan_id -DSINCH_TOKEN=the_token SOMETHING.jar\n\nThe app is deployed here:\n* https://routerstat.appspot.com/ (for HTML display)\n* https://routerstat.appspot.com/?toJson=true (for JSON response)\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbibekaryal86%2Frouter-usage-statistics-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbibekaryal86%2Frouter-usage-statistics-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbibekaryal86%2Frouter-usage-statistics-java/lists"}