# Nobita

> Handwritten notes app in open .xopp (Xournal++) format for iPad and Mac, with reading on iPhone, on-device handwriting and math-to-LaTeX recognition, and a read-only MCP connection for any AI.

- Role: Solo project
- When: Nov 2026 – present
- Stack: Swift, UIKit, PencilKit, CoreML, SQLite FTS5, Mac Catalyst, Python, MCP, WebSocket
- Links: [Project website](https://nobita.ppardocotos.com)
- Image: [Nobita's library on an iPad, with yellow folders and a sidebar showing Library, Favorites and Recents](https://ppardocotos.com/_astro/nobita.oMtbSqLm.webp)
- URL: https://ppardocotos.com/projects/nobita

I study by hand and wanted an iPad and Mac app that continues my Xournal++ `.xopp` notebooks without locking them into a proprietary format, while letting my AI read what I am writing without screenshots. **Nobita** is that app: free, with no subscription, no accounts or hosted servers, and source-available under **PolyForm Shield 1.0.0** (repository still private, in testing).

## Four design decisions

<div class="decisiones una-col">
<div class="decision">
<div class="cab"><b>1. No proprietary format: native <code>.xopp</code> end to end</b><span class="tag ok">Xournal++ round-trip</span></div>
<p>Notebooks are standard <code>.xopp</code> files (with companion PDFs, images and audio beside them, plus legacy <code>.xoj</code> import), compatible with Xournal++ 1.2 and 1.3 with zero conversion or warnings. Nobita-specific extras — exact PencilKit ink, shapes, layer opacity, text index and audio timestamps — travel in <code>nobita:</code> attributes that Xournal++ silently ignores. The earlier custom format (<code>.nob</code>) was removed completely.</p>
</div>
<div class="decision">
<div class="cab"><b>2. On-device handwriting and math-to-LaTeX recognition</b><span class="tag ok">CoreML INT8 · FTS5</span></div>
<p>Handwriting is recognized in the background on device (prioritizing the visible page) and indexed in <strong>SQLite FTS5</strong> outside the notebooks for instant search across the whole library and linked folders. For formulas, <strong>TexTeller 1.0.2</strong> (Apache 2.0) converted to <strong>CoreML INT8</strong> ships inside the app: any lassoed formula can be copied as LaTeX offline, with optional automatic background formula recognition in Settings.</p>
</div>
<div class="decision">
<div class="cab"><b>3. Read-only MCP connector for any AI</b><span class="tag ok">No screenshots · RAM-only</span></div>
<p>A lightweight Python bridge (WebSocket + MCP) connects the app to Claude, ChatGPT, Codex or local models without Nobita servers or writing notebook content to disk. The app pushes live focus to the bridge's RAM for instant lookups, tracks per-client deltas (<code>nobita_cambios</code>), searches across open and closed notebooks and renders grayscale crops only when a messy region needs it. The connection is strictly read-only: your AI can never alter your notebooks.</p>
</div>
<div class="decision">
<div class="cab"><b>4. One app tailored to iPad, Mac and iPhone</b><span class="tag ruido">UIKit · Mac Catalyst</span></div>
<p>On <strong>iPad</strong> it delivers native Apple Pencil ink, ink gestures (scribble-to-erase, circle-to-select), layers, geometry instruments, multiple PDFs per notebook, ink-synced audio with local transcription and an infinite whiteboard. On <strong>Mac</strong> it runs via Mac Catalyst with tabbed windows, split view, full keyboard shortcuts and Finder integration. On <strong>iPhone</strong> notebooks open in read mode — single-tap distraction-free reading, handwriting search and one-tap page text copy — with an Edit button for quick notes by finger.</p>
</div>
</div>

## How context reaches your AI

<div class="flujo">
<div class="paso"><b>Nobita</b>Reads ink locally and pushes live focus to the bridge.</div>
<span class="flecha" aria-hidden="true">→</span>
<div class="paso caja"><b>MCP bridge</b><ul><li>RAM-only (no disk writes)</li><li>per-client live state</li><li>6 read-only tools</li></ul></div>
<span class="flecha" aria-hidden="true">→</span>
<div class="paso"><b>Your AI</b>Queries focus, deltas, pages, library search or a tight crop.</div>
</div>

## Under the hood

- **Portable, tested core:** document models, `.xopp` codec, cloud sync engine, recognition pipeline and connector protocol live in the UI-free `NobitaCore` Swift package (**1,576 tests** in Swift Testing), alongside **34 integration tests** for the Python bridge.
- **One clean cloud plus linked folders:** the default library syncs with **one active cloud at a time** (iCloud Drive, Google Drive, Dropbox or OneDrive) to prevent cross-cloud races, while unlimited external folders can be linked from Files or Finder.
- **Built against data loss:** automatic `.xopp` backups (skipping unchanged companion PDFs), local version history, conflict detection and recoverable trash.
