With the trend of everyone going Rust with their apps like Discord, Bun, Laravel, it's time for me to go Rust as well. Introducing my own Apache Log Viewer.
This log viewer was created with Hy4 Flash model. I made this because I couldn't find a reasonable existing solution that fits my immediate need of finding out which country used the most bandwidth from my organization, under what user-agent. We had GoAccess, CloudFlare Analytics and awstats. While they help to narrow down my findings, it still didn't satisfy. I have been trying to get Grafana up and running, but it is quite a process. So I needed something quick to "filter by cross elements". With OpenCode, I just created my own.
Originally, this app was built with pure HTML, JS, CSS, because remember, it was supposed to be quick. After OpenCode built it, it worked fine. But with log files coming up to 350MB per file, it was getting really hard for a browser to process it in single-threaded Javascript. So I ported the app to Rust, because that's what the cool kids have been doing. I picked Axum for the backend, for I didn't want to overcomplicate the codebase. I might visit it later, once I actually learn Rust. But for now, vibe away.
With v2 Rust version, it was running much faster. Still, I thought, I could squeeze out more performance on the query and filter of the backend. So I asked OpenCode to turn the query multithreaded by parallelizing run_query and monitor CPU usage during testing with heavy log files, making sure the processing reached max CPU utilization. So OpenCode was put into a loop, continuously iterating on the Rust code, building, testing on the parallelized work. Afterwards, performance soared. No query was too hard for the backend to handle. It could search through a maximum of 2GB log aggregated.
So now I'm open sourcing the app. Hopefully someone can find this useful, or at least, give them an idea to start. I even included the backend architecture graph and the original prompts, because even I one day have to revisit this app for understanding. I plan to learn Rust one day, to actually understand the codebase.