Skip to content

Latest commit

Β 

History

History
127 lines (99 loc) Β· 6.11 KB

File metadata and controls

127 lines (99 loc) Β· 6.11 KB

Supernote πŸ“

Supernote is a premium, lightweight, cross-platform note-taking application built with Tauri v2 and Vite. It features a dynamic, runtime-extensible plugin architecture and integrates powerful backend sidecars (Bun and Python) to perform local computations beyond the standard frontend sandbox.


πŸš€ Key Features

  • Tauri v2 Desktop Shell: High performance, small binary footprint, native OS dialogs, notifications, and system hooks.
  • Dynamic Plugin System: Extends UI controls and editor behavior at runtime. Plugins are dynamically downloaded, loaded, and initialized from the registry server (Superhub).
  • Native Sidecars:
    • Bun Sidecar (src-bun): Run fast server-side JavaScript/TypeScript workflows locally.
    • Python Sidecar (src-python): Run scriptable scripts, data analysis, and helper automations.
  • Unified UI Styling: Sleek jQuery-driven UI featuring glassmorphic designs, micro-animations, customizable dark theme support, and a dragging-enabled custom window header.
  • Cross-Platform Targets: Compile to Windows, macOS, Linux, and Android.

πŸ“ Repository Structure

supernote/
β”œβ”€β”€ docs/                      # Documentation files (e.g., setup instructions)
β”œβ”€β”€ scripts/                   # Utility scripts for sidecars, release packaging, and key generation
β”‚   β”œβ”€β”€ build-sidecars.js      # Compiles Bun and Python sidecars
β”‚   β”œβ”€β”€ create-tag.js          # Prepares Git tags & release metadata
β”‚   β”œβ”€β”€ setup.ps1 / setup.sh   # Installs dependencies (Rust, Bun, Python, PyInstaller)
β”‚   └── secrets/               # EXCLUDED FROM GIT - holds signing and updater private keys
β”œβ”€β”€ src/                       # Frontend application code
β”‚   β”œβ”€β”€ Services/              # Core business services
β”‚   β”‚   β”œβ”€β”€ Framework/         # Framework initialization
β”‚   β”‚   β”œβ”€β”€ Network/           # REST and WebSocket network modules
β”‚   β”‚   β”œβ”€β”€ Plugin/            # Plugin loader, cache management, and dynamically-imported registry links
β”‚   β”‚   β”œβ”€β”€ Runtime/           # Application runtime states
β”‚   β”‚   └── Storage/           # Application persistence/storage configuration
β”‚   β”œβ”€β”€ Sources/               # UI components, layouts, custom styles, and core sidecar-spawning routines
β”‚   β”‚   β”œβ”€β”€ main.css           # Styling rules, color palettes, variables
β”‚   β”‚   └── main.js            # Core page layout, sidecar buttons, and service interactions
β”‚   β”œβ”€β”€ main.css               # Global application loader stylesheet
β”‚   └── main.js                # Core entry point (bootstrap sequence)
β”œβ”€β”€ src-sidecars/              # Sidecar codebases
β”‚   β”œβ”€β”€ src-bun/               # TypeScript-based Bun sidecar source code
β”‚   └── src-python/            # Python sidecar script codebase
β”œβ”€β”€ src-tauri/                 # Rust code and Tauri packaging configurations
β”‚   β”œβ”€β”€ src/                   # Main Rust file (commands, setup, resize hooks)
β”‚   └── tauri.conf.json        # Tauri target build configuration
β”œβ”€β”€ info.json                  # Git release versioning and download URLs
└── package.json               # Frontend dependencies & run scripts

βš™οΈ Prerequisites & Setup

Ensure you have the following installed on your machine:

1. Run First-Time Setup

Execute the platform-specific setup script to verify environments and install requirements (e.g., PyInstaller, Node packages, dependencies):

  • Windows (PowerShell):
    .\scripts\setup.ps1
  • macOS / Linux (Bash):
    chmod +x ./scripts/setup.sh
    ./scripts/setup.sh

2. Build Sidecars

Compile the sidecars into executable binaries placed inside src-tauri with the target triple name:

node scripts/build-sidecars.js

3. Run Development Server

Start the client application in development mode:

npm run dev

4. Build Production Bundle

Build and package the production installer:

npm run build

πŸ”Œ Plugin Registry & Service

Supernote loads plugins dynamically using the PluginService located under src/Services/Plugin/PluginService.js.

  1. Registry URL: By default, Supernote looks for the registry on http://localhost:3001. You can configure a custom server URL directly from the application's UI settings.
  2. Plugin Loading: On startup, it reads the default plugin manifest plugin-package.js and requests corresponding files from the registry server.
  3. Sandboxing & Dynamic Import: It imports ES modules dynamically using import(/* @vite-ignore */ url) and appends related style assets dynamically into the document <head>.

v2 Plugin Runtime Contract

  • Supernote now consumes plugin metadata with exports.logic, exports.template, and exports.styles.
  • Plugin package entries can define default variants:
{ slug: 'button', version: '1.0.1', variants: ['primary', 'secondary', 'danger'] }
  • Variant selection is hybrid:
    • default variants from plugin-package.js
    • optional runtime variant override per load call

Direct Widget Instantiation

  • UI code now creates widget instances directly from plugin logic exports.
  • The button helper wrapper in the source page has been removed; components instantiate the loaded widget class directly.

πŸ› οΈ Developer Scripts

Refer to scripts/README.md for advanced commands regarding:

  • Tauri updater key generation (generate-updater-keys.js).
  • Android release key configurations (createSecrets.ps1).
  • Tagging releases and preparing automatic update jsons (create-tag.js).