![illustration of Rewrite it in Rust: Fun Weekend & Happy Wife](/uploads/blog_posts/12.webp)
Rewrite it in Rust: Fun Weekend & Happy Wife
How I rewrote a pet project in Rust, shipped it within 2 days start-to-finish, and gained social credit along the way.
One of my first web projects I've ever done has been a simple database for my wife to save family recipes to. Usually these kinds of information is scribbled on paper somewhere, or sits as an unordered image gallery on phones, or is buried in long chant histories or email chains - ready to be forgotten. At least, sometimes hard to find, or tedious to "browse".
Since I never trusted any web platform to responsibly keep my data properly, and I want to customize different aspects entirely, I made this by myself. First in Rails (v2!), then with Node.js, and ultimately in Elixir/Phoenix (as an excuse to play with LiveView when it was v0.1). But every time, it was a rather brittle result ultimately, since I used tech I was learning at the time and never revisited that project ever again once I got proficient later.
Now that I am reconciling all my projects to Rust one-at-a-time, which I happen to actually know quite well already, I tried speedrun the whole process. People say that Rust is slow to develop in, right? So lets verify if this holds true!
What's the requirements?
Well first of all, its a handful of CRUD entities. Recipes, Ingredients, ... stuff like that. And some admin UI for my wife to manage stuff - for that HTTP Basic Auth is sufficient, since there is only a single admin user at all. Then there is some image processing involved, mostly to transcode phone uploads to resized webp formats. And ultimately I need some SEO-optimized frontend pages, including fancy stuff like JSON-LD for schema.org. And when everything works, I need to deploy/host that thing somewhere, as cheap as possible.
How did it go?
Suprisingly well actually.
First I started with the database stuff, using SQLite statically linked, together with diesel.rs as the ORM. After writing the initial SQL migrations for the table structures, ChatGPT did a great job of adding the CRUD functions mostly without any help from my side. After a few examples, Copilot even auto-completed the remaining entities in a mostly working state (its usefulness really lives from boilerplate/repetition!). Took roughly an hour to have this sorted.
Next step: add some webserver and build the CRUD UI ontop of the data. This is where any framework like Phoenix/Rails has the upper leg with their code generators.. fair enough. I did it completely by hand using only simple HTTP Forms and bootstrap UI, and got it working nicely in ... approximately 4 hours. But this also included customizing the admin workflows a bit to match my wife's preferences as well as implementing image processing/storage. And most of all, I had to fight a bit with basic auth to get it cryptographically "secure enough" - sometimes in Rust its the "small things" that suddenly eat a lot of time.
Next day (today, actually), I started with the shipping part: CI pipeline via Github Actions, deployment to a cheap DO droplet ($4/mo) by copying the self-contained binary. Took like 15 minutes in total until it was running. The rest of the day was importing the data from the previous projects database, building up the frontend pages, playing with technical SEO (I just like to do this for some reason), and watching my wife using the new thing.
End Result
I could sunset the old attempt first and foremost. I guesstimated that updating all dependencies from that LiveView 0.1 version to recent state-of-the-art code would have needed even more time, and wouldn't have been fun at all for me! So I am happy that I can click "delete" soon (I always wait some grace period before pulling the trigger) - instead of procrastinating needed maintenance work on the old thing.
Also I validated for myself that building things in Rust is much quicker than anticipated. Especially now that I made a boilerplate including all my learnings/hacks so that I can ship the next thing in probably not even a day! Not to mention the thing is so fast and efficient that even the $4 DO droplet is actually oversized.
And finally, its a nice marriage day present as well as a cool together-activity on the weekend or evenings to actually ship something, for personal use only, that doesn't suck! Not to mention next time I hear the question "what do you want to eat?" I feel much better just responding with a link to one of our recipes!
Have you also tried RiiR: Rewrite it in Rust?
- Number of words: 748
- Reading time: 4 minutes
- Posted: 3 months ago
Linked Categories
Click around and find out ↓
![illustration of Technology](/uploads/blog_categories/3.thumbnail.webp)
Technology
Stay ahead of the tech curve! Discover cutting-edge tools, trends, and insights tailored for solopreneurs and indie hackers driving innovation.
![illustration of Indie Hacking](/uploads/blog_categories/6.thumbnail.webp)
Indie Hacking
Dive into the world of solo entrepreneurship. Get insights and strategies for building successful, self-reliant tech businesses.
![illustration of SEO](/uploads/grimoire_categories/1.thumbnail.webp)
SEO
Make your digital content discoverable and digestable by web crawlers. Ensure that visitors have a straightforward experience.
![illustration of Rust](/uploads/grimoire_technologies/11.thumbnail.webp)
Rust
A language empowering everyone to build reliable and efficient software. Futuristic swiss army knife and probably the most powerful mainstream technology today
Portfolio Links
See the stuff I made ↓
![illustration of fresh bites](/uploads/portfolio_assets/1.thumbnail.webp)
fresh bites
Personal cooking recipe collection for my wife (in german). Enhanced with customized relations between recipes, ingredients and units.
![illustration of Website](/uploads/portfolio_categories/1.thumbnail.webp)
Website
A basic web 1.0 website that is solely server-rendered HTML and optionally a small database, without any multi-user capabilities except for a single admin area.
![illustration of Empathy](/uploads/portfolio_stages/2.thumbnail.webp)
Empathy
Discovering and understanding deeply the pain points of your niche market.
Related Posts →
![illustration of Custom GPTs vs OpenAPI path parameters](/uploads/blog_posts/14.thumbnail.webp)
Custom GPTs vs OpenAPI path parameters
3 months agoSeems that the AI can't do idiomatic API calls for a RESTful interface after all - or their HTTP client has some bug.
![illustration of GPT4o Just Landed And Will Be Free For All!](/uploads/blog_posts/13.thumbnail.webp)
GPT4o Just Landed And Will Be Free For All!
3 months agoThe latest OpenAI ChatGPT model just got reveiled and it will be free for everyone - but more importantly: the GPT Store will be, too!
![illustration of The joy of traditional SSR website development](/uploads/blog_posts/11.thumbnail.webp)
The joy of traditional SSR website development
4 months agoHow I got my sanity back after years of JavaScript madness. Building websites finally is fun again - plus hosting and maintenance is much better!
![illustration of The Solopreneur and AI assistants](/uploads/blog_posts/10.thumbnail.webp)
The Solopreneur and AI assistants
4 months agoMy thoughts about how solopreneurs and indie hackers can leverage AI tools to delegate work tasks without having employees or paying freelancers.
![illustration of Digital Assets](/uploads/blog_posts/9.thumbnail.webp)
Digital Assets
4 months agoLearn how to categorize, build, and leverage digital products like websites, chat assistants, ebooks, and apps to create a sustainable lifestyle business.
Latest Posts →
![illustration of Custom GPTs vs OpenAPI path parameters](/uploads/blog_posts/14.thumbnail.webp)
Custom GPTs vs OpenAPI path parameters
3 months agoSeems that the AI can't do idiomatic API calls for a RESTful interface after all - or their HTTP client has some bug.
![illustration of GPT4o Just Landed And Will Be Free For All!](/uploads/blog_posts/13.thumbnail.webp)
GPT4o Just Landed And Will Be Free For All!
3 months agoThe latest OpenAI ChatGPT model just got reveiled and it will be free for everyone - but more importantly: the GPT Store will be, too!
![illustration of The joy of traditional SSR website development](/uploads/blog_posts/11.thumbnail.webp)
The joy of traditional SSR website development
4 months agoHow I got my sanity back after years of JavaScript madness. Building websites finally is fun again - plus hosting and maintenance is much better!
![illustration of The Solopreneur and AI assistants](/uploads/blog_posts/10.thumbnail.webp)
The Solopreneur and AI assistants
4 months agoMy thoughts about how solopreneurs and indie hackers can leverage AI tools to delegate work tasks without having employees or paying freelancers.
![illustration of Digital Assets](/uploads/blog_posts/9.thumbnail.webp)
Digital Assets
4 months agoLearn how to categorize, build, and leverage digital products like websites, chat assistants, ebooks, and apps to create a sustainable lifestyle business.