Single-File Web Apps

Question: What is the most durable, portable, and secure form of software?
Answer: Single-File Web Apps (with the exception of biological software).

Definition

HTML FileSingle-File Web Apps (SFWAs for short) are a type of Single page web apps that it is composed of only a single static HTML file with no external dependencies (including external images, JavaScript, CSS, etc), and no server components (besides an HTTP Server whose only job is to return the single HTLM file). Note that the HTML file CAN contain javascript, css, and images - as long as they are embedded in the single HTML file.

Why SFWAs are the most portable and secure type of software

Single-File Web Apps are portable simply because they are web apps. All web apps have the ability to run on virtually all types of devices (laptops, tablets, and smartphones) and on virtually all operating systems (Windows, OS X, Linux, iOS, Android, etc). To clarify: SFWAs are no more portable than typical web apps, but web apps are themselves the most portable form of computer software today.

Single-File Web Apps are more secure than typical web apps because:

  • SFWAs are not subject to Supply Chain Attacks (which are becoming more prevalent).
  • SFWAs have way less attack surface due to being only a single HTML file. No server components cuts out most of the attack surface.
  • Lastly, since SFWAs are just single HTML files, you can download and run them completely offline. And once a SFWA is downloaded, it is virtually un-hackable (as there is no way to modify them without compromising the entire computer). The ability to run an app offline also allows you to ensure that the app is not sending any data anywhere else.

Why SFWAs are the most durable type of software

Here is what a Single-File Web App architecture looks like:




So the only components in a Single-File Web App are:

  • The HTML file
  • An HTTP Server (optional)
  • The user's browser

It's also worth noting that HTTP Servers, when used only to server simple files like an HTML file, are standardized and interoperable (as contrasted with more complex components like Application Servers). In fact, if you have Python installed on your computer, all you need to do to run a simple http server is to run this command in a Terminal: python3 -m http.server 8000

This architectural simplicity greatly increases the durability of Single-File Web App.

Futhermore, you don't even need a server to use a Single-File Web App. Since a SFWA is just a single file, it can be downloaded and simply opened in a browser (usually by double-clicking the file or doing File -> Open in the browser. This means that a SFWA can continue to function even if the original website goes down. This obviously increases durability.

Additionally, since a SFWA is just a single file, it can be distributed in a variety of ways such as mirror HTTP servers, FTP, Email, USB drive, etc. This easily-distributable nature of Single-File Web App further increases their durability.

By comparison, here is what a simplified typical web app architecture looks like:




Note how many links and servers are in the typical web app compared to a Single-File Web App. Each of these links is a potential place that can break (whether through intentional hacks or just due to software incompatibilities). And typically, there are many external libraries used in web apps - each representing potential attack surface for hackers.

It's clear how the simpler infrastructure required for Single-File Web App (compared to typical web apps) makes them much more durable.

Software rot Software rot (software becoming unusable over time due to a variety of factors) is a serious issue. According to ChatGPT and Google, the "average software lifespan" is only 6-8 years! The main cause of software rot is incompatibilities between the software and libraries and other infrustructure upon which they rely.

Since Single-File Web App have no external dependencies and require only a browser to run, they should be far less susepctible to software rot than other types of software.

Examples SFWAs

I'd like to give 2 examples of SFWAs that I wrote.

FuzzyGraph

FuzzyGraph screenshot The first example SFWA is called FuzzyGraph. FuzzyGraph is a whole Fuzzy/Non-Binary Graphing App in a single ~1.3Mb file (as of 2025-10-31). There is a Download button near the top of FuzzyGraph, to download a local copy of FuzzyGraph.html.




Hypervault

Hypervault screenshot The second example is called Hypervault. Hypervault is a competely self-contained File Encryption App that works in a peculiar way... it outputs another stand-alone Single-File Web App that contains both the Hypervault User Interface and logic to decrypt the data, as well as the encrypted file data itself. Hypervault also uses 3 separate ciphers, along with some other security measures to reduce chances of brute-force attacks. So it is very secure. And it can run completely offline. You can do File -> Save Page As on Hypervault to save a local copy of Hypervault.html.

And since Hypervault is a Single-File Web App and has all the benefits (such as portability and durability), it is an incredibly secure and safe way to secure sensitive documents. I've used other cryptography software before, and I've run into compatibility problems before. Imagine you had an incredibly important document encrypted, but maybe you got a new computer or something and the software is no longer compatible with your computer. There is no such worry with Hypervault.

Conclusion

Single-File Web Apps are a great software architecture for apps that they work for. But obviously not all apps can be implemented as a SFWA. Any app that needs to send or receive data (like a search engine, social network, email app, etc) cannot be implemented as a SFWA.

But if you have an app that can be written as a Single-File Web App, I highly recommend you do (especially if you care it lasting very long).

One last note: With good build tools these days, you can still have the niceness of breaking your code into multiple files, and let the build tool combine them into a single HTML file (I used Parcel for FuzzyGraph).






Date published: 2025-10-31