Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR for new improved Rust version #38

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft

Conversation

Stridsvagn69420
Copy link
Owner

@Stridsvagn69420 Stridsvagn69420 commented Aug 24, 2023

Closes #20

Pull Request for the Rust rewrite. Hopefully I will be satisfied with this. More information will follow.

@Stridsvagn69420 Stridsvagn69420 added bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request help wanted Extra attention is needed dependencies Pull requests that update a dependency file labels Aug 24, 2023
@Stridsvagn69420 Stridsvagn69420 self-assigned this Aug 24, 2023
@Stridsvagn69420
Copy link
Owner Author

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.

@Stridsvagn69420
Copy link
Owner Author

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.

@Stridsvagn69420
Copy link
Owner Author

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!

@Stridsvagn69420
Copy link
Owner Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Core] Make the code base prettier or switch to new language entirely
1 participant