{"id":22995661,"url":"https://github.com/eranshmil/github-monitor","last_synced_at":"2025-08-13T22:32:28.363Z","repository":{"id":55615640,"uuid":"160851055","full_name":"eranshmil/github-monitor","owner":"eranshmil","description":"Basic app that monitors an entire GitHub Organization for commits, forks and issues, using Github Webhooks. Demo: https://sml-github-monitor.herokuapp.com","archived":false,"fork":false,"pushed_at":"2020-12-18T00:36:17.000Z","size":1233,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-05-29T06:32:45.801Z","etag":null,"topics":["angular","express","github","mongodb","monitor","nodejs","typescript","webhooks"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eranshmil.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-12-07T16:49:13.000Z","updated_at":"2024-01-09T12:29:15.000Z","dependencies_parsed_at":"2022-08-15T04:31:24.548Z","dependency_job_id":null,"html_url":"https://github.com/eranshmil/github-monitor","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/eranshmil%2Fgithub-monitor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eranshmil%2Fgithub-monitor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eranshmil%2Fgithub-monitor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eranshmil%2Fgithub-monitor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eranshmil","download_url":"https://codeload.github.com/eranshmil/github-monitor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229786916,"owners_count":18123998,"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":["angular","express","github","mongodb","monitor","nodejs","typescript","webhooks"],"created_at":"2024-12-15T05:30:12.442Z","updated_at":"2024-12-15T05:30:12.962Z","avatar_url":"https://github.com/eranshmil.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Github Monitor\n\nBasic app that monitors an entire GitHub Organization for commits, forks, and issues, using Github Webhooks.\u003cbr\u003e\nDeveloped with [Express](https://expressjs.com) and [Angular](https://angular.io).\n\nDemo: https://sml-github-monitor.herokuapp.com\n\n![Screenshot](assets/screenshot.png)\n\n## Table of contents\n\n- [Github Monitor](#github-monitor)\n- [Environment variables](#environment-variables)\n- [Development](#development)\n  - [Debugging with VSCode](#debugging-with-vscode)\n  - [Webhook testing](#webhook-testing)\n- [Production build](#production-build)\n- [Endpoints](#endpoints)\n\n## Environment variables\n\nThe server can read the variables from the `.env` file located in the root path.\u003cbr\u003e\nIf you don't want to use OS's environment variables, such as in your local machine, just create a copy of the file `.env.example` into `.env`.\n\n## Development\n\n1. Clone/fork this project.\n2. Configure environment variables.\n3. Install dependencies:\n\n   ```bash\n   yarn install\n   ```\n\n4. Start the server/client:\n\n   ```bash\n   yarn dev\n\n   # server only\n   yarn dev:server\n\n   # client only\n   yarn dev:client\n   ```\n\n5. Navigate to `http://localhost:4200/`.\n\n- To debug breakpoints outside the scope of the routes, you need to run the script `yarn dev:server:brk`, that changes the `--inspect` flag into `--inspect-brk`.\n\n### Debugging with VSCode\n\nIn order to debug with VSCode instead of Chrome DevTools, there are two options:\n\n1. Go to the Debugger section, choose `Attach to process` and click the play button.\n1. Read about `Node: Auto Attach` feature in the article [Debug Your Node.js App in 60 Seconds by John Papa](https://link.medium.com/5K0J0S3FAS) or in [VSCode documentation](https://code.visualstudio.com/docs/nodejs/nodejs-debugging).\n   ![Using Auto Attach](https://code.visualstudio.com/assets/docs/nodejs/nodejs-debugging/auto-attach.gif)\n\n### Webhook testing\n\nFirst, we need to install a program that exposes our localhost to the internet. If you already use another program, expose port `3000` and skip to the second step.\n\n1. Signup to [ngrok](https://ngrok.com), [download and install](https://ngrok.com/download).\n1. Expose port 3000:\n\n   ```bash\n   ./ngrok http 3000\n   ```\n\n1. Copy the url from the second `Forwarding` line, should look like `https://xxxxxxxx.ngrok.io`.\n1. Goto Settings/Webhooks in your repository, and fill in the form:\n\n   - Payload URL: `https://xxxxxxxx.ngrok.io`\n   - Content type: `application/json`\n   - Secret: The `GITHUB_SECRET` defined in your environment, you could generate a random string using:\n\n     ```bash\n     node -p \"crypto.randomBytes(20).toString('hex')\"\n     ```\n\n   - Let me select individual events: Pushes, Forks, Issues\n\n## Production build\n\n1. Configure environment variables, it's important to set `NODE_ENV` to `production`.\n1. Run build script:\n\n   ```bash\n   yarn build\n\n   # server only\n   yarn build:server\n\n   # client only\n   yarn build:client\n   ```\n\n1. The server code will be bundled in `dist/server.js` and the client in `dist/client`.\n\n- If you use Heroku, you can enable [automatic deploy](https://devcenter.heroku.com/articles/github-integration) and the project will work without any further configuration.\u003cbr\u003e\n  The `postinstall` script will create a build for both server and client.\u003cbr\u003e\n  And the `start` script will run the server that serves the client in the base url of your deployment.\n\n## Endpoints\n\n| Path     | Method | Description                          |\n| -------- | ------ | ------------------------------------ |\n| /        | GET    | Serving the client (production only) |\n| /webhook | POST   | Receive events from Github           |\n| /commit  | GET    | List all commits from PushEvent      |\n| /fork    | GET    | List all forks from ForkEvent        |\n| /issue   | GET    | List all issues from IssuesEvent     |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feranshmil%2Fgithub-monitor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feranshmil%2Fgithub-monitor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feranshmil%2Fgithub-monitor/lists"}