Beyond Systems and Engines: How WebForms Core Brings Modern UI Control to C++ Web Development

C++ has long reigned as the undisputed titan of high-performance computing. From powering complex game engines and low-level embedded systems to managing massive cloud infrastructure, operating systems, and networking protocols, the language is synonymous with raw execution speed and absolute memory control. Yet, despite its ubiquity across desktop and backend environments, web application development has traditionally remained the domain of languages like JavaScript, TypeScript, Python, Go, and C#.
Can C++ truly break out of the backend and manage modern, interactive web interfaces with server-side control?
According to recent developments from the Elanat framework team, the answer is a definitive yes. Through the introduction of WebForms Core (WFC)—specifically its C++ adaptation—developers can now construct interactive, dynamic web applications entirely from a C++ server environment, bypassing the need for separate frontend frameworks like React, Vue, or Angular.
Main Facts: Bridging the C++ Server to the Browser DOM
The core innovation behind WebForms Core is its server-side UI manipulation paradigm. Instead of treating the client browser as an independent application that communicates with a headless API, WFC allows a server-side application to emit precise commands that manipulate the browser’s Document Object Model (DOM).
The technology relies on a simple yet powerful division of labor:
- The C++ Server processes HTTP requests, executes business logic, and formulates UI update operations utilizing the
WebForms.hheader. - WebFormsJS acts as a lightweight browser-side executor, interpreting the commands sent by the server and applying them directly to the HTML DOM.
This architecture fundamentally alters the traditional full-stack paradigm. Developers are no longer required to set up complex frontend build pipelines, JSX compilers, or package managers. Instead, a C++ application can serve clean, standard HTML while dynamically driving user interface behaviors natively from server-side code.
C++ Server
↕
WebForms Class
↕
Action Controls
↕
WebFormsJS
↕
HTML DOM
Chronology and Integration: The Header-First Ecosystem
The journey toward native C++ web control began with the broader vision of the Elanat framework, which sought to bring unified UI control paradigms across multiple backend languages. Recognizing the fragmented nature of C++ package management—where ecosystems range from Conan and vcpkg to simple manual header inclusion—the maintainers made a strategic architectural choice.
Rather than forcing developers to adopt a specific package manager, the WebForms Core C++ implementation is distributed as a single, self-contained header file: WebForms.h.
Setting Up the Project Structure
To build a functional C++ web server using this architecture, developers typically pair WebForms Core with cpp-httplib, a popular, header-only C++ HTTP/HTTPS server and client library developed by yhirose.

A standard project structure is remarkably lightweight:
C++ Web Project/
├── main.cpp
├── WebForms.h
├── httplib.h
├── api/
│ ├── video.json
│ └── template.html
└── script/
└── web-forms.js
This direct header-based integration means that httplib.h handles the networking layer (incoming HTTP requests and outgoing responses), while WebForms.h handles the programmatic generation of UI manipulation commands.
Supporting Data: Building a Form-Based Application in C++
To understand how this functions in practice, consider a basic C++ application that receives form inputs, processes them, and modifies the DOM dynamically.
Initializing the Server and View
First, standard C++ libraries are included alongside the networking and UI headers:
#include <iostream>
#include <string>
#include "httplib.h"
#include "WebForms.h"
using namespace std;
using namespace WebFormsCore;
The server can then render a standard HTML form using a backend string-rendering function:
string backEndRender(const string& viewName)
if (viewName == "view")
return R"(<!DOCTYPE html>
<html>
<head>
<title>Using WebForms Core</title>
<script type="module" src="/script/web-forms.js"></script>
</head>
<body>
<form method="post" action="/">
<label for="txt_Name">Your Name</label>
<input name="txt_Name" id="txt_Name" type="text" />
<br>
<label for="txt_FontSize">Set Font Size</label>
<input name="txt_FontSize" id="txt_FontSize" type="number" value="16" min="10" max="36" />
<br>
<label for="txt_BackgroundColor">Set Background Color</label>
<input name="txt_BackgroundColor" id="txt_BackgroundColor" type="text" />
<br>
<input name="btn_SetBodyValue" type="submit" value="Click to send data" />
</form>
</body>
</html>)";
return "<h1>View not found</h1>";
Server-Side UI Manipulation on POST Requests
When a user submits the form via a POST request, the C++ server intercepts the payload, extracts the parameters, and instructs WebForms Core to execute specific DOM alterations:
svr.Post("/", [](const httplib::Request& req, httplib::Response& res)
if (req.has_param("btn_SetBodyValue"))
int fontSize = std::stoi(req.get_param_value("txt_FontSize"));
std::string backgroundColor = req.get_param_value("txt_BackgroundColor");
std::string name = req.get_param_value("txt_Name");
WebForms form;
form.SetFontSize(InputPlace::Tag("form"), fontSize);
form.SetBackgroundColor(InputPlace::Tag("form"), backgroundColor);
form.SetDisabled(InputPlace::Tag("btn_SetBodyValue"), true);
form.AddTag(InputPlace::Tag("form"), "h3");
form.SetText(InputPlace::Tag("h3"), "Welcome " + name + "!");
res.set_content(form.Response(), "text/plain");
else
res.set_content(backEndRender("view"), "text/html");
);
Instead of simply returning raw JSON data to be parsed by a heavy client-side framework, the C++ server issues explicit UI commands—changing font sizes, altering background colors, disabling buttons, and injecting new header elements (<h3>) directly into the response stream.
Practical Implementation: Building an Interactive Video Player
WebForms Core is not restricted to basic form submissions and text styling. To demonstrate its capacity for handling complex, stateful components, developers can build an interactive video player that dynamically loads media assets from a JSON catalog.
Exposing JSON Data and HTML Templates via C++
The server exposes an API endpoint to serve a local JSON file containing video metadata:

svr.Get("/api/video.json", [](const httplib::Request&, httplib::Response& res)
string content;
if (!readFile("./api/video.json", content))
res.status = 500;
res.set_content("Cannot read api/video.json", "text/plain");
return;
res.set_content(content, "application/json");
);
Generating Dynamic UI Loops
Using WebForms Core, the C++ application caches the video data, loops through the JSON array, and dynamically populates an HTML <template> element:
WebForms form;
form.NotExist(Fetch::Cache("video-data"));
form.AddCacheValue("video-data", Fetch::LoadUrl("/api/video.json"));
form.ForEach("[0]", Fetch::Cache("video-data"), "foreach-data");
form.StartBracket();
form.AddText("video-container", Fetch::LoadHtml("/api/template.html", "Video"));
form.BindJSONToTemplate("video-card-1", Fetch::FormatStore("foreach-data"), "[0]", "value");
form.SetCommentEvent("video-card-1|<>", HtmlEvent::OnClick, "play-video");
form.EndBracket();
When a user clicks on a dynamically generated video card, the registered play-video action fires on the server, updating the source attribute of the HTML5 <video> element and updating the "Now Playing" status indicator without requiring a full page reload.
Official Responses and Developer Integration
The reception of header-based C++ web tooling highlights a broader industry desire to minimize architectural bloat. While modern web development has drifted toward micro-services, heavy node-based toolchains, and complex client-side reconciliation engines, projects like WebForms Core offer a streamlined alternative for high-performance domains.
By keeping the application logic entirely within compiled C++, development teams eliminate vulnerabilities associated with complex JavaScript dependency trees. Furthermore, because WebForms.h and cpp-httplib operate independently without strict mutual dependencies, developers retain total freedom over their compilation flags, optimization levels, and build scripts.
Implications for the Future of C++ in Web Architecture
The integration of WebForms Core into the C++ ecosystem challenges the conventional wisdom that web applications must be built on top of web-native languages. While C++ will likely not replace JavaScript for highly complex, offline-first Single Page Applications (SPAs), the paradigm opens up fascinating possibilities:
- Edge and Embedded Web Dashboards: IoT devices and routers running minimal C++ backends can now serve fully interactive management consoles without needing bloated web servers or embedded Node.js runtimes.
- High-Performance Micro-Webservers: Financial trading platforms, telemetry systems, and gaming servers can expose real-time diagnostic web UIs natively from their core operational binaries.
- Simplified Deployment: Compiling an entire web application—routing, business logic, UI orchestration, and asset serving—into a single, self-contained binary drastically simplifies containerization and deployment pipelines.
Conclusion
Web programming in C++ is no longer a theoretical curiosity. Through the collaboration of cpp-httplib for networking and WebForms Core for server-side UI manipulation, developers can harness the raw performance of C++ to build fully interactive web interfaces.
Supported by Elanat and available directly via open-source repositories, this stack provides a compelling alternative for engineers seeking to bypass frontend framework fatigue and maintain total control over their web applications right from the server.
