Open BjoernPetersen opened 2 years ago
I'm confused already! (at times)
Getting old is tough.
I think we should have more than one architecure diagram:
I've created a rough overview, I left some parts as a blackbox to provide a better overview.
We can expand on this after we've discussed the scope of the different architecture diagrams:
Nice! I think that covers the most important parts.
Since I've recently ran into this problem I'll give a quick rundown of the services, I'll leave out the bus-frontend since it's a self-contained site. This is the current state of affairs, planned features can added later.
Has all the information (connects to postgres)
read-only, shows all unwatched movies
Connects to: api
Current frontend which provides basic functionality for the user (add, delete, ...)
Connects to: api
Provides an api endpoint which returns all movies (plex library type: Movies) from the configured plex servers as json
Currently unused
Other services can send a request for a movie to be added to the download queue
Backend: to be decided
In development
Checks which streaming service (info by werstreamt.es)has which movue and returns this information from an api endpoint
Currently unused
Provides an api which returns information from ImdB about the title requested
Checks for outdated Metadata (e.g. 404 for thumbnails) and tells the api to request new Metadata from the ImdB-resolver
Connects to: ImdB-resolver, api
Best logging impl out there
I'm gonna take another stab at actually creating a diagram, I'll try out a few different libraries/services for doing this.
First up, Ilograph: https://app.ilograph.com/@torben/tim/Dependency
example from d2:
users -> preliminary-frontend users -> telegram-bot preliminary-frontend -> api: Read telegram-bot -> api: Read/Write telegram-bot -> imdb-resolver: Read metadata-updater -> imdb: Read streamingprovider-resolver -> werstreamtes: Read metadata-updater -> imdb-resolver: Read metadata-updater -> imdb: Read metadata-updater -> api: Read/Write plex-resolver -> plex-request: Write streamingprovider-resolver -> plex-request: Read telegram-bot -> plex-request: Write imdb-resolver -> imdb: Read api -> postgres: Read/Write
Doesn't the API make requests to the imdb resolver?
Edit: yes it does. The metadata-updater just tells the API to refresh certain fields of a movie. I think the idea was somehow that the API needs to talk to the imdb-resolver anyway for new movies, so we didn't want to duplicate the imdb-resolver client code in another service.
I'm impressed that no other service has snuck in direct access to the database yet. It's definitely a beautiful mess that we can only make worse.
Doesn't the API make requests to the imdb resolver?
Edit: yes it does. The metadata-updater just tells the API to refresh certain fields of a movie. I think the idea was somehow that the API needs to talk to the imdb-resolver anyway for new movies, so we didn't want to duplicate the imdb-resolver client code in another service.
huh, didn't even know this was the case. I've added this as an additional dependency.
While ilographs pricing model is absolutely insane (especially for our use-case), it still has a very nice set of features; specifically being able to view different perspectives depending on service/parent resource/...
Which makes this part:
I think we should have more than one architecure diagram:
- the group of stakeholders is probably more interested in a rough overview
- a new frontend developer is mostly interested in the API connections
- [...]
fairly trivial.
The export API (exporting standalone HTML) is even more ridiculous
Downside: We're dependent on their service continuation and can only update diagrams manually.
That being said, after the initial completion we'll proabably update this at most once a month (on average) and migrating to another language (such as d2) for the individual perspectives isn't that hard.
I've started this here: https://app.ilograph.com/@torben/kubernetes/
I'll play around a bit with the different concepts so this graph may change/misbehave at any time.
I'm impressed that no other service has snuck in direct access to the database yet. It's definitely a beautiful mess that we can only make worse.
Yeah, I'm amazed too. I think we only violate this (in all of our projects) in woog-life/graphing
since the API doesn't expose every entry.
huh, didn't even know this was the case. I've added this as an additional dependency.
You actually knew once: https://github.com/tim-hat-die-hand-an-der-maus/architecture/issues/8#issuecomment-1091945965
metadata-updater
Checks for outdated Metadata (e.g. 404 for thumbnails) and tells the api to request new Metadata from the ImdB-resolver
But I wouldn't have remembered that either, we're all getting old.
Downside: We're dependent on their service continuation and can only update diagrams manually.
I'm really hesitant to buy into a lock-in like that, but in the end, you're the one spending all that time on it now, so it's mostly your loss if we need to migrate at some point 😬.
huh, didn't even know this was the case. I've added this as an additional dependency.
You actually knew once: #8 (comment)
Do you really expect me to r*ad?
I may share your opinion though.
metadata-updater
Checks for outdated Metadata (e.g. 404 for thumbnails) and tells the api to request new Metadata from the ImdB-resolver
But I wouldn't have remembered that either, we're all getting old.
I had to look at the code to check how it works since the last (code related) commit I've made was March 2022.
But there aren't any missing thumbnails (which was the usual problem) so I guess this works.
Downside: We're dependent on their service continuation and can only update diagrams manually.
I'm really hesitant to buy into a lock-in like that, but in the end, you're the one spending all that time on it now, so it's mostly your loss if we need to migrate at some point 😬.
Yeah, me too. I'll probably write a small tool which converts the ilograph structure to a basic d2-lang structure.
basically
from: x
to: y
simply converts to
x -> y
for each perspective.
Look at Mr. Fancypants over here wanting an architecure diagram
I agree though, it'll become too complicated at some point. some more microservices in.