Skip to content

Photograph handwritten journal entries, OCR them with Claude, and save to Obsidian

Notifications You must be signed in to change notification settings

henryaj/journalizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Journalizer

Photograph handwritten journal entries, OCR them, and save to Obsidian.

Features

  • Mobile-friendly PWA for capturing journal pages
  • Multi-page batch capture
  • OCR via HandwritingOCR.com (recommended) or Claude Vision
  • Automatic date extraction from handwriting
  • Multi-entry splitting (different dates on same page)
  • Structured markdown output with frontmatter
  • Direct save to Obsidian vault

Architecture

Mobile Browser (PWA) → Local Python Server → Claude Vision → Obsidian Vault

Setup

1. Install Backend Dependencies

cd server
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -r requirements.txt

2. Configure

Create server/.env:

# Path to your Obsidian vault
VAULT_PATH=~/Obsidian

# OCR provider: "handwriting-ocr" (recommended), "claude-code", or "api"
OCR_PROVIDER=handwriting-ocr

# For handwriting-ocr provider:
HANDWRITING_OCR_API_KEY=your-token
ANTHROPIC_API_KEY=your-api-key

# For claude-code provider: no keys needed (uses local Claude Code CLI)
# For api provider: only ANTHROPIC_API_KEY needed

3. Install Frontend Dependencies

cd web
npm install

4. Set Up HTTPS (Required for mobile camera access)

Mobile browsers require HTTPS to access the camera. Choose one option:

Option A: mkcert (Recommended for local development)

# Install mkcert
brew install mkcert  # macOS
# or: choco install mkcert  # Windows
# or: apt install mkcert  # Linux

# Create local CA and certificates
mkcert -install
cd server
mkcert localhost 127.0.0.1 ::1 $(hostname).local

# This creates localhost+3.pem and localhost+3-key.pem

Option B: Tailscale (Recommended for easy access)

If you use Tailscale, you get automatic HTTPS:

# Your server will be available at:
# https://your-machine.tailnet-name.ts.net:8000

5. Run the Server

cd server
source venv/bin/activate

# Without HTTPS (localhost only):
python main.py

# With HTTPS (for mobile access):
uvicorn main:app --host 0.0.0.0 --port 8000 \
  --ssl-keyfile localhost+3-key.pem \
  --ssl-certfile localhost+3.pem

6. Run the Frontend

cd web

# Development:
npm run dev

# The frontend will be available at http://localhost:5173
# For mobile, set VITE_API_URL to your server's HTTPS URL
VITE_API_URL=https://your-mac.local:8000 npm run dev

7. Access from Mobile

  1. Find your Mac's local IP: ipconfig getifaddr en0
  2. On your phone, visit: https://YOUR_IP:5173
  3. Accept the self-signed certificate warning
  4. Add to home screen for PWA experience

Usage

  1. Open the app on your phone
  2. Tap the capture button to photograph your journal page
  3. Add more pages if needed (multi-page entries)
  4. Tap "Transcribe" to send to Claude for OCR
  5. If no date is detected, you'll be prompted to enter one
  6. Review the transcription and tap "Save to Obsidian"

Output Format

Each entry is saved as:

---
date: 2025-01-22
type: journal
source: handwritten-ocr
tags: [reflection, ideas]
---

# January 22, 2025

[Transcribed and cleaned text...]

---

*Transcribed from handwritten entry*

![[journal-2025-01-22-001.jpg]]

OCR Providers

HandwritingOCR (Recommended)

Uses HandwritingOCR.com for transcription, then Claude Haiku for post-processing (date detection, entry splitting, cleanup). Best accuracy for handwritten text.

OCR_PROVIDER=handwriting-ocr
HANDWRITING_OCR_API_KEY=your-token  # Get from handwritingocr.com/settings/api
ANTHROPIC_API_KEY=sk-ant-...        # For Claude Haiku post-processing

Claude Code CLI (Fallback)

Uses claude -p with vision - consumes your Claude Code subscription allowance. No API keys needed if you have Claude Code installed locally.

OCR_PROVIDER=claude-code

Claude API

Direct Claude Vision API calls - pay per request.

OCR_PROVIDER=api
ANTHROPIC_API_KEY=sk-ant-...

Development

# Run backend with auto-reload
cd server && python main.py

# Run frontend with hot-reload
cd web && npm run dev

Troubleshooting

Camera not working on mobile

  • Ensure you're using HTTPS
  • Check that camera permissions are granted
  • Try refreshing the page

Server connection failed

  • Check that the server is running
  • Verify the API URL is correct
  • Ensure you're on the same network

OCR failing

  • Check Claude Code is installed: claude --version
  • Or set up API key in .env

About

Photograph handwritten journal entries, OCR them with Claude, and save to Obsidian

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published