Update: < /Devember> Version 1.0 is here wooo!
Yay! Version 1.0 get!!11111
After a gruelling fight with a horde of pissed off crabs, I’m done
Production deployment here:
http://beer.omoshirokunai.website:8000
Screenshot of app from phone screen:
Version 1.0 of code together with comments and README is up on my git:
Conclusion
I can’t believe I did it! At one point i thought the crabs would get me for sure but now who’s sipping on some sweet crab bisque? hehehe.
I have learned so much throughout this and achieved everything that I really wanted to get.
- Learned Rust ✓
- Learned Rocket, Handlebars, MySQL Rust libraries ✓
- Built a database and improved my SQL knowledge ✓
- Improved my python code to write to a DB or CSV ✓
- Built a web app to display my Brewing Statistics ✓
- Deployed on Linode using the Level1techs offer ✓
In reflection I am very glad where version 1.0 is.
Thoughts and future work
Rust is the worst language for beginners. Honestly, learning assembly is easier and with better beginner examples and documentation. The libraries are not very well maintained or documented for beginners either. A great example of this is that the mysql library’s example code won’t actually work with the current version and you will need to consult your local Rust priest to help exorcise your haunted code (Thank you for all your help getting me out of that mess; you know who you are! Sacrifices will be made to the local crab population). Rust is also very bloated. I could not believe the amount of sub libraries required. I know that languages like python abstract a lot of that away but good heavens those Rust projects are really big for such simple code. I’m still glad to have begun learning it; especially in the context of web development and database access. Whilst building this I also looked at all the other Rust options and have learned lots about what’s out there.
Mysql is a pretty standard and accessible database. Watch out for the networking gotcha’s when deploying the docker containerised version. That screwed me for a while. Other than that, it was cool to finally build my own database after years of wrecking other peoples.
Python remains my beloved fatty snake. I will continue to unappolegetically, overuse it for everything I do. It’s so good for what it does and I refuse to give it up.
Nginx has fucked me a little, which is annoying! I like Nginx very much and use it for my main website (other project) just fine. For some reason however trying to get it to play nicely as a proxy for Rust has failed and it’s sulking aggressively. This means that, for now, my web app is over http but as mentioned, that’s for now as this is in no way sensitive data and all user input is carefully sanitized AND I’m not planning on connecting to any dodgy WiFi anytime soon as, given the global situation, travel is not on the cards.
I hate JavaScript and was really sad to have to use it here but did the best I could to secure it (specific version and integrity hash in source code). Unfortunately, it was a mountainous task for me to create anything even close in HTML5 - though I did have a good go at it!. So I’m stuck with third party JavaScript nonsense for now.
CSS remains a sulky teenager that only does half of what you ask and even then only some of the time. I still managed to wrangle together a web app that looks asthetically pleasing, displays all the info I need and is very readable. The biggest caveat to that however is it is very much optimised to use on mobile as this is where I will be accessing the app from most of the time. If you try and access the app in full screen on a desktop, it looks bad but if you resize the browser to something sensible it looks good. This is also fine for me as I will always only ever be looking at a desktop browser in a small factor to the side of my screen. So fortunately, there is no great need to get the CSS any better. But this is definitely something I will look into for future versions.
Other things that future versions will have include an admin interface to upload notes and things via the web app.
So all in all I’ve hit nearly everything including all stretch goals and am very pleased with my project
Happy holidays all! I hope you all enjoyed my suffering and your own Devember projects.
[p.s Good grief the price of domains has gone through the roof! WTF? I tried to get a nice domain and then a bearable domain and both were inordinately expensive. So, I stuck it on a subdomain to my other (unrelated) site. ]