Local Native Organize your information and make it locally accessible and useful.

ios android firefox
addon
chrome
extension
gnu
linux
mac
mobile browser extension desktop

Local Native Quick Start and Videos.

Own your data on your device

Local Native App is a cross-platform tool to save and sync your notes in local SQLite database without going through any centralized service.

You can copy the SQLite database file from mobile device to desktop device via File Sharing and vice versa.

sync via ssb

On desktop, with proper web extension and host setup, you can replicate your data with other devices via ssb protocal.

By default, note is your private message in ssb, you can also publish public note to ssb if you explictly choose so.

Screenshot

Web extension

Local Native web extension popup screenshot

Search your notes in patchbay

Local Native patchbay screenshot

Quick Start

Install and run the desktop application to create below directory and files.

Only install browser extension alone without the web extension host binary below will not work.

Directory structure

Desktop

LocalNative # folder at user home directory
├── bin
│   ├── localnative-nodejs-X.Y.Z # nodejs cli for ssb sync feature
│   └── localnative-web-ext-host-X.Y.Z{-mac,-gnu-linux,.exe} # web extension host (rust binary)
└── localnative.sqlite3 # user's database

ssb pubkey setup

Add the pubkey (other peers you want to sync with) as author in ssb table, set other fields as 0.

You can use DB Browser for SQLite to explore the database.

Note

Windows currently does not have a standalone desktop app due to an upstream issue.

There is a Mac App Store version of Local Native but due to sandbox nature, it is NOT usable because node.js fs.mkdirSync call got permission denied to create the above directories (and most likely permission issue for those browser extension manifest file as well). I am curious if there is a way to do so.

Videos

Local Native Desktop Demo on Mac - Core Functions for Note

  • Install Local Native browser extension to Chromium.

    • Desktop application is needed to finish setup.
    • Run Local Native desktop application to finish setup (web extension host).
    • Local Native browser extension works for Chromium: Add some notes.
  • Local Native desktop application: search, pagination and delete.

  • Firefox with Local Native browser extension.

  • Brave with Local Native browser extension.

  • Sync via attach file

    • Copy localnative.sqlite3 from iOS device via File Sharing to ~/Document/localnative.sqlite3.
    • Click sync via attach file button and choose the above file.
    • Notice sync-via-attah-done in response, now the database from mobile device is synced with desktop's ~/LocalNative/localnative.sqlite3.
    • Clear the search, note increased count in response, new items from mobile device database show in search result.
    • Copy ~/Document/localnative.sqlite3 back to iOS device via File Sharing and replace iOS device's localnative.sqlite. (sync is both ways so mobile device also gets what is on desktop device).

Local Native iOS Demo - Add a Note

  • Local Native share extension

    • Open Safari and go to a web site.
    • Open Local Native share extension and enter desired tags and description (you can actually also change title and url).
    • Save button will launch Local Native search UI and newly added note will show up.
  • Local Native search

    • Click url link in any item from search result list will launch browser to that url's web page.
    • Touch upper left can go back to Local Native search UI from browser.
  • File Sharing and DB Browser for SQLite

    • Copy localnative.sqlite3 from mobile device to desktop.
    • Open DB Browser for SQLite to browse your notes (and then run SQL!).

Release

Installer packages

https://gitlab.com/yiwang/localnative-release

Libraries

rust crates

description url
web extension host https://crates.io/crates/localnative_cli
core lib https://crates.io/crates/localnative_core
ssb lib https://crates.io/crates/localnative_ssb

nodejs npm

description url
nodejs binary https://www.npmjs.com/package/localnative
nodejs to rust bridge https://www.npmjs.com/package/localnative-neon

Changelog

v0.3.8

  • desktop: fix pagination

v0.3.7

  • desktop: timeseries chart, tag cloud and screenshot
  • android and ios: add pagination

v0.3.6-mas-pkg

  • mas build got accepted but sandbox cause file location errors

v0.3.5

  • desktop app: sync via attach with another sqlite3 file
  • search result pagination
  • desktop app setup Chrome native messaging manifest json file
  • change android path to /sdcard/LocalNative
  • add license header to source files
  • mas build got rejected

v0.3.4

  • simplify release script
  • better iOS layout, add constraint for width
  • better multiple word text search
  • explict ssb sync command
  • bring back note deletion

v0.3.3

  • package web host and nodejs cli inside electron and setup manifest
  • change path to ~/LocalNative
  • consolidate localnative-nodejs cli into only one binary

v0.3.2-appimage

  • electron gnu/linux desktop build

v0.3.2-neon

  • nodejs to rust bridge used in electron

v0.3.2-rust

  • same as v0.3.1-rust and v0.3.0-rust

v0.3.2-npm

  • upgrade package.json dependencies

v0.3.2-mas-pkg

  • electron mac app store build but got rejected

v0.3.1-rust

  • fix crate-type, all rust builds works on mac

v0.3.0-rust

  • extract localnative_ssb as new crate

v0.2.4-ios

  • move cancel and save button down
  • upgrade rusqlite to 0.16.0 etc

v0.2.4-rust

  • format and dedup tags in rust

v0.2.4-android

  • insert note on android for chrome

v0.2.3-android

  • search on android

v0.2.3-ios

  • insert and search on ios for safari

v0.2.2

  • release initial iOS App
  • web extension
    • persist language choice
    • fix firefox language dropdown issue

v0.2.1

  • add i18n zh-CN

v0.2.0

  • allow public note be send to ssb
  • breaking schema change of table note by adding is_public column, sql migration script added

v0.1.5

  • allow web-ext to function without ssb sync
  • docs with screenshots

v0.1.4

  • remove annotations in ssb message
  • fill all ssb fields after publish

v0.1.3

  • recursively reduce annotation markdown size
  • ssbify None result handling

v0.1.2

  • fix to not ssbify when empty annotations
  • internalize ssbify code
  • allow small sized markdown to be displayed in ssb message

v0.1.1

  • use sql transactions
  • simplify rust to nodejs calls to global binaries

v0.1.0

  • ssb sync with other ids
  • add ssbify option
  • hide delete item operation

v0.1.0

  • hide delete item operation
  • tune UI elements to be more instant responsive

v0.0.2

  • add delete item operation
  • tune UI elements to be more instant responsive

v0.0.1

  • basic firefox and chrome extension

Source Code

https://gitlab.com/yiwang/localnative

or ssb://%q13hLJchNXz/xZi9mjWVHyIbRnkr5VjF0Y6BfhrOV6Q=.sha256

License

AGPL-3.0

Developer Setup

Below componets must all exist and correctly setup.

Install browser extension

git clone https://gitlab.com/yiwang/localnative.git
cd localnative-browser-extension/app
npm i -g web-ext
web-ext run --verbose # firefox

Setup browser extension host binary

  • Download and run the desktop applcation from release archive

    this will create ~/LocalNative/bin directory containing the host binary

  • or use cargo install localnative_cli, and find the binary at ~/.cargo/bin/localnative-web-ext-host

  • or build from source, via cargo

cd localnative-rs
cargo build

Setup native messaging manifest to point to extension host binary

  • Copy manifest json template file app.localnative.json from localnative-browser-extension/host to your browser's specific manifest location
  • Change the host path in app.localnative.json to where localnative-web-ext-host binary is from previous step
Firefox example manifest file

~/.mozilla/native-messaging-hosts/app.localnative.json

{
  "name": "app.localnative",
  "description": "Local Native Host",
  "path": "/home/USER/.cargo/bin/localnative-web-ext-host",
  "type": "stdio",
  "allowed_extensions": [
    "localnative@example.org"
  ]
}
Chromium example manifest file

~/.config/chromium/NativeMessagingHosts/app.localnative.json

{
  "name": "app.localnative",
  "description": "Local Native Host",
  "path": "/home/USER/.cargo/bin/localnative-web-ext-host",
  "type": "stdio",
  "allowed_origins": [
    // use this ID if you install from chrome web store,
    // or add/change to what the actual ID is if you "LOAD UNPACKED" from source.
    "chrome-extension://oclkmkeameccmgnajgogjlhdjeaconnb/"
  ]
}

Setup Node.js global binaries

currently the rust host binary calls some node.js binaries for ssb work, so

npm i -g localnative

the host may not know the global node bin path, if so cd to where you node global bin directory, and

(sudo) ln -s localnative-ssb* /usr/local/bin/

Start a sbot server

The web extension send message to localnative-web-ext-host and writes new note to sqlite first, upon response to display the search result, and finally try to sync with ssb.

If sbot server is not running, the host will just error out, next requet will still be fine because each message is independent from each other.

You can use those softwares:

Patchwork: simpler user friendly UI.

Patchbay: more advanced, and show the raw json of each message for easiler debugging, combined with custom filter and good enough free text search.

Database

If above things are correctly setup, localnative.sqlite3 database file is created at the directory ~/.ssb/localnative.sqlite3 the first time you click the web ext popup.

hint to see what localnative-web-ext-host went wrong:

RUST_BACKTRACE=1 chromium-browser
RUST_BACKTRACE=1 web-ext run --verbose

You can use DB Browser for SQLite to explore the database, and adding other device's ssb public key as author in the ssb table.

TODO

feature

  • add non url text note, db table for draft note item
  • manage people / contact
  • safe network

performance

  • async load image data
  • db index?

desktop platform

  • Flatpak?
  • windows
    • installer

mobile

  • android
    • click on tag text to search
    • ProGuard to shrink size?
    • screenshot
    • OCR
  • ios
    • click on tag text to search
    • screenshot
    • OCR
  • purism

i18n

  • more languages?

db

  • encryption?

ssb

  • deal with image data in annotation

Privacy Policy

  • As the name "Local Native" implies, the application stores your information locally on your own device.

  • Local Native App developer does not run any service to collect or store any personal information about you.

  • If you choose to replicate data via ssb, be aware that is you voluntarily share your data with other ssb peers.

  • Platform providers and underlying operating systems (android, ios, web browsers, app store) may collect information about the application (crash reports, usage stats) and make those avaliable to Local Native App developer, who may use those data to improve the application.