[Media] I rewrote my backend API in Rust (Axum), fun except for the async-openai types

129 points blocksdev_pro 41 comments
[Media] I rewrote my backend API in Rust (Axum), fun except for the async-openai types

okay so i was thinking of learning rust, as i was constantly seeing rust being mentioned by other sr devs, influencers, or in posts (x, linkedin). so i tried to learn it, started with the syntax, gave it a week and i actually liked it.

after that i tried to make a very simple REST api (basic in-memory todo app). there i learned some axum, State, Async, Result, Arc, etc.. i liked it, like i come from python so its pretty fun to write something like this in rust which i didn't know at all.

then i felt i should write something more and jumped to rewrite one of my backends — simple with basic features (Google OAuth + JWT, OpenAI, Cloudflare R2)

there was this one lib i didn't like at all async-openai like i had to use sooo long types just to make one single api request with an image (will include an image to showcase this 😭). also for the image handling in axum i searched it on google and used the "AI Overview" thing (don't know how that works lol).

Here is the link to the repo if you want to see the codebase: https://github.com/blocksdevpro/rust-backend