simplenote-electron Documentation

Simplenote for Web, Windows, and Linux

5,275 stars TypeScript TypeScript 9 files ยท ~2,314 tokens
RAW Doc

Docker & Self-Hosted Deployment Verified OCI

Deploy simplenote-electron on any server, homelab, or cloud container platform.

1-Click Terminal Command
bash (docker run)
docker run -d --name simplenote-electron -p 4000:4000 --restart always node:8.16.1
Configured Services & Ports
โš™๏ธ install
image: node:8.16.1
โš™๏ธ dev
image: node:8.16.1
๐Ÿ”Œ Ports: 4000:4000
docker-compose.yml
yaml (docker-compose.yml)
version: '2'

services:
  install:
    image: node:8.16.1
    command: npm install
    volumes:
      - $PWD:/app
    working_dir: /app
  
  dev:
    image: node:8.16.1
    command: npm start
    ports:
      - "4000:4000"
    volumes:
      - $PWD:/app
    working_dir: /app

Technical Documentation: Automattic/simplenote-electron

โ„น๏ธ Provenance: Multi-Tier Ingestion ยท CodeWiki Reference

Overview (`README.md`)

Simplenote for Electron

A Simplenote React client packaged in Electron. Learn more about Simplenote at Simplenote.com.

Running

Read this first!! Local development is currently not supported if you don't have an existing account on the test server or access to the production credentials. This is because the move to an email-first signup flow has made it impossible to create accounts in the test database. We hope to be able to support an open-source development workflow again in the future.

  1. Clone the repo: git clone https://github.com/Automattic/simplenote-electron.git
  2. cd simplenote-electron
  3. npm install --legacy-peer-deps (This flag is necessary because react-monaco-editor is pinned to a specific monaco-editor dependency, but npm considers minor versions to be breaking changes for sub-1.0.0 apps)
  4. Decrypt the config file using make decrypt_conf.
  5. npm run dev
  6. The dev server will start on http://localhost:4000, and the Electron app will launch automatically.
  7. For all logging from Electron to be printed to the terminal (e.g. console.log statements within app.js), you might need to set env ELECTRON_ENABLE_LOGGING=1.

Note: Simplenote API features such as sharing and publishing will not work with development builds. Due to a limitation of make, installation paths used for build cannot have spaces.

Building

  • make package-osx
  • make package-win32
  • make package-linux

Testing

Unit tests are run with npm test.

Coding Guidelines

Please adhere to the same guidelines as found in wp-calypso.

See CONTRIBUTING.md for more guidelines.

Dependencies

  • node-simperium for Simperium syncing.
  • ReactJS for UI.
  • Electron for wrapping the JavaScript application.
  • rpm must be installed in order to build Linux packages (brew install rpm on OSX).

Simplenote for Other Platforms

simplenote-electron is the official Simplenote desktop app for Windows and Linux.

For other platforms, see:


Overview (`desktop/app-quit/README.md`)

App Quit

Determines whether the app should quit and exit, or quit to background.

Note that the implementation of quit-to-background is left up to platform.


Overview (`desktop/updater/README.md`)

Updater

Uses either the manual or auto updater to check for updates.

The config updater.url is used as the base URL and has the platform, version, and beta setting appended.

The updater uses:


Overview (`lib/analytics/README.md`)

Analytics

This module is a simplified version of the analytics module found in WP-Calypso.

Original: https://github.com/Automattic/wp-calypso/tree/master/client/analytics

Tracks API

analytics#tracks#recordEvent( eventName, eventProperties )

Record an event with optional properties:

js
analytics.tracks.recordEvent( 'calypso_checkout_coupon_apply', {
	'coupon_code': 'abc123'
} );

Overview (`desktop/updater/auto-updater/README.md`)

Auto Updater

Handles Squirrel auto-update events. Note that the app must be signed for this to work.

Functions

ping() - checks for an update


Overview (`desktop/updater/manual-updater/README.md`)

Manual Updater

Provides a manual updater on platforms where the auto updater does not work.

If an update is detected then a dialog is shown with a link to the update for download.

The update is shown once until the app is restarted.

Functions

ping() - checks for an update


Overview (`lib/utils/export/README.md`)

Simplenote Export

This module provides a couple of functions for exporting all of the notes in the active account.

The output of exportNote() is an object containing a map of two arrays: the active notes in an account; the trashed notes in an account.

The notes will be sorted by last modification time with the most recently-modified notes appearing first in the list.

The output from exportNotes() can be fed into noteExportToZip() to generate a JSZip object containing the information for creating a zip archive of the notes.
This archive contains each note as its own file with a generated filename and the list of associated tags at the end of the content.

Example export

json
{
  "activeNotes": [ {
    "id": "some-auto-generated-id",
    "content": "Simplenote is so simple! I love it.",
    "creationDate": "2016-11-18T23:28:42.957Z",
    "lastModified": "2016-12-22T21:59:36.623Z"
  }, {
    "id": "some-auto-generated-id-that-is-unique",
    "content": "This note can be accessed from a secret URL",
    "creationDate": "2016-07-02T07:24:22.699Z",
    "lastModified": "2016-11-29T16:55:49.890Z",
    "publicURL": "http://simp.ly/p/short-url-string"
  }, {
    "id": "some-auto-generated-id-again",
    "content": "Sharing is caring",
    "creationDate": "2016-10-01T08:40:33.968Z",
    "lastModified": "2016-10-30T01:57:56.050Z",
    "tags": [
      "reminders",
      "people"
    ],
    "collaboratorEmails": [
      "[email protected]",
      "[email protected]"
    ]
  } ],
  "trashedNotes": [ {
    "id": "some-different-auto-generated-id",
    "content": "This note is no longer relevant",
    "creationDate": "2015-11-18T10:13:42.138Z",
    "lastModified": "2016-01-13T14:03:33.583Z",
    "tags": [
      "the departed"
    ]
  } ]
}

Overview (`lib/utils/import/README.MD`)

Simplenote Import

This is the core importer for Simplenote. It expects an object of notes in the same format as the import module. It is aggressive about only allowing certain properties, and converts dates into timestamps where appropriate. Importing specific export files (Such as Evernote .enex) should use a separate conversion script and then pass the resulting object to importNotes().

Example object with allowed properties:

text
{
  "activeNotes": [
    {
      "content": "Random thought: How much wood could a woodchuck chuck if a woodchuck could chuck wood?",
      "creationDate": "2013-10-16T20:17:41.760Z",
      "lastModified": "2018-10-10T22:07:54.128Z",
      "pinned": true,
      "tags": [
        "Reminders"
      ]
    },
  ],
  "trashedNotes": [
    {
      "content": "Hello, world!",
      "creationDate": "2016-02-29T23:01:03.115Z",
      "lastModified": "2016-02-29T23:01:08.000Z"
    }
  ]
}

Packaging (`docs/packaging.md`)

Building a Release

  • make osx
  • make linux
  • make win32

Packaging

Some builds require further packaging before they can be released:

  • make package-win32 - Produces a signed Setup.exe install wizard
  • make package-osx - Produces a DMG file
  • make package-linux - Produces a .deb, .rpm and .AppImage file for x86 and x64 processors

Requirements

Mac Package

A Mac build requires the app to be signed. This prevents a security warning being issued when you run the app.

You can obtain all the appropriate signing certificates from an Apple Developer account.

Note that you need the certificates installed prior to building.

Windows Package

The Windows package requires installing a valid certificate, installing the makensis, wine and mono packages, installable from brew.

brew install mono wine makensis

The Windows build doesn't get signed until the packaging stage.

Linux Package

The Linux package is built using electron-builder which is a tool that makes it easy to build different package systems. electron-builder should be installed by npm install.

Note for creating Linux package on Linux

  1. Creating all Linux packages requires tool for converting .icns file to .png. May be installed via apt by typing:

    sudo apt install --no-install-recommends -y icnsutils

  2. Creating .rpm package requires rpm package, installable from 'apt'.

    sudo apt install --no-install-recommends -y rpm

Note for creating Linux package on MacOS:

  1. Creating Linux package on MacOS requires rpm package, installable from brew.

    brew install rpm


--- METRICS ---