Showcase: Axium, an example API
from BitsandBytes@lemmy.world to rust@programming.dev on 01 May 17:02
https://lemmy.world/post/28964135

Hi there Rustians! A few months ago I posted about my hobby project. Just wanted to give an update.

Axium is a template for an API backend.

In the last few months I have added:

I think that it is almost ready to be used as a backend for my website. Almost everything is marked off my wishlist, just need a few helper to help me check the security of the authentication and registration functions.

GitHub: https://github.com/Riktastic/Axium

#rust

threaded - newest

BB_C@programming.dev on 02 May 01:04 collapse

Very quickly skimmed Cargo.toml and main.rs.

  • What’s with the title-case name?
  • The name proximity to axum is also not cool.
  • You should mention that this is built on top of axum in the project description.
  • How did you end up using both lazy_static and once_cell, when OnceLock has been stable since 1.70 and axum’s MSRV is 1.75?
  • Why did you copy-paste min-sized-rust flags?
  • You can actually print like this:
println!("{proto}://{ip}:{port}");

instead of

println!("{0}://{1}:{2}", proto, ip, port);

and the positional indices are redundant anyway.

  • Since you’re depending on tracing, you should actually use tracing::error instead of eprintln!(“❌ …”).

Okay. I will stop here.

BitsandBytes@lemmy.world on 02 May 08:26 collapse

Hi there, thank you for your feedback!

Not sure what you mean with title case name. Nevertheless, I chose a name with proximity to actually show that this project is implementing Axum. It took a long time before I could find a name that was unique (I know it might seem silly to just add a letter).

The README.md and GitHub project description mention Axum.

Didn’t know about OnceLock. Some modules were created weeks apart from each other. During this time I might have forgotten that I used a similar library.

Didn’t know about the min-sized-rust project. Found these suggested by a few users on Reddit.

Oh cool, I do not print that often. Looks a lot cleaner.

Those eprints, uhm. Might sound silly. Haven’t thought about implementing it using tracing. Might have been a bit lazy. It worked fine in the datbase module, copied it afterwards over to the Redis/S3/mail modules.

Thank you for your feedback!

I’m not a full time programmer. Feedback helps me to improve myself :)

BitsandBytes@lemmy.world on 02 May 20:38 next collapse

Ps, I already have fixed a few things.

BB_C@programming.dev on 03 May 02:34 next collapse

The uppercase A in Axium.

PolarKraken@programming.dev on 03 May 04:05 collapse

Just wanna say, great job on the feedback reception. Critically important (and often hard!!) skill, to get the value while leaving the ego-hit. If you handle criticism this well as a non-fulltime-dev, on a project you care about and that you have solo’ed - I have a feeling you have a lot of dev potential.

BitsandBytes@lemmy.world on 03 May 15:07 collapse

Thank you kindly!