Technical documentations #1792
Replies: 4 comments 4 replies
-
Good idea! To what end would you like to read such a technical documentation? As a guide for contributing, or as a description of how floccus works for users? You can find the website source code here: https://github.com/floccusaddon/nuxt-website |
Beta Was this translation helpful? Give feedback.
-
Hi @marcelklehr, Actually both, I need to be aware of both the user and developer side of things. I'm actually making a bookmark managing system, and it looks like some parts of floccus are exactly what I need to complete its user experience, actually. Having a technical documentation would help a lot, not only as a guide for contributing, but also to verify that the technical choices are the right fit for my plans. My hope to provide some kind of "core", the core of floccus, that could be plugged pretty much anywhere with little to no assumptions about the stack. Thanks |
Beta Was this translation helpful? Give feedback.
-
I will add that I am interested from a potential contributor point of view. For example, having a standalone .xbel decrypter tool would be nice. And I would like to understand how the profile is stored on the various platforms to investigate storing that encrypted when saved to media - I think it would be nice to not have the passphrase for an encrypted .xbel file in plain text (either in the exported .json profile or in the addon's internal storage format). This might necessitate user entry of a passphrase / password before syncing can occur, of course. So maybe a bit about source code organization and architecture and debugging techniques. Just a nudge would be fine. Others can add to the docs to fill in details perhaps. |
Beta Was this translation helpful? Give feedback.
-
Let me write down a bit of an intro to the source: The core of floccus is in https://github.com/floccusaddon/floccus/tree/develop/src/lib Especially interesting to get an overview are probably the interfaces: https://github.com/floccusaddon/floccus/tree/develop/src/lib/interfaces : There's the Account interface which describes what in the UI is now called a profile. AccountStorage describes the storage layer. Adapter is the interface that all backend adapters implement, along with Resource, which is the description of anything that holds bookmarks ie. an adapter or the browser bookmarks or the browser tabs or the bookmarks storage for the native app. And then there's the serializer interface which describes objects that take bookmarks folders and serialize them, and can also deserialize that representation again into a proper folder tree. The meat of all sync operations is Bookmark and Folder objects of course, you'll find these here: https://github.com/floccusaddon/floccus/blob/develop/src/lib/Tree.ts (should maybe move these into separate files). These are combined into an Item Type. What's interesting to note is also that since v5 all items also have a location, which is either 'server' or 'local'. This is handy to avoid using client-side IDs on the server and vice versa. For syncing, we run a Scanner over the two trees to create a diff which is a glorified array of actions which, when applied, transform tree 1 into tree 2. In order for all of this stuff to work, we need to map between IDs of items on the server and IDs of items on the client, which is what https://github.com/floccusaddon/floccus/blob/develop/src/lib/Mappings.ts is for. The whole sync logic is encapsuled in three strategies (using the strategy pattern). In there, there's a crude implementation similar to operational transformation that transforms actions from the two trees against each other to produce a new diff that can be applied to the opposite tree in a sane way to produce a synced state. The logic specific to the native apps can be found in https://github.com/floccusaddon/floccus/tree/develop/src/lib/native while the logic specific to browsers is in https://github.com/floccusaddon/floccus/tree/develop/src/lib/browser . The User interface is in https://github.com/floccusaddon/floccus/tree/develop/src/ui Tests are in https://github.com/floccusaddon/floccus/blob/develop/src/test/test.js |
Beta Was this translation helpful? Give feedback.
-
Hi,
Other than
doc/Adapters.md
there's not much documentation on the technical side of things.I'd be grateful if you could provide some technical documentation.
Also, I see that there are some (user) guides on floccus.org which are not available when cloning the repo, unfortunately, so I'd recommend keeping all the documentation in the same place, on this repository, preferably on the
doc/
folder which already serves this purpose. The documentation could be split into both a user and developer manual indoc/
and build floccus.org off the user manual.Thank you
Beta Was this translation helpful? Give feedback.
All reactions