12 votes

I made a thing: Ode, an open source, self-hosted collaborative document editor

9 comments

  1. smores
    Link
    I've been working on this for a while! It's still very rough and has not been battle-tested, but I have been using my instance for note-taking for a little while and it seems to be going well. I'm...

    I've been working on this for a while! It's still very rough and has not been battle-tested, but I have been using my instance for note-taking for a little while and it seems to be going well. I'm happy to talk more about why this exists or how it works if anyone is interested! Self hosting is a passion of mine, and I really enjoy the flexibility that Prosemirror provides as a rich text toolkit.

    7 votes
  2. [2]
    tindall
    Link
    This is very cool! I like this as an application of document databases; if I ever get around to overhauling my infrastructure at nora.codes, I'll definitely think about including it.

    This is very cool! I like this as an application of document databases; if I ever get around to overhauling my infrastructure at nora.codes, I'll definitely think about including it.

    3 votes
    1. smores
      Link Parent
      Thanks!! Yeah prosemirror works well with schemaless dbs; the client libraries have such strong schema enforcement that you can rely heavily on them to maintain data integrity, and reads usually...

      Thanks!! Yeah prosemirror works well with schemaless dbs; the client libraries have such strong schema enforcement that you can rely heavily on them to maintain data integrity, and reads usually take the shape of reading the whole document at once, maybe plus some additional steps!

      2 votes
  3. [2]
    Artemix
    Link
    I was surprised at the design choice of MongoDB for sole storage solution. Why choose it over something more reliable?

    I was surprised at the design choice of MongoDB for sole storage solution.

    Why choose it over something more reliable?

    2 votes
    1. smores
      (edited )
      Link Parent
      Can you tell me more about what you mean by reliability? For context on why Ode uses Mongo: Ode uses Parse Platform as its backend framework, which supports two databases: Postgres and Mongo....

      Can you tell me more about what you mean by reliability?

      For context on why Ode uses Mongo: Ode uses Parse Platform as its backend framework, which supports two databases: Postgres and Mongo. Mongo is the recommended datastore solution by the Parse folks, and it makes more sense of the two in this case due to the document-shaped nature of... well, documents! I mentioned this in the above comment, but schema enforcement is primarily handled by Prosemirror in the client, which is more flexible and stronger than a SQL schema could be.

      I also specifically use and recommend the Percona Server for MongoDB, which has some nice additional features like hot backup and audit logging. Parse actually recommends using the MongoRocks engine for Mongo, which Percona supports but I unfortunately can’t use for Ode yet, because they don’t yet have support for MongoDB 4.2 (and Ode needs transactions, which were introduced in 4.2). Hopefully that will change soon though :)

      Edit: actually, after refreshing my memory a bit more here, MongoRocks/RocksDB has been deprecated and several improvements have been made to WiredTiger, the default engine. I think that Parse recommendation is just old/stale!

      6 votes
  4. [4]
    skybrian
    Link
    Interesting. A long time ago I helped with a hackathon project that was like this. It never went anywhere but it was fun. Back then it was plain text only, and the project lead had implemented the...

    Interesting. A long time ago I helped with a hackathon project that was like this. It never went anywhere but it was fun. Back then it was plain text only, and the project lead had implemented the synchronization algorithm himself. Being able to use ProseMirror seems a lot easier.

    It looks like you are appending changes (steps) to persistent storage. That's going to make startup slower for documents that have been changed a lot.

    At some point you'll probably want to write more about how to integrate this into an existing web site.

    2 votes
    1. [3]
      smores
      Link Parent
      Hey! Thanks for taking a look! There’s a “cloud function” that executes as a PostWrite callback on Steps that aggregates them into the base document. Steps are only used to communicate changes to...

      Hey! Thanks for taking a look! There’s a “cloud function” that executes as a PostWrite callback on Steps that aggregates them into the base document. Steps are only used to communicate changes to the document after first load; on first load, the user will almost always get the entire, up-to-date document (plus maybe a few steps if someone else is actively editing during load).

      That’s an interesting idea! I’m thinking of this more as “self hosted Google Docs” than as an embeddable editor, at least for now.

      Prosemirror uses a pull-and-rebase approach for synchronization, which is done by the clients (as opposed to the server). It’s super cool, and very fast, and I am very glad I did not need to implement it myself :D

      2 votes
      1. [2]
        skybrian
        Link Parent
        After you and whoever you are collaborating with are done writing a document, I expect you'd want to publish it somewhere to share with others. Is the idea to copy it somewhere else at that point?...

        After you and whoever you are collaborating with are done writing a document, I expect you'd want to publish it somewhere to share with others. Is the idea to copy it somewhere else at that point? Or might publishing be integrated with a blogging tool? Or is it like with Google Docs where you can get a read-only URL to share when you're done?

        A demo or at least some screenshots would give people a better idea of whether they want this tool or not, when you're further along.

        3 votes
        1. smores
          Link Parent
          A read only URL is exactly what I was picturing, yeah! But I could see it going any number of ways. I threw a few rough screenshots up on the GitLab project earlier today:...

          A read only URL is exactly what I was picturing, yeah! But I could see it going any number of ways. I threw a few rough screenshots up on the GitLab project earlier today:
          https://gitlab.com/smoores/ode/-/blob/main/screenshots/desktop.png
          https://gitlab.com/smoores/ode/-/blob/main/screenshots/mobile.png

          2 votes