The original code that goes with this video I think did Go dirty.
Haven't made a docker container yet but if you have Task and Go 1.23.3 installed you can run the following:
task tools
task -w
- 321LOC of Go across 6 files (including HTTPServer) and ~125LOC of Templ across 3 files for UI. Could be one of each but tried to match the spirit of the original.
- Templ could be shorter but expanded lines for readability.
- Pretty sure it's the smallest codebase of any of the apps in the original.
- Metrics
- I'm pretty sure it's the fastest (queries take < 1ms on my machine)
- Smallest memory footprint (19MB sustained) of any of the apps in the original.
- It handles speculation rules asynchronously for precaching the pokemon images.
- Use pure Go SQLite so N+1 queries are not a problem.
- It's a single binary with no dependencies.
- Datastar
- One time cost of 12KiB of JS.
- Handles all UI interactions and backend communication.
- The version is ALL the plugins we are only using a handful of them for this demo
- No websockets, just normal HTTP requests that can work on HTTP 2/3.
I hope this clear up why it's not
~ Theo