How shaunabanana/intrigue works
Project Overview and Purpose
• The project, named “Intrigue”, is designed to help users organize literature and their thoughts visually. It’s an application that lets you create and manipulate “notes” on a canvas (with capabilities such as dragging, snapping, and connecting) and includes features like automatic metadata extraction (via DOI/ISBN/BibTeX/web links), WYSIWYG markdown editing (powered by TipTap), and even offline-first distributed collaborative editing.
• Because the README mentions binaries available for Windows, macOS, and Linux alongside files like src/background.js and src/preload.js, it is highly likely that Intrigue is an Electron-based desktop application built with Vue.js as the UI framework.
Key Components (Layers)
a. Desktop Application Shell (Electron):
– Main Process: Represented by files such as src/background.js, likely responsible for launching the Electron app, handling system-level events, and managing windows.
– Preload Process: (src/preload.js) that facilitates secure communication (using context bridges, etc.) between the main process and the renderer.
b. Renderer Process / Frontend:
– Vue.js Frontend: Located primarily inside the src directory, with App.vue as the root and various Vue components (e.g., note.vue, editor.vue, literature.vue, node.vue, etc.) that build the interactive UI.
– Script Utilities: In src/scripts, you see modules like api.js and utils.js that likely manage communication with backend APIs or perform client-side logic.
c. State Management:
– Vuex Store: The src/store directory (and index.js) indicates that application state is managed centrally with Vuex.
d. External Libraries and Services:
– Citation.js for metadata extraction.
– TipTap for the rich text / markdown editing in the notes.
– Integration with Zotero through a Quick Copy translator.
– Mention of upcoming P2P collaborative editing suggests networking and distributed data synchronization components.
e. Build and Configuration:
– Build and configuration files include package.json, vue.config.js, and babel.config.js. These are important for understanding how the project is bundled and built.
Relationships and Data Flow
– Illustrate how the Electron main process (background.js) and the renderer process (where Vue components reside) communicate via IPC and the preload script.
– Show how user interactions in the Vue components (e.g., creating or editing notes) cause actions that update the Vuex store.
– Represent how utilities in src/scripts (such as api.js) interact with external libraries (Citation.js and TipTap) to process data (metadata extraction, rich text updates).
– Indicate possible interactions for offline-first distributed editing, suggesting that data might be synchronized in a peer-to-peer manner or stored locally and later merged/synchronized.
Architectural Patterns and Design Principles
• Clearly a modular architecture that separates concerns:
• UI Layer (Vue components)
• Application Shell and System Integration (Electron’s main and preload processes)
• State Management (Vuex)
• External service integrations (Citation.js, TipTap, Zotero translator)
• The file structure resembles an MVC or component-based pattern where visual nodes (model elements) are rendered and manipulated via Vue components.