| 1 | --- |
| 2 | title: "Building Critical Infrastructure with htmx: Network Automation for the Paris 2024 Olympics" |
| 3 | description: "Building critical software infrastructure with htmx, and how the simplification induced by this approach is interesting for AI-assisted development." |
| 4 | created: 2026-01-16 |
| 5 | authors: ["Rodolphe Trujillo"] |
| 6 | tags: ["case-studies"] |
| 7 | --- |
| 8 | |
| 9 | ## A Bit of Background |
| 10 | |
| 11 | During my 6 years at Cisco, I developed numerous web applications to assist network engineers with highly complex |
| 12 | operations, both in terms of the volume of tasks to accomplish and the rigor of procedures to follow. Networking is a |
| 13 | specialized field in its own right, where the slightest error can have disastrous consequences: a network failure, even |
| 14 | partial, can deprive millions of people of essential services like the ability to make a simple phone call. |
| 15 | |
| 16 | This criticality imposes strict requirements on code meant for network operations: it must be reliable, readable, and |
| 17 | free of unnecessary frills. If there's a problem, you need to be able to immediately trace the data flow and fix it on |
| 18 | the spot. That's why, for years, I've used very few design patterns and banned function calls that call functions that |
| 19 | call functions, and so on. Beyond 2 levels of calls, I abstain. |
| 20 | |
| 21 | Following this logic, I favor mature tools over the latest trends. Thus, the Django / Celery / SQLite stack had been in |
| 22 | my toolbox for a long time. But like everyone else in the 2010s, I built SPAs and had never heard of intercooler.js or |
| 23 | hypermedia, and I understood REST the way it's commonly described pretty much everywhere. |
| 24 | |
| 25 | For the JS framework, I made a conservative choice (and a marginal one, I know): I chose Ember.js. My motivations were |
| 26 | its strong backward compatibility during updates and native MVC support. This JS framework is excellent, and that's |
| 27 | still my opinion. |
| 28 | |
| 29 | After watching David Guillot's presentation on HTMX at DjangoCon Europe 2022, I dug into the subject and prototyped a |
| 30 | component that addressed one of my recurring needs. It's a kind of datatable on which you can trigger actions. There's a |
| 31 | demo video on the HTMX Discord [here](https://discord.com/channels/725789699527933952/909436816388669530/1042451443656966234). |
| 32 | |
| 33 | I was a beginner with HTMX and built it in 2-3 days (no AI :-) ). But what was interesting wasn't so much having this |
| 34 | component quickly at hand : it was the 100% Django codebase. One codebase instead of two, one app to maintain, and no |
| 35 | more API contracts to manage between front and back. |
| 36 | |
| 37 | And once again, even though I was comfortable with the Ember.js framework, having a single project to maintain changes |
| 38 | everything. |
| 39 | |
| 40 | A few weeks later, a concrete use case came up for a major French ISP: configuring L2VPNs on brand-new routers, in bulk, |
| 41 | without configuration errors (obviously), based on configurations from old routers that were end-of-life and about to be |
| 42 | decommissioned. It was highly critical: a single router can handle thousands of clients, and... there are a lot of |
| 43 | routers. |
| 44 | |
| 45 | From that point on, I used the Django / Celery + HTMX + SQLite (and Hyperscript) stack and delivered the app in 5 weeks. |
| 46 | My goal was to guide the network engineer by the hand and spare them 100% of the repetitive, tedious work: they just had |
| 47 | to click and confirm, everything was handled. Their role was now limited to their expertise, and if there was a problem, |
| 48 | it was up to them to fix the network. |
| 49 | |
| 50 | The project, initially estimated at 18 months, ultimately took 9. And we were lucky: there were no complex corner cases |
| 51 | to handle. And even if there had been, we had plenty of time to deal with them. |
| 52 | |
| 53 | HTMX in all this? |
| 54 | If I had to develop the app as a SPA, it would have taken me at least twice as long. Why? |
| 55 | As a solo full-stack developer, simply switching back and forth between codebases is already time-consuming. And that's |
| 56 | just the tip of the iceberg: the front/back approach itself adds a layer of complexity that ends up weighing heavily on |
| 57 | productivity. |
| 58 | |
| 59 | ## HTMX at the Olympic Games |
| 60 | |
| 61 | The Paris 2024 Olympic Games network consisted of thousands of Cisco switches pre-configured to accept Wi-Fi access |
| 62 | points, which self-configured through an automation system developed by Orange and Cisco. Wi-Fi was the most common |
| 63 | connectivity mode at the Games. But in some cases, a physical connection was necessary, most often to plug in a video |
| 64 | camera, but not only. Sometimes there was simply no other choice but to rely on a cable to connect, and therefore to |
| 65 | configure the relevant switch port. That's where an application became necessary. |
| 66 | |
| 67 | When Pollux contacted me about his need, he already had a data model for his network services in a Django project. |
| 68 | Additionally, he could deploy services via CLI: part of the business logic was already in place. The problem was that |
| 69 | service deployment parameters needed to be consolidated in an application. In CLI, you have to manage different data |
| 70 | sources, which can quickly become complicated for the user. So it was necessary to centralize these business parameters |
| 71 | in a webapp, expose all the data needed to deploy a service, and provide a GUI to configure them. |
| 72 | |
| 73 | The Games were approaching and Pollux didn't have time to build the webapp: as the architect of the Olympic network, he |
| 74 | was overwhelmed by a colossal number of tasks. I showed him the L2VPN app mentioned above and specified the 5-week |
| 75 | delivery timeline. I told him that if it suited him, I could build him an HTMX webapp based on his existing Django |
| 76 | project and a Bootstrap CSS customized internally by Orange. |
| 77 | |
| 78 | We agreed on an 8-week timeline to cover the need, which involved 3 connectivity services: Direct Internet Access, |
| 79 | Private VLAN, and Shared Internet Access. |
| 80 | |
| 81 | ## Web Dev with HTMX |
| 82 | |
| 83 | HTMX is somewhat a return to the roots of web development, and regardless of the web framework: Django, ROR, Symfony... |
| 84 | You rediscover everything that makes a web framework useful rather than turning it into a mere JSON provider. Sending |
| 85 | HTML directly to the browser, storing the app state directly in the HTML. That's what true REST is, and it's so much |
| 86 | simpler to manage. |
| 87 | |
| 88 | If you ask me what's most striking, it's certainly returning to very simple things like this: |
| 89 | |
| 90 | <figure> |
| 91 | <center> |
| 92 | |
| 93 |  |
| 94 | |
| 95 | </center> |
| 96 | <figcaption> Progress bar from RCP Portal </figcaption> |
| 97 | </figure> |
| 98 | |
| 99 | How does this progress bar work? |
| 100 | |
| 101 | Exactly like [the example in the docs](https://htmx.org/examples/progress-bar/)! |
| 102 | |
| 103 | Why this choice? Because it's coded in 10 seconds, because the app won't have thousands of users on this internal tool, |
| 104 | no scaling concerns: you can do good old data polling without any problem. |
| 105 | |
| 106 | And the end user? If I use old-school polling, they don't care: what they want is the information. No SSE or WebSocket |
| 107 | for this use case, I don't need it. And if the need ever arises, the WebSocket (or SSE) plugin is easy to set up. |
| 108 | |
| 109 | One of the big advantages of the philosophy surrounding HTMX is the notion of [Locality of Behaviour](/essays/locality-of-behaviour). Let's take this |
| 110 | progress bar: if you want to know how it works, just look at the page source. No need to go into documentation or the |
| 111 | codebase, just a right-click and "View Page Source": |
| 112 | |
| 113 | ```html |
| 114 | |
| 115 | <div |
| 116 | hx-get="/job/progress" |
| 117 | hx-trigger="every 600ms" |
| 118 | hx-target="this" |
| 119 | hx-swap="innerHTML"> |
| 120 | <div class="progress" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0" |
| 121 | aria-labelledby="pblabel"> |
| 122 | <div id="pb" class="progress-bar" style="width:0%"> |
| 123 | </div> |
| 124 | </div> |
| 125 | ``` |
| 126 | |
| 127 | You immediately know that every 600ms, this part of the page is updated with the content returned by the view handling |
| 128 | the `/job/progress` endpoint. No mystery for the team taking over development who wants to modify something: everything |
| 129 | you need to know is right in front of you. |
| 130 | |
| 131 | And that's exactly what HTMX is about: every component, every interaction remains visible, understandable, and |
| 132 | self-documented directly in the HTML. This is important for what comes next. |
| 133 | |
| 134 | ## HTMX is "AI friendly"™ |
| 135 | |
| 136 | In the early stages of app development, I focused on the most complex network service: DIA (Direct Internet Access). DIA |
| 137 | for the Olympic Games meant many business parameters with many rules to apply. |
| 138 | |
| 139 | The DIA creation form calls an endpoint that triggers a very long function, close to 600 lines of code. |
| 140 | |
| 141 | Why such a long function? |
| 142 | |
| 143 | Because it's more readable and efficient to concentrate the data flow in one place, rather than dispersing it across a |
| 144 | multitude of layers and patterns. |
| 145 | |
| 146 | An application is a wrapper around data: it orchestrates the data flow (data must flow!) and CRUD operations. But what |
| 147 | control do you retain when this flow is obfuscated in complex patterns or dispersed across 2 codebases? |
| 148 | |
| 149 | The data flow must remain readable for the developer. |
| 150 | |
| 151 | HTMX, by allowing you to manage the GUI directly server-side, makes this flow even clearer. The same endpoint can return |
| 152 | HTML fragments to signal that certain form data is invalid, or conversely indicate that a service deployment has |
| 153 | started. You can thus act on any part of the GUI within the same function, while transforming the data to pass it to the |
| 154 | system that configures the network switch. |
| 155 | |
| 156 | In a traditional frontend/backend approach, this would be more complex: two applications to manage, and a much less |
| 157 | readable data flow. |
| 158 | |
| 159 | This drastic code simplification enabled by HTMX, combined with a procedural approach, produces compact and transparent |
| 160 | logic, easy to navigate for a developer... or for an LLM, as I discovered. |
| 161 | |
| 162 | For the Private VLAN (PVLAN) network service, the "shape" of the main function is roughly the same as for DIA: input |
| 163 | parameters, validation, then interactions with the GUI via HTML fragments, and, if everything is correct, switch |
| 164 | configuration. |
| 165 | |
| 166 | The difference? PVLAN is simpler to handle: fewer form parameters and a bit less business logic. |
| 167 | |
| 168 | So I took the long DIA function and gave it to an LLM (Claude 3 had just been released), with a prompt specifying the |
| 169 | parameters specific to PVLAN. In seconds, Claude returned a new adapted function, and the same for the HTML templates. |
| 170 | Result: about 80% of the code was ready, with only a few points to correct and relatively few errors made by the LLM, |
| 171 | which freed up time for me to add specific business logic for a major client. |
| 172 | |
| 173 | For the third network service, Shared Internet Access (SIA), even simpler than the previous two, I provided the LLM with |
| 174 | both the DIA and PVLAN functions. With the magic word *"extrapolation"* in the prompt, the generated code was 95% |
| 175 | correct. |
| 176 | |
| 177 | ## Summary of My Experience |
| 178 | |
| 179 | - **DIA**: 0% AI, 100% handwritten code (business logic + GUI + overhaul of the switch configuration task management |
| 180 | system) → **4 weeks** |
| 181 | - **PVLAN**: 80% AI, 20% handwritten code (corrections + adding specific business logic) → **1 week** |
| 182 | - **SIA**: 95% AI, 5% handwritten code (minor corrections) → **1 day** |
| 183 | |
| 184 | The time saved was reinvested in testing, bug fixes, project management, and even a few additions outside the initial |
| 185 | scope. |
| 186 | |
| 187 | Moreover, the same app was used on the "Tour de France 2025" with minor changes that were made easily thanks to the |
| 188 | hypermedia approach. |
| 189 | |
| 190 | This result is possible because of the combination of *HTMX + the procedural approach*, which produces naturally |
| 191 | readable code, without unnecessary abstraction layers. The data flow is clear, concentrated in a single function, and |
| 192 | the GUI/server logic is directly accessible. |
| 193 | |
| 194 | For an LLM, this is ideal: it doesn't need to construct context through a complex architecture. It just needs to follow |
| 195 | the flow and extrapolate it to a new use case. In other words, what's simpler for the developer is also simpler for the |
| 196 | AI. This is the sense in which HTMX is truly *"AI friendly"™*. |
| 197 | |
| 198 | Ultimately, HTMX mainly allowed me to save time and keep my code clear. |
| 199 | No unnecessary layers, no superfluous complexity: just concrete stuff that works, fast. |
| 200 | |
| 201 | And that has made a big difference on these critical projects. |