Fun Apps with FastHTML - Part 1
— 2 min read
As a software engineer I think it's a good idea to always be cultivating tools that you use in certain situations. One such tool I like to have in my arsenal is a quick way of creating webapps. For me these have a variety of usecases - visualising data, blogging, creating quick dashboards for internal tooling etc. So I was pleased to see that Jeremy Howard (of FastAI fame) and the team at AnswerAI have made a new framework called FastHTML, with the aim of abstracting away the annoyances and complexities of HTML, and allowing users to knock up quick (or more involved should you feel inclined) web apps in pure python.
When I'm learning new frameworks I typically like to use existing examples, write out the code myself, but tweak a major feature to something that I find particularly interesting or useful. My idea in this case is to take the cool idea from https://distilhn.com/ and apply it to something I'd like to use, which is to summarise my gaming news for the day. I most commonly use Eurogamer for my day to day news, so I've used their RSS feed to parse their news articles and summarise them with OpenAI's gpt4o-mini model. It seems to work quite well! The code is here: Gamer news for you to take a look at / repurpose as you see fit.
Generally I think these sort of frameworks are very useful, but won't be replacing any production web apps any time soon. For me it's really useful to have this tool in my kit, and be able to quickly spin up a web app even to prototype internal tooling at work is great. You could probably do the same just as easily with HTMX / FastAPI and there is an element of FastHTML "standing on the shoulders of giants" so to speak (but isn't that all software?). However what FastHTML provides you is the simplicity of working purely in python, and a very simple way to build and deploy web apps.
I want to keep making little apps like this to learn and test out the framework, so keep an eye out for the next parts in this series. The next one may be to rewrite this blog in FastHTML and make it look super super cool...