Back to News
Advertisement
bbashtian about 4 hours ago 84 commentsRead Article on withcapsule.app

DE version is available. Content is displayed in original English for accuracy.

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.

Advertisement

⚡ Community Insights

Discussion Sentiment

75% Positive

Analyzed from 2229 words in the discussion.

Trending Topics

#file#data#app#capsule#html#web#apps#https#open#idea

Discussion (84 Comments)Read Original on HackerNews

mgabout 1 hour ago
> but trying to save data required hosting it somewhere

With the File System Access API, webpages nowadays can read and write local files just like desktop applications:

https://developer.chrome.com/docs/capabilities/web-apis/file...

Try this text editor for example:

https://googlechromelabs.github.io/text-editor/

It works nicely on Desktop and Mobile.

darkvertex36 minutes ago
Even better how about a fully functional VSCode: https://vscode.dev

The File System Access API makes it possible.

pspeter3about 1 hour ago
My dream is that you could write to Google Drive or iCloud Drive transparently too if the browser allows you to
emaroabout 1 hour ago
*In Chrome.
simongray27 minutes ago
That file editor seems to work in Firefox. I just tested the save/open functionality.
nater5000about 1 hour ago
I don't know, this seems like an idea that maybe works in a specific context being generalized past the point of the original idea making sense.

If the user needs to download a specific application to run this these web apps, then why not just send them that initial application in the first place? Why jump through the hoops of using Capsule when the same hoops can be jumped through to get to the same endpoint?

If this was a near-universally adopted application, then it'd make sense. But it's not, and the closest thing we have to that are browsers... which already do what you're describing?

Bundling data with the application makes sense, but is also only appropriate in pretty narrow circumstances. If I'm willing to ship my data with the web app, then I'll just embed the data in the HTML file. If the expectation is that the user will modify this data, then I don't think I'd want to ship it like this.

pbronez36 minutes ago
Seems pretty useful in an enterprise context to me. I see it as an alternative to 10 million vibe coded apps to dockerize and manage. You can put the runtime on everyone’s machine and provide a web version for really collaborative stuff.

Bonus points for an intelligent way to manage these stored in OneDrive and other cloud folders. Easy to get corruption on SQLite files stored there.

jawnsabout 2 hours ago
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?

Reviving1514about 2 hours ago
Why not on a shared drive like dropbox?

Concurrent editing wouldn't work, though.

latexrabout 2 hours ago
> Isn't that a lot simpler?

You’re glossing over the recurring cost and annoyance of dealing with the hosting and having to secure the data. This way you just share and it’s local.

Sure, if you have to share data between people, your points are valid. But this seems like a way to build apps geared for individual users, like a notes or recipes app.

thederfabout 2 hours ago
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/

windsurferabout 2 hours ago
FYI requests from your demo are being blocked by CORS in Firefox and it never loads.
m-p-3about 1 hour ago
It kinda reminds me of MS Access, which ended up being a pain in the butt for IT departments, but also covered a need within some department with limited resources.

Really curious to see where this goes. Do you plan to open-source the client, or simply make the file specification open when stabilized?

bashtian23 minutes ago
I'm currently 50/50 on open source the full app vs just the spec. Since I'm currently having a strong idea of what features and functionality is still missing I feel that open-sourcing right now would distract to much in this phase. But maybe when the main features are done it would make sense to have more people looking at and improving it.
Brajeshwar9 minutes 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?
tombert19 minutes ago
I remember a million years ago, when I was writing apps with Cordova/Phonegap, I would use Web SQL to do all my storage [1]. This kind of reminds me of that.

I always thought that there should be an easy way to export it, but I don't think that ever materialized.

[1] https://en.wikipedia.org/wiki/Web_SQL_Database

eleventenabout 3 hours ago
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...

bashtianabout 3 hours ago
If you want to distribute apps to many users this would probably be a better solution. The main benefit of Capsule is the personal document like app. You create a capsule, move it to an USB stick, save it in your cloud storage and it's still the same document. Nothing has changed, not the UI, not the data. The document will stay the same.
al_borlandabout 2 hours ago
If it’s web native, anyone can just use it. If it’s a capsule, they first need to download the capsule app to associate the file extension with the OS and have it launch, right?

That feels like a big barrier, almost like a Java runtime.

eleventenabout 2 hours ago
In defense of capsule, the Filesystem API is janky and has kind of shit UX. Less sophisticated users would probably prefer the UX of a purpose built tool.

I prefer worse UX for the sake of standards and zero install, but many people would prefer the opposite. I don't think Capsule is intended for the HN crowd.

ramon156about 2 hours ago
how is a filesystem supposed to prevent you from doing that?
smy200119 minutes ago
Do you plan to open source it? Seems like a proprietary app & spec.
lewisjoeabout 3 hours ago
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?

Dweditabout 3 hours ago
You'd think so, but web browsers are downright lobotomizing the ability for local HTML files to run any meaningful javascript code. Want to run a JS file from the same directory? CORS ERROR!!!!

Hence 200MB applications that are complete copies of the Chromium browser to run under 1MB of actual web code.

derpyzzaabout 2 hours ago
couldn't you just embed the js directly into the html file though? that would sidestep the CORS error. and since most of the people using a program like this are likely to be using AI to generate their ( likely throwaway ) applets anyway, readability and maintainability for the source doesn't matter as much as it would with human authors so having a separate js file doesn't bring that many advantages anyway.
throw101010about 3 hours ago
Isn't that the price of a relatively well sandboxed experience by browsers?

I've experienced the same limits building small tools for myself and friends that I wanted to contain in a single HTML file without external dependencies... but I understand why the same project without these restrictions could easily become malware, and ones that could be easily propagated.

ProfDreamerabout 2 hours ago
That reminds me of TiddlyWiki[1], a wiki application in the form of a single self-contained HTML file.

1: https://en.wikipedia.org/wiki/TiddlyWiki

bashtianabout 3 hours ago
The problem is that you can't save the user data in way that you can click a single file, similar to a Word or Excel file. I you think a about it, a Excel spreadsheet is also just UI + data in a single file.
paweladamczukabout 3 hours ago
This is a frustration of mine as well, but I vaguely remember someone showing something on HN where the file could essentially save itself, I think they were using some file APIs for that... sadly I can't find the details anymore. But I keep running into the "HTML file opened locally can't update itself" issue repeatedly now that I build tools for myself with LLM agents.
yozabout 2 hours ago
The File System Access API can do this, and it works in local ("file:///") HTML files, but it's only currently supported in desktop Chromium browsers: https://caniuse.com/native-filesystem-api

However, every browser will let you download a new version of the HTML file and save it over the old one - yes, even from a local HTML file:

   const blob = new Blob(['<!DOCTYPE html>\n' +
      document.documentElement.outerHTML], 
      { type: 'text/html' });
   const a = document.createElement('a');
   a.href = URL.createObjectURL(blob);
   a.download = 'mypage.html';
   a.click();
... but you need the user to do this for every update. So we're back to manual "Save" buttons.
alexis2babout 3 hours ago
Technically that was more MS Access :-)
lukasbmabout 3 hours ago
I imagined the capsule website would be able to either convert or directly run/open them
nzoschkeabout 1 hour ago
Looks neat. Shuffling artifacts around is more important than ever with all the agentic web sites and apps we are making.

Im finding a lot of success embedding metadata and data in SQLite files for music management.

Having a spec for a single file with a schema, version, metadata and binary blobs is super easy to shuffle around.

Agents crush reading and writing the data and writing tools around the spec.

All of a sudden things like backup, sharing and dedupe are snapping into place for my music library.

More thoughts here: https://deadca7.com/blog/deadca7-open-music-database-specifi...

Advertisement
razerbeansabout 2 hours ago
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?

olaulailadilaabout 2 hours ago
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..
derpyzzaabout 2 hours ago
wow, that sounds revolutionary.
rc-1140about 2 hours ago
This is a really cool and practical idea! Some of my first professional efforts out of college were writing Python mini-apps with Tkinter to replace "abused" Excel spreadsheets. One of my friends working in sales might benefit from something like this, I'll send it his way.

I don't know about the stability/market value of this if you intend to turn this into something that attempts to make money, however. Said friend is currently using stuff like Gemini to generate HTML mini-apps as well; while he's not storing anything in databases, he's able to generate receipts and other things for essentially free.

thesurlydevabout 2 hours ago
With the battle of AI versus human agency raging I have a prediction that local-first desktop apps are going to make a comeback. It's nice to see something like this make it easier.
rgloverabout 1 hour ago
I agree and would love to see a shift back to what we had circa ~2009-2010: high quality, desktop and platform-specific apps that you could just pay for once (the best variant for everyone being an app that works indefinitely, but only receives updates if you renew your license every year).

The whole shift to SaaS has decimated software quality and has made most tasks a nightmare to complete (or at best, an obstacle course of multiple tools and "upgrades" and other bs).

domhabout 2 hours ago
I wish there was a way to see the underlying HTML/JS and schema of these container files. Maybe you can on the desktop app? But it would be cool to see what's happening under the hood.

Do you have any plans to do merging of two versions of the same app? E.g. I send a todo list to someone, they mark some things as done and send it back to me. Will that merge into my copy if I've added some more items or would it open as a "fresh" app?

andaiabout 4 hours ago
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?

bashtianabout 3 hours ago
If try to do data management in Excel or need to download an app just to save some recipes, this could be an alternative. For example you can track time and billing with a nice UI without requiring a SaaS subscription. You can try some examples in https://withcapsule.app/preview
redogabout 3 hours ago
This seems ripe for an injection attack. Can it be inspected before running?
Jonovonoabout 2 hours ago
“Capsule.app” is damaged and can’t be opened. You should move it to the Trash.
saejox19 minutes ago
like downloading exe files from the web. but we should invent something to catch bad actors putting bad stuff in them
gaddersabout 3 hours ago
>>Capsule packs your entire app — UI, data, and everything — into a single portable .capsule file.

I'm having Lotus Notes flashbacks.

Advertisement
dzinkabout 2 hours ago
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.
uneeknameabout 1 hour ago
Is this project open source?
xyrezabout 1 hour 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.
ninininino35 minutes ago
I'm surprised to not see Pocketbase mentioned in this thread at all.

https://pocketbase.io/docs/

"PocketBase is an open source backend consisting of embedded database (SQLite) with realtime subscriptions, builtin auth management, convenient dashboard UI and simple REST-ish API. It can be used both as Go framework and as standalone application.

The easiest way to get started is to download the prebuilt minimal PocketBase executable"

dgf18about 3 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!
sigmonsaysabout 2 hours ago
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...

lolakuttyabout 3 hours ago
What is wrong with using IndexedDB?
bashtianabout 2 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.
lolakuttyabout 2 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.

rvz39 minutes ago
Attackers / Malware Developers: "A document as a web app?, What could possibly go wrong?"
fdethabout 3 hours ago
So, let’s do Visual Basic again, but this time with LLMs and web stuff.
tamimioabout 2 hours ago
New way to deliver viruses just dropped! Great idea but it can be abused for sure.
bashtianabout 2 hours ago
The HTML files does not have any permission to access anything on the file system. Ideally the whole app will be running inside a sandbox on desktop, for mobile apps this will be the default anyway.
Advertisement
xd1936about 2 hours ago
"No cloud. No accounts. Just share it." close tab
derpyzzaabout 2 hours ago
well that's a first
mionheabout 2 hours ago
Can you elaborate a little?
al_borlandabout 2 hours ago
It reads like the whole thing was vibe coded and 0 work was done beyond what the AI spit out.
j-pbabout 2 hours ago
yes yes we get it, you don't like AI ...
pmkaryabout 3 hours ago
Really really nice
tonymetabout 3 hours ago
is the idea this would be hosted or run locally (like Electron)?
bashtianabout 2 hours ago
This is for local document like apps. Tauri is actually using the OS webview instead of bundling Chromium like Electron. That's why the download is only 10MB for Mac.
blamestrossabout 3 hours ago
Seems very "packable into a standalone binary" but doesn't seem like that is a planned use case.
bashtianabout 2 hours ago
The problem would be cross-platform support. In the end the capsule file is the standalone binary similar to a PDF or a Word document, you only need the viewer app to open any capsule file.
zackifyabout 3 hours ago
love this idea!
orliesaurusabout 1 hour ago
Is this a durable object? /s