Open Stridsvagn69420 opened 1 year ago
So like, I finished lé epic 420 dev notes. And I think this concept is way better than what I had in mind before. I just need to figure out how to run something parallel to actix-web, or I guess I'll just do the update if age is equal or larger than maximum age.
I made notes - again (I swear this will become a running gag) - but this time they're pretty solid and better than what I thought was good. You see, this server is supposed to be minimal. If you need a lot of caching, use Nginx or whatever. (As in, it caches the API result.) The only thing it caches is the metadata read from the "database", because of deserialization and I/O operations. The database is also now just JSON files instead of some SQL stuff. It's too much for this small project.
Before I start, I'll check out the entire thing with features and how I manage them the best, since this is both binary and library, after I'm done with the main application. Currently, you'd have to disable the default features and only then set the ones you need. Plus, I wanna exclude the rustls feature for anything that isn't part of the cli feature.
About the submodules and features:
database
contains the, well, database. It stores the music metadata as well as accountsand server maintainers. The structure also allows me to switch to some SQL system if I really need it in the future.config
will be part of the cli
feature because only the server needs it really. It stores database location, TLS cert and key location as well as binding options and the server's metadata like its name. The idea is that a config file points to a set up server. There's a standard path pointing to the config directory that can be overwritten with a flag.server
itself only contains the appstate struct, but is required for the custom middleware
and the essential routes
. The feature separation is there so that crates using this for the REST API won't have to compile actix, but it also allows others to make a customized server with this. Not really useful but hey!I think this crate will have 3 different types of Artist, Album and Track (REST API, Database, Appstate), so I might as well make a Trait for it.
Closes #20
Pull Request for the Rust rewrite. Hopefully I will be satisfied with this. More information will follow.