Live data from Hacker News

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

withcapsule.app

1–10 of 175 posts

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

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

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

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

#3
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?

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

#5
post #3

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?

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.

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

#7
post #3

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?

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.

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

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

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

#9
post #2

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?

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
Post reply on HN