{"id":14979706,"url":"https://github.com/spedrickson/ytchat-backend","last_synced_at":"2025-10-28T19:31:59.694Z","repository":{"id":181130419,"uuid":"478474531","full_name":"spedrickson/ytchat-backend","owner":"spedrickson","description":"nestJS backend for ytchat mod tools","archived":false,"fork":false,"pushed_at":"2024-12-05T10:09:19.000Z","size":1860,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-01T17:51:11.196Z","etag":null,"topics":["mongodb","nestjs","nestjs-backend","youtube","youtube-channel","youtube-live","youtube-live-chat","youtube-livestream"],"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/spedrickson.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":"2022-04-06T08:41:50.000Z","updated_at":"2024-12-05T10:09:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"e0f8f91b-1971-4ffe-9a1f-32c07e42f178","html_url":"https://github.com/spedrickson/ytchat-backend","commit_stats":{"total_commits":63,"total_committers":4,"mean_commits":15.75,"dds":"0.23809523809523814","last_synced_commit":"3b007b34900e01207e765fc331b2f13ec5bda56b"},"previous_names":["spedrickson/ytchat-backend"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spedrickson%2Fytchat-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spedrickson%2Fytchat-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spedrickson%2Fytchat-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spedrickson%2Fytchat-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spedrickson","download_url":"https://codeload.github.com/spedrickson/ytchat-backend/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238710292,"owners_count":19517677,"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":["mongodb","nestjs","nestjs-backend","youtube","youtube-channel","youtube-live","youtube-live-chat","youtube-livestream"],"created_at":"2024-09-24T14:00:31.677Z","updated_at":"2025-10-28T19:31:54.287Z","avatar_url":"https://github.com/spedrickson.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## About\n\nBackend API service for YouTube chat history written in NestJS. Requires a configured MongoDB instance to connect to.\n\nSwagger documents will also be generated automatically when running.\n\nThis was started as a practice project to learn NestJS and JS/TS in general. Some things about it may strange or incorrect, feel free to point out any issues.\n\n## Limitations\nCurrently, this supports one Youtube channel per active process, determined by the `YTCHAT_CHANNELID` environment variable. \n\nThis means supporting multiple channels will require multiple containers each with their own port. \n\nAlso, the swagger documentation is currently auto-generated and needs to be filled out more clearly.\n\n## Installation\n\n```bash\n# from the source directory\n$ npm install\n```\n\n## Configuration\nBefore launching, set any necessary environment variables. \n```bash\n# bash\nYTCHAT_CHANNELID=...\n```\n\n```bash\n# powershell\n$env:YTCHAT_CHANNELID = \"...\"\n```\n\n\n#### Supported variables\n| Variable                   | Purpose                                                                                                                                                               | Default                                     |\n|----------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------|\n| YTCHAT_CHANNELID           | Which MongoDB collection should be queried.                                                                                                                           | `UCrPseYLGpNygVi34QpGNqpA` (Ludwig)         |\n| YTCHAT_BACKEND_PORT        | Which port the backend API should listen on.                                                                                                                          | `3000`                                      |\n| YTCHAT_BACKEND_MONGOSTRING | The [MongoDB Connection String](https://www.mongodb.com/docs/manual/reference/connection-string/). The DB is selected with the above `YTCHAT_CHANNELID` env variable. | `'mongodb://user:password@127.0.0.1:27017'` |\n \n#### API Keys/Authentication\nThe backend uses API keys with associated permissions for authentication. Each channel DB should have a collection called `users` that stores these API keys/permisisons. There's currently no built-in method for generating keys/permissions, so they will have to be inserted into the DB manually.\n\nAn example user (in JSON format) is as follows:\n```json\n{\n  \"name\": \"user's name\",\n  \"apikey\": \"any_unique_string\",\n  \"isAdmin\": false,\n  \"perms\": {\n    \"view\": true,\n    \"comment\": false,\n  }\n}\n```\n\n##### Permissions:\n`isAdmin`: Should override all other permissions, and allow full access to viewing/commenting/etc.  \n`view`: Can read chat history for users/perform queries on the filtered page.  \n`comment`: Can leave mod comments for users.\n\n\n## Running the app\n\n```bash\n# development\n$ npm run start\n\n# watch mode\n$ npm run start:dev\n\n# production mode\n$ npm run start:prod\n```\n\n## Testing\n\nThis was started as a personal practice project, so I didn't write any unit tests even though I definitely should have. \n\nNestJS will generate some boilerplate unit tests if you'd like to add some, feel free to submit a pull request if so!\n\n## Support\n\nFeel free to submit any issues or pull requests. No warranty or support is guaranteed beyond that. \n\n## License\n\nThis code is under the [MIT license](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspedrickson%2Fytchat-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspedrickson%2Fytchat-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspedrickson%2Fytchat-backend/lists"}