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:

  • HTTP-cookie authentication (got it to work with a javascript site),
  • Password resetting,
  • User registration,
  • Example routes for interacting with S3 storage
  • Lots of input validation,
  • Caching,
  • Mailing (for the password reset and user registration).

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

  • BB_C@programming.dev
    link
    fedilink
    arrow-up
    13
    ·
    3 days ago

    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.worldOP
      link
      fedilink
      arrow-up
      7
      ·
      3 days ago

      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 :)