Skip to content

About

ivyNote Client for macos and ios.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

常青笔记 Ivynote for Apple platforms

Native client for iPhone, iPad and Mac. One SwiftUI app target, bundle ID app.ivynote (one App Store record, universal purchase).

The server, web client, and the protocol this client implements live in the ivynote repository. The source of truth for the API and sync protocol is ivynote/client/docs/client-development-guide.md; this repository does not keep a copy. Server changes that affect clients get an issue here.

Server API /api/v1, tested against ivynote dev (2026-11)
Platforms iOS / iPadOS 17+, macOS 14+
Language Swift 6, strict concurrency

Layout

project.yml        XcodeGen spec; Ivynote.xcodeproj is generated, not committed
Config.xcconfig    shared settings; includes your git-ignored Local.xcconfig
App/               SwiftUI app (iOS + macOS)
App/Editor/        built note editor page (generated by EditorWeb/build.sh, committed)
EditorWeb/         sources of that page: the bridge and the native frame
IvynoteKit/        Swift package with no UI: API client, session, Keychain,
                   local SQLite store, sync engine (HLC, outbox, push/pull, SSE)

IvynoteKit holds everything that can be tested without a simulator. UI code stays thin.

Dates, reminders and protected notes

  • Dates (guide 9.4): @明天 9点 completion, date chips and the picker come with the editor page; the iPhone format bar and the note menu have 日期与提醒.
  • Agenda (library menu → 日程, AgendaView): open dated to-dos across the library, check them off, open a note at its task.
  • Reminders (Reminders.swift, Tasks in IvynoteKit): local notifications for the next 48 reminders, set again a moment after any change; permission is asked the first time there is something to remind of.
  • Password-protected notes (guide 8.4): the editor page shows the lock panel, asks for the password and seals every edit; the app only ever stores and syncs the sealed body. Note menu: 设置密码 / 更改密码 / 移除密码 / 立即锁定. Protected notes are found by title only, cannot be shared, and take no part in the agenda or reminders.

Getting started

brew install xcodegen
cp Local.xcconfig.example Local.xcconfig   # set DEVELOPMENT_TEAM to your Team ID
make open

make test runs the IvynoteKit tests. make test-live SERVER=http://127.0.0.1:18080 also runs an account lifecycle test against a real server: it registers a throwaway account, so use a disposable data directory, e.g. in ivynote/server:

IVY_MASTER_KEYS='k1:cUA297OzjWn7QmBrON/J1bDRS2v9NQJQUMTHFsS8Mwk=' go run . serve -data-dir /tmp/ivy-apple -http 127.0.0.1:18080

The note editor

Notes are edited with the web client's own editor (ivynote/client/packages/editor: CodeMirror 6 with live preview, tables, mermaid, wiki links) in a WKWebView, so both clients render Markdown the same way. EditorWeb/build.sh bundles it with esbuild and compiles the web's styles (ui/app.css, the styles of Editor.svelte) with Tailwind, using the tools installed in ivynote:

(cd ../ivynote && npm install)   # once
EditorWeb/build.sh               # after changing EditorWeb/ or pulling ivynote

The page is served from the app bundle under ivyapp://editor/; attachments (ivy://res/<id>) load from ivyapp://editor/res/<id>, which the app fetches with the account's token and caches on disk (files not uploaded yet are read from the library's folder). Pasted and dropped files come back to Swift, which uploads them and inserts the reference; backlinks are listed below the body. Swift talks to the page through window.ivy (see EditorWeb/main.ts); the page reports edits, link taps and focus back.

Debug builds accept -ivyOpenNote <title> to open a note at launch:

xcrun simctl launch booted app.ivynote -ivyOpenNote "Some title"

Rules carried over from the guide

  • Self-hosted: the user enters the server address; nothing is hard-coded. Plain http is accepted only on the local network (ATS NSAllowsLocalNetworking) and shows a warning unless it is this device.
  • Bearer token only, no cookies; the token and cached user live in the Keychain (AfterFirstUnlockThisDeviceOnly).
  • Session restore: open with the cached account, refresh with GET /me; only 401/403 end the session, network errors and 5xx mean offline.
  • Never log tokens, passwords or note content.
  • The admin console is not rebuilt here; admins get a link to {server}/admin.
  • Interface language (guide §界面语言): 简体中文 and English, every string from IvynoteKit/Strings.swift (one protocol, so a missing translation does not compile; views read it as L, other code as L10n.s). Order: the signed-in account's User.language, then the choice made on this device (remembered), then the system (first supported language, else English). Pickers sit in the library menu, the libraries list and the account sheet; choosing while signed in sends PATCH /me {language} ("follow the system" clears it; offline it is kept and sent later). Sign-up sends the language in use. Dates follow the interface language (LanguageSettings).

CI & Releases

  • Branch / PR CI (.github/workflows/ci.yml):
    • Pull requests and pushes to main, dev, release, and release/** run IvynoteKit unit tests, editor asset checks, macOS Debug, and iOS Simulator Debug builds.
    • Pushes to main, dev, release, and release/** additionally archive and verify the Universal macOS .dmg and unsigned iOS Device .ipa.
  • Tag Release (.github/workflows/release.yml):
    • Push a vX.Y.Z tag (e.g. git tag v0.2.0 && git push origin v0.2.0). Tags with a suffix (v0.2.0-beta.1) are published as pre-releases.
    • Runs IvynoteKit tests in parallel with Universal macOS (arm64 + x86_64) .dmg and iOS .ipa builds; publishes the GitHub Release (with SHA256SUMS.txt and auto-grouped changelog via .github/release.yml) only after every check succeeds.
    • Works out of the box without signing secrets (ad-hoc macOS .dmg + unsigned iOS .ipa). Configure optional repository secrets to enable Developer ID signing/notarization and signed iOS export:
      • macOS signing: APPLE_TEAM_ID, MACOS_SIGN_P12_BASE64, MACOS_SIGN_P12_PASSWORD
      • macOS notarization: APPLE_NOTARY_KEY_BASE64, APPLE_NOTARY_KEY_ID, APPLE_NOTARY_ISSUER_ID
      • iOS signing: APPLE_TEAM_ID, IOS_SIGN_P12_BASE64, IOS_SIGN_P12_PASSWORD, IOS_PROVISION_PROFILE_BASE64 (and optional variable IOS_EXPORT_METHOD, default release-testing)
      • Website refresh: SITE_ADMIN_TOKEN

Roadmap

  1. Connect, sign in, sign up, session restore
  2. Local store (SQLite) and sync engine: HLC, outbox, push/pull, SSE (guide ch. 6) SyncEngine is a port of the web client's packages/core/src/sync/engine.ts; keep the two in step when the protocol changes.
  3. Library tree, note list, editor with live preview (the web's CodeMirror), tags editing; next: faster list for large libraries
  4. Attachments, offline upload queue (guide ch. 7): photos, camera, files, paste and drop; offline files wait under local- ids in the library's uploads/ folder and are uploaded before each push
  5. Search, [[wiki links]], backlinks (computed locally, Links)
  6. History, sharing, media library; next: settings

About

ivyNote Client for macos and ios.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages