{"id":15133210,"url":"https://github.com/wuyenlin/calbot","last_synced_at":"2026-01-19T06:01:00.859Z","repository":{"id":172116665,"uuid":"602851517","full_name":"wuyenlin/calbot","owner":"wuyenlin","description":null,"archived":false,"fork":false,"pushed_at":"2023-06-03T03:20:07.000Z","size":709,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-05T22:31:41.894Z","etag":null,"topics":["aws-ec2","bot","google-calendar-api","koa","line-bot","line-messaging-api"],"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/wuyenlin.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-17T04:18:17.000Z","updated_at":"2023-03-06T03:15:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"4c751552-4a9d-43be-9cea-a6e6fc6b39ca","html_url":"https://github.com/wuyenlin/calbot","commit_stats":{"total_commits":11,"total_committers":2,"mean_commits":5.5,"dds":0.2727272727272727,"last_synced_commit":"0c15f68fb80d360fad391c16daa53d30df2644fa"},"previous_names":["wuyenlin/calbot"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/wuyenlin/calbot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wuyenlin%2Fcalbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wuyenlin%2Fcalbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wuyenlin%2Fcalbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wuyenlin%2Fcalbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wuyenlin","download_url":"https://codeload.github.com/wuyenlin/calbot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wuyenlin%2Fcalbot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28562228,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T03:31:16.861Z","status":"ssl_error","status_checked_at":"2026-01-19T03:31:15.069Z","response_time":67,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["aws-ec2","bot","google-calendar-api","koa","line-bot","line-messaging-api"],"created_at":"2024-09-26T05:00:42.988Z","updated_at":"2026-01-19T06:01:00.832Z","avatar_url":"https://github.com/wuyenlin.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CALBOT\nThis repository hosts a bot written in [Koa](https://koajs.com/) that makes a message block on [LINE messenger](https://line.me/en/) with appointments on Google Calendar by calling [Google Calendar API](https://developers.google.com/calendar/api/v3/reference).\n\n\u003cimg src=\"docs/calendar.jpg\" width=\"300\" /\u003e\n\nThe above screenshot is a given date on Google Calendar. As shown, there are 2 appointments made during the day.\n\n\u003cimg src=\"docs/flex-message.jpg\" width=\"300\" /\u003e\n\nThe app will invoke Google API to get appointments of a given day from the calendar and map it to message form in LINE.\nFurthermore, the \"Ask\" button can be used to reply to a certain event.\n\n## Getting started\nThere are a few steps to take to get the app started:\n\n### LINE Developer Console\nFollow the docuentation [here](https://developers.line.biz/en/docs/messaging-api/building-bot/) to finish the setup.\nAs for the `webhook URL`, let's leave it for later once we setup a public `https` connection and come back to it.\n\nMeanwhile, fill in the keys in `.env` file.\n\n### Google API\nGo to [Google Developers](https://developers.google.com/) and create a project there.\nNavidate to `Google Calendar` and click on `credentials` tab. Here you can create an OAuth 2.0 Client ID for the project.\n\nSelect `Desktop` for Application Type and then you can download the credentials in json format.\n\nRename it to `credentials.json` and place it in project root folder.\n\n### Clone the project\nClone the repo and install dependencies:\n```bash\nnpm install\n```\n\nLaunch the app:\n```bash\ndocker compose up\n```\nNow the endpoint is revealed at `http://localhost:3000`.\nHowever, in order to use the endpoint as a webhook on LINE, it is mandatory to have an `https` link.\n\n### AWS Setup\nCreate a user and follow [best practice in IAM](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html).\nAssign `APIGateway` and `EC2` full access policies to the group where you assign your IAM user.\n\n### Deployment\nThe docker image can be deployed to AWS [EC2](https://docs.aws.amazon.com/ec2/). \nBased on personal experiment, `t2.small` tier with 12GB of storage is enough to host the project.\n\nBinding it with [API Gateway](https://aws.amazon.com/api-gateway/) will then get you an `https` link, which you can put in LINE developer console.\n\n\u003cimg src=\"docs/api-gateway.jpg\" width=\"300\" /\u003e\n\n\n## To-dos\n- [ ] See logging from CloudWatch\n- [ ] Refactor service in serverless fashion, i.e. using Lambda\n\nAny feedbacks are welcomed!\n\n## References\n1. [LINE Developers](https://developers.line.biz/en/docs/messaging-api/nodejs-sample/)\n2. [Google Calendar API](https://developers.google.com/calendar/api/v3/reference)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwuyenlin%2Fcalbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwuyenlin%2Fcalbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwuyenlin%2Fcalbot/lists"}