ezst

For the curious, the note taking app Trilium has a "standalone" mode¹, built on top of OPFS² and sqlite OPFS persistence, such that your notes (~web pages here) are stored in sqlite locally, offline-available, optionally syncing with a remote, while being a pure local web app (after the app assets have been downloaded once). If you want to take your whole personal notes/wiki/pkms for offline access on a device you don't own/have install rights, that's the only way I know. I suspect that OP could have gone this route instead had he known about it?

¹: https://app.triliumnotes.org/

²: https://developer.mozilla.org/en-US/docs/Web/API/File_System...

³: https://sqlite.org/wasm/doc/trunk/persistence.md#opfs

mg

> 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.

show comments
molsongolden

Adding to the chorus of “this looks like X old thing”.

This reminds me of Clipper/dBase software tools. One of my favorite pieces of software was a tiny program file + flat-file .dbf for storage. Drag and drop the folder to install or share.

show comments
nater5000

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.

show comments
whizzter

I was literally thinking of building something similar this summer, one requirement I had however was that it should be runnable/shareable over the web (it's web-tech after all).

My use case was storing a family tree with data/app that could be shared, and family members they would be able to add to it and later merge also.

Ie, it's a webpage you can dump anywhere, then download/edit locally.

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?

show comments
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/

show comments
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...

show comments
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?

show comments
flossly

I miss from the home page a link to github and/or a description of it's license and/or some code of an actual capsule app (what backend language is used? -- I have no clue and cannot find out) and/or does this bundle Node?

While I wish your project success and like the simplicity of Sqlite; I prefer to start with Postgres. PG has many of the benefits (x-platform, free, embeddable, etc) that sqlite has, but also provides an industrial strength db in case you need to scale at some point, or want to use more complicated constructs.

m-p-3

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?

show comments
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..

show comments
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?

show comments
andix

I really like the idea. It's so easy to create small tools with AI now, but hard to install them as local apps or share them.

But I'm missing a few relevant features:

1. syncing data and apps (capsules) between my devices. not necessarily over a single SaaS, but maybe p2p or some existing service

2. I think data and apps should be separated, I might want to share an app with someone else without sharing the data

3. Apps should support updates, install the same app again and just replace the code for the existing app, but keep the data. Also share updates either as a file or publish apps to a repo (just a folder of files on a public http server or github repo)

Both keeping data in sync between devices and providing offline capabilities is hard, I know.

rramon

Whats the advantage over plain single html files/apps using colocated css and use the browser/web view local storage? Those could be saved as PWAs or not?

zarrdoz

This would be great if it evolved in a universal format/spec/feature supported by all major browsers. Only then you'd have to deal with cross web engine compatibilities. And if capsules need to do something non-trivial then you need to consider all the security aspects of having system, file or network level access. Just like any executable. Otherwise with custom app to run capsules it feels like something that can be vibe coded with electron/nw.js rather easily.

But there is something compelling in the idea - there is need for an interactive smart document format that you can share around easily. Kind of like a next gen markdown derivative cross with jupyter notebook where you bundle data, live parametric visualizations, code, audio, video, asciicinema like playback, comments, metadata, file artifacts etc

veqq

Decker works similarly to this (without the SQL-lite, but directly in the single flat html file which can be statically hosted or passed around, and includes an editor for itself!) https://github.com/JohnEarnest/Decker

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?

show comments
rc-1140

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.

gadders

>>Capsule packs your entire app — UI, data, and everything — into a single portable .capsule file.

I'm having Lotus Notes flashbacks.

show comments
redog

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

thesurlydev

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.

show comments
francislavoie

I've been doing this with bun lately, single file app with built in SQLite. JS runtime which serves the app with SSR, websockets, and all that good stuff. The binary size is not that small, but that's usually worth the convenience.

tombert

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

domh

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?

show comments
nzoschke

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...

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.

rupertsworld

This reminds me a little bit of https://webtil.es/, which can be either bundled standalone files or hosted, and add a special secure execution context.

rtpg

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.

nbhankes

This is great. My initial thought is to create a zettel for my research projects.

probablyStimmed

I like that there are so many haters who don’t get it or don’t think it’s useful and then there are 5 or so very similar projects in various stages of development listed in the comments. It’s giving “what if I don’t like beans?”

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!

show comments
lolakutty

What is wrong with using IndexedDB?

show comments
radicalbit

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

Brajeshwar

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

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?

show comments
xyrez

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.

manlymuppet

Is the file still fairly readable as plain text when opened with any old text editor? Is this asking too much?

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...

jayde2767

Was Capsule written in Capsule?

yuedongze

We are so back. I remember ActiveX in the old days

smy20011

Do you plan to open source it? Seems like a proprietary app & spec.

writtenone

This is proprietary. Yuck

uneekname

Is this project open source?

Jonovono

“Capsule.app” is damaged and can’t be opened. You should move it to the Trash.

4ndrewl

It's 1990s Microsoft Access but with AI

fdeth

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

saejox

like downloading exe files from the web. but we should invent something to catch bad actors putting bad stuff in them

xori

my-bookreport-v2-final-final-done.capsule

bbstats

this is great for the 'make a webapp for me and my family' thing

altern8

Looks amazing, I don't know if this is legit or useful feedback, but I navigated away after reading "Generate & update apps using AI".

I'm so tired of AI everywhere and everything trying to sell to you because of AI this and AI that.

I think that at this point we assume AI will be available if it makes sense for the product, making it a selling point to me is like slapping "No cholesterol!" on lettuce.

tamimio

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

show comments
xd1936

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

show comments
pmkary

Really really nice

ninininino

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"

rvz

Attackers / Malware Developers: "A document as a web app?, What could possibly go wrong?"

tonymet

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

show comments
blamestross

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

show comments
annrap1d

Is this open source ?

zackify

love this idea!

orliesaurus

Is this a durable object? /s