Show HN: Capsule – Single-file web apps that save their data into SQLite

bashtian 313 points 126 comments September 15, 2026
withcapsule.app · View on Hacker News

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.

Discussion Highlights (20 comments)

andai

That's pretty cool. But who is this for? What problem does it actually solve? How would I know if I need this, vs something else?

lewisjoe

This is great. Curious: this requires users to have a host app installed on their machine that can read .capsule file right? Won't that be a point of friction for distribution? Isn't html/css a better distribution mechanism as most computers already have the tech to run them?

pmkary

Really really nice

eleventen

You can get a cheap approximation of this with chromium browsers + Filesystem API and a PWA manifest for that native-ish feel. AI has reignited my interest in building based 100% on browser native features. https://developer.mozilla.org/en-US/docs/Web/API/File_System...

zackify

love this idea!

gadders

>>Capsule packs your entire app — UI, data, and everything — into a single portable .capsule file. I'm having Lotus Notes flashbacks.

dgf18

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!

lolakutty

What is wrong with using IndexedDB?

fdeth

So, let’s do Visual Basic again, but this time with LLMs and web stuff.

blamestross

Seems very "packable into a standalone binary" but doesn't seem like that is a planned use case.

tonymet

is the idea this would be hosted or run locally (like Electron)?

redog

This seems ripe for an injection attack. Can it be inspected before running?

jawns

My take: If your app needs to update and preserve state (using SQLite or any other DB), it is probably not something you want to pass around as a bundled file. Or at least, it's extremely limiting, compared with hosting it somewhere on the web, which is not that hard to do these days. Think of the workflow: Any time the state changes, you need to email a new Capsule file to whoever else is using the app. And one would think the state would change at least occasionally, because otherwise there's little reason to use a DB. Alternatively, you can just host it on the web, the DB state dynamically updates, and it's automatically available to anyone with app access. Isn't that a lot simpler?

tamimio

New way to deliver viruses just dropped! Great idea but it can be abused for sure.

thederf

I've been working on this exact idea, with sqlar as the "format specification". Works in the browser, and desktop + Android using Tauri. https://github.com/JoshTheDerf/uapp Demo apps and games: https://thederf.com/uapp/demo/

sigmonsays

if state is best shared, why keep it w/ the code? You're gonna end up having to build a complex state sync system to a central DB anyways...

olaulailadila

An idea for a killer feature: Make it so that auhors can expose their capsules to the internet, and the people whoe wants to use them(lets call them users) can type the name(lets call it address) of the caplsue into the app, and your program will pull that capsule in the the users device..

dzink

Looks useful, but the Mac download shows "“Capsule” is damaged and can’t be opened. You should eject the disk image." and then you realize it could be ripe for malicious payloads as well.

xd1936

"No cloud. No accounts. Just share it." close tab

razerbeans

I love this idea! One of the fallouts from widespread AI adoption that I've seen: They're very good at creating visual artifacts, but if you ever have to provide data in those artifacts, you don't really have a great way to share it without hard coding it. > 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. This was the first thing that popped up in my mind: Changes stemming from two sources and reconciling them. I see that you have a statement about how to handle data entry from different sources, but I don't see exactly how those are reconciled? For instance, if two users have a copy of the .capsule and make changes, then want to share their changes with the other, you have two individual .capsules with different data. How do you merge them?

Semantic search powered by Rivestack pgvector
6,718 stories · 61,457 chunks indexed