68 lines
1.9 KiB
Markdown
68 lines
1.9 KiB
Markdown
|
|
# BadNote
|
||
|
|
|
||
|
|
Local-first Surface Pen note-taking app with PDF/PPT annotation.
|
||
|
|
|
||
|
|
All notes, documents, search, and OCR run on your device. No server is required to use the app.
|
||
|
|
|
||
|
|
## Features
|
||
|
|
|
||
|
|
- Ink notes with Surface Pen (pressure, stabilizer, undo/redo)
|
||
|
|
- PDF and PPT import with page-level annotation
|
||
|
|
- Full-text search over note titles, typed text, and OCR results
|
||
|
|
- **Local OCR** — handwriting recognition via Windows built-in OCR (Windows desktop)
|
||
|
|
|
||
|
|
## Build (Windows)
|
||
|
|
|
||
|
|
Prerequisites:
|
||
|
|
|
||
|
|
- Flutter SDK (3.10+)
|
||
|
|
- Visual Studio Build Tools with **Desktop development with C++**
|
||
|
|
- Developer Mode enabled (for Flutter plugin symlinks)
|
||
|
|
|
||
|
|
```powershell
|
||
|
|
flutter pub get
|
||
|
|
flutter build windows --release
|
||
|
|
```
|
||
|
|
|
||
|
|
Output: `build\windows\x64\runner\Release\badnote.exe`
|
||
|
|
|
||
|
|
If native asset downloads fail (e.g. sqlite3), set a proxy before building:
|
||
|
|
|
||
|
|
```powershell
|
||
|
|
$env:HTTP_PROXY="http://127.0.0.1:7890"
|
||
|
|
$env:HTTPS_PROXY="http://127.0.0.1:7890"
|
||
|
|
flutter build windows --release
|
||
|
|
```
|
||
|
|
|
||
|
|
## Architecture
|
||
|
|
|
||
|
|
```
|
||
|
|
lib/
|
||
|
|
├── screens/ # UI (notes, PDF/PPT annotator, search, settings)
|
||
|
|
├── services/ # Local business logic
|
||
|
|
│ ├── database_service.dart # SQLite + FTS5
|
||
|
|
│ ├── ocr_service.dart # Local OCR orchestration
|
||
|
|
│ ├── stroke_rasterizer.dart # Ink → PNG for OCR
|
||
|
|
│ └── ocr_engine.dart # Platform OCR bridge
|
||
|
|
├── providers/ # Riverpod state
|
||
|
|
└── widgets/ # Ink canvas, toolbars, thumbnails
|
||
|
|
```
|
||
|
|
|
||
|
|
OCR flow on save:
|
||
|
|
|
||
|
|
1. Extract typed text from text-tool strokes
|
||
|
|
2. Rasterize handwriting strokes to PNG
|
||
|
|
3. Run Windows OCR on the PNG
|
||
|
|
4. Merge recognized text into the local FTS index for search
|
||
|
|
|
||
|
|
## Optional server
|
||
|
|
|
||
|
|
The `server/` directory contains an experimental FastAPI backend (sync + EasyOCR). It is **not required** for the desktop app and is kept separately for future multi-device sync experiments. See [server/README.md](server/README.md).
|
||
|
|
|
||
|
|
## Development
|
||
|
|
|
||
|
|
```bash
|
||
|
|
flutter run -d windows
|
||
|
|
flutter test
|
||
|
|
```
|