Top
Best
New

Posted by bashtian 21 hours ago

Show HN: Capsule – Single-file web apps that save their data into SQLite(withcapsule.app)
Hey HN,

I always had the problem that building HTML pages is really simple now, but trying to save data required hosting it somewhere, and sharing it afterwards was not easy. Over the last few months, I've been building an app called Capsule (it’s also the file extension name) written in Rust with Tauri 2.0 that allows packing an HTML app and its data into a single SQLite file.

The HTML file and any related assets are directly embedded in the database. User data can either be saved as a localStorage key/value store or via a MongoDB-inspired collections API as documents, saved in a table in the file. You can also save other assets, like PDF files or images, directly in the database to keep different documents together. All data can be easily exported to CSV or JSON if needed.

Privacy and security were a big priority for me, so documents cannot do anything out of the box. They don’t have direct access to the file system and they require permission to access the internet. The permission model is still something I’m working to improve. Capsule documents can also use local or remote AI models for document specific AI features.

One downside with this approach is that multiple people working on it will create different copies. To make it possible to merge different copies of the same file, each data entry has a unique UUID and timestamp.

I’m planning to open up the file format specification for the 1.0 version of the app so other apps can read or write Capsule files.

You can try it out in the web preview at https://withcapsule.app/preview with pre-built templates or use any AI provider of your choice to create a custom, Capsule-optimized app by using the following prompt:

"Please read the app wizard instructions at https://withcapsule.app/prompt.txt and help me design an app.“

I’m still working on the file format but there are migrations for each new version, so data should never be lost when using newer versions of the app in the future. Please let me know if you have any ideas or use cases where this might make sense or does not work.

331 points | 139 commentspage 4
rtpg 5 hours ago|
I feel like this is close to a good idea.

What I would want to see is a version of this that lets me write an app that can write to the DB through an API, and then have a google drive-esque "host this for me" thing.

A focus on local-first really misses the point IMO. Like sure it's good it can be run locally, but really most people have a distribution problem. Be a distribution solution!

The thing I would do involves having the hosting just be available by dropping the capsule into the google drive/dropbox-y thing, and then having it be that you can just copy/paste the file to someone _and it carries over the data and everything by default_.

For a lot of people the "thing" is the app + the data. Sometimes you want to decouple them but a lot of times you don't want to.

I think it would be very rare for someone to want to share the single-file bundle just without data.

dgf18 20 hours ago||
Many big companies are starting now to test agentic coding to automate business processes. This could be a nice tool to distribute apps for workflows that aren't big enough to justify the operational overhed of maintaining a traditional web app backend. Nice!
m-p-3 18 hours ago|
This sounds like the modern take on MS Access.
lolakutty 20 hours ago||
What is wrong with using IndexedDB?
bashtian 19 hours ago|
For saving data in the capsule file it would create complexity regarding migration handling when updating the HTML file to add a field to a form for example. Keeping the data schemaless makes it also easier for merging data or importing data from a CSV.
lolakutty 18 hours ago||
Doesn't indexedDB have builtin migration mechanism?

>Keeping the data schemaless makes it also easier for merging data or importing data from a CSV.

Not sure how it makes easier. There is always an implicit or explicit schema. IMHO explicit is often better.

shepherdjerred 10 hours ago||
reminds me of https://fzakaria.com/2026/08/23/your-executable-is-a-sqlite-...
Brajeshwar 17 hours ago||
Personally, you lost me at `.capsule`. I assume this is your format? Now, what happenss when you are not around or I don't have access to you when it is needed most?
starcast2026 17 hours ago||
Sorry I am confused. If you(u1) share a link (html page) with your friend (u2), they fill data/form, then it get saved in u2's desktop. How does u1 see it?
messh 17 hours ago|
this is for local apps
xyrez 18 hours ago||
This sounds like a Smalltalk image, just without the self-modifying capability, which is what makes this whole idea of code+data in a single file so appealing IMHO.
radicalbit 5 hours ago||
i built something similar back in 2013, but it used to keep the persistent state in the url params (obv not a good storage backend), and you would get a super long url to share over facebook haha
manlymuppet 16 hours ago|
Is the file still fairly readable as plain text when opened with any old text editor? Is this asking too much?
More comments...