spedrickson / ytchat-backend Goto Github PK
View Code? Open in Web Editor NEWnestJS backend for ytchat mod tools
License: MIT License
nestJS backend for ytchat mod tools
License: MIT License
Currently ytchat-backend only supports a single YouTube channel per instance, configured through the YTCHAT_CHANNELID
environment variable.
Instead, it should be refactored to accept channelID as a query parameter.
Steps needed for this enhancement:
YTCHAT_CHANNELID
env variablesrc/user/schemas/user.service.ts
that accepts a channelID and API key, and returns the auth details.Currently there is a scalability problem with the fillAuthorCache()
function. As-is, it asks MongoDB to perform the following aggregation:
This means that it's using O(n) space complexity, with N as the number of unique users that have left a message since ingest began. And if the MongoDB host doesn't have enough memory, it'll become IO-bottlenecked by writing partial results to disk.
This also means the backend is using O(n) space to store this information, which may not be best practices.
Currently takes ~3 minutes to run against 1.1m users, and will continue to grow from there.
fillAuthorCache()
function to a fillAuthorCollection()
function, which uses aggregation to store the author data in the DB as a separate collection named authors
.getAuthorBySearch()
endpoint function to search database instead of local authorCache
. Will need to investigate possible solutions to maintain fuzzy search, or change it to simple text matching and/or regex.refreshAuthorCache()
function to update the authors
collection, rather than pulling new authors into the backend's authorCache
.authorCache
entirely, now that it is unused.A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.