Show HN: Fireproof – local-first database with Git-like encrypted sync

  • Creator of Apache CouchDB here. Fireproof is a very clever system for building secure, collaborative apps. Your apps can work offline and when connected automatically sync changes to local storage and display them immediately to the UI. It has much of that same CouchDB magic with almost no complexity or headache on the backend.

    Very coo…errr…hot!

  • Thanks for reading — Fireproof creator here, happy to answer any questions.

    We are in-flight on our cloud launch, so consider it a preview of the experience we are building. We’ll soon be shipping more complete authorization with UCAN capability delegation, and we are working on mature key rotation. I can't wait to hear what people want to build with it.

  • Here is the code sample I mentioned, example React usage (see our homepage for Vanilla JS)

        import { useFireproof, useDocument } from "use-fireproof";
        import { connect } from "@fireproof/cloud";
    
        export default function App() {
          const { database, useLiveQuery } = useFireproof("my_db");
          connect(database, "my-remote");
          const { docs } = useLiveQuery("_id");
    
          const [newDoc, setNewDoc, saveNewDoc] = useDocument({ input: "" });
    
          const handleSubmit = async (e) => {
            e.preventDefault();
            if (newDoc.input) {
              await saveNewDoc();
              setNewDoc({ input: "" }); // Reset for new entry
            }
          };
    
          return (
            <div>
              <form onSubmit={handleSubmit}>
                <input
                  value={newDoc.input}
                  onChange={(e) => setNewDoc({ input: e.target.value })}
                />
                <button>Add</button>
              </form>
              <ul>
                {docs.map((doc) => (
                  <li key={doc._id}>{JSON.stringify(doc)}</li>
                ))}
              </ul>
            </div>
          );
        }

  • I wrote a demo with Firebase to sync a bunch of music data between N web clients. EZ-PZ. All of the integrity stuff was icing on the cake, but basically it was an ultra-simple way to replicate data btwn web app users, without worrying about the server side at all.

  • The website and example, and usage looks clean. Kudos! I have some questions around what's happening under the hood that werent evident from an initial read of both your website as well as GitHub.

    1. Does subscribe listen for new changes on a transient server(just a queue). Or from a more persistent store?

    2. Where do the events persist? I didn't see a connector to postgres. I did see one for s3.

    3. What is the default persistence layer you are advocating?

    4. Let's say you run 3 instances of the self hosted server. And a random one of them gets a teacher. And 2 random other students gets load balanced to two other servers. How does the teacher get all messages? What's the thread in a distributed setting

    5. How do you filter only messages. Eg: only since time T.

    6. Pagination / limits to avoid any avalanche?

    7. Auth? Custom auth/jwt?

    8. REST API to produce?

    9. Are consumers restricted to browsers? What about one in node?

    10. BONUS: Have you tested if this works embedded as an iframe or embedded in an native/react native mobile app?

  • Fireproof brings really solid DX with a passionate team supporting it. It's deceptively powerful as an embedded db, but delivers the kind of experience you'd typically expect from a good frontend stack. Since modern web development keeps pushing the limits of browsers, I love local-first projects like this.

  • Fireproof engineer here, I come from the backend engineer perspective, so I thought I'd share some of my personal hacks on Fireproof:

    Fireplace - tooling to deploy Fireproof apps and sync data across your Tailscale network. Once all the computers you care about are on your tailnet, of course you want all the browsers on the tailnet to easily sync with one another.

    Go Implementation - Fireproof bills itself as a realtime database that runs anywhere, and I want to make sure that includes inside your Go applications. This will allow your Go application to become a full-fledged reader/writer of the Fireproof ledger.

    I'm excited to see what other people want to build and answer any questions.

  • Love this! I've been following and contributing to Fireproof for a while now and it's super exciting to see how far it's come - excited to use it on a project soon!

  • Fireproof has come a long way and If you’re looking to cut down on backend complexity while having a reliable user experience, Fireproof is worth a serious look.

  • I'm happy working on fireproof. The people are very nice. In terms of technology it's a new kind on block. Yes a bit of database and a bit of Blockchain with git rebase.That's why we moving from naming it database to ledger lately.

  • Congrats on launching Fireproof! You mentioned syncing content-addressed encrypted files via S3 or Cloudflare. For developers already using existing cloud-first setups, how seamless is it to integrate Fireproof as a hybrid solution?

  • One of my favorite use cases for Fireproof is storing and searching across vector embeddings. It can act as a RAG for LLMs, operating on the backend for all clients, and/or the frontend for customized or offline scenarios.

  • Here are some apps people have built, for inspiration:

    * Bloopernet Drum Machine: https://news.ycombinator.com/item?id=42177005

    * Slack style team chat https://firehouse-chat.jchris.partykit.dev/

    * PartKit Cloudflare https://blog.partykit.io/posts/fireproof-database-connector

  • It has been quite inspiring watching you grow this from a concept into a fully functioning next gen DB. Cheers!

  • Nice stuff! It's extremely fast and a breeze to use with cooperative applications that are shared by multiple users in realtime. Pretty sick work on the part of J Chris Anderson and the Fireproof team.

  • This looks really promising, this should run in any web-like environment right? Specifically it might be interesting to build a Socket App with this (https://github.com/socketsupply/socket)

  • Does it support custom backends?

  • Are there tutorials available?

  • Thing is.. Fireproof is brilliant and has a fun culture.

  • I had recently been experimenting with pouch/couchdb, and got it working locally, then came across a post on reddit about Fireproof. I really liked how it sounded - like the evolution of pouch/couch.

    So I set it up on a node app - it works great locally -

      import { fireproof } from '@fireproof/core'
    
      const db = fireproof(dbname)
    
      db.put(doc)
    
      async read(id) {
        if (id) return await db.get(id)
        return await db.allDocs()
      }
    
    Then I wanted to sync the data to the cloud - just the simplest thing possible, but I got lost in all the connector options and descriptions. I tried setting up PartyKit, but got bogged down in it all and eventually went on to something else.

    So it would be great if the home page included a simple demo with a connector - Amazon S3 or PartyKit - including setting up the cloud db.

    Thanks, and good luck with everything - it looks amazing...

    (side note: HackerNews doesn't let you format code with ``` ??)

  • Looks very cool.

    Have been developing something similar (local first data tooling) for a project of my own.

    The one thing stopping me from swapping my incomplete implementation with this is that I am unable to find how to connect to a db I control.

    In another thread you self described your backend options as "maybe too many backend implementions", but I am only seeing established cloud providers (meh) and ipfs (cool, but sluggish).

    https://use-fireproof.com/docs/connect

    Can I have the persistent data stored in PostgreSQL on a server I am running?

    Are fireproof servers involved in mediating the syncing or is it done through the client?

  • Great news! I suspect we'll be using this when we have to go back to on-prem hardware.

  • fireproof is super cool!

    built a lot over couchdb 10y ago and fireproof checks most of the pain points i had with it!

  • How does this compare to Dexie js and Dexie cloud?

  • A real solution for real world applications!!!

  • [dead]