Skip to content

ulmarise/ordkamera

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Ordkamera 🇸🇪

Built in an afternoon of pair-programming with Claude Code (Claude Fable 5) — from idea to working app.

Learn Swedish with your camera. Photograph an object → Claude tells you what it's called in Swedish (with the right en/ett article, pronunciation hint, and an example sentence) → save it as a flashcard with your own photo → practice with spaced repetition.

Single-file web app — no build step, no server code.

Run locally

cd ordkamera
python3 -m http.server 8642

Open http://localhost:8642, tap ⚙︎, and paste your Anthropic API key (create one at https://console.anthropic.com → API Keys). The key is stored only in your browser's localStorage and sent only to the Anthropic API.

Use it on your phone

The app is hosted at https://ulmarise.github.io/ordkamera/

  1. Open that URL on your phone (Safari on iPhone, Chrome on Android).
  2. Tap ⚙︎ and paste your Anthropic API key once.
  3. Add it to your home screen so it behaves like an app: iPhone: Share → Add to Home Screen · Android: ⋮ → Add to Home screen.

Host your own copy

The camera needs https:// (or localhost), so any static host works — the simplest is GitHub Pages:

  1. Fork this repository (or clone it and push to your own).
  2. Your repo → Settings → Pages → deploy from the main branch, root folder.
  3. Your copy appears at https://YOURNAME.github.io/ordkamera/.

How it works

  • Vision (scene mode): photos are resized to ≤1024 px and sent to claude-opus-4-8 via the official @anthropic-ai/sdk (browser mode). Claude returns up to 8 visible objects — each with article, pronunciation hint, and example sentence — and you tick the ones to save as cards. A "Not quite?" button lets you correct the identification and re-ask. A JSON schema (structured outputs) guarantees a parseable response.
  • Pronunciation audio: 🔊 buttons use the device's built-in Swedish text-to-speech voice (Web Speech API) — free, offline, no extra API.
  • Flashcards: stored in localStorage with a 512 px thumbnail of your photo (~50 KB/card; browser limit fits roughly 80–100 cards — enough for a prototype, IndexedDB is the upgrade path).
  • Spaced repetition: SM-2-style scheduling — Again / Hard / Good / Easy map to 10 min / ~1 d / 1→3→(×ease) d intervals. Reviews are shown when you open the app (no push notifications in v1).

Cost

Each photo is one vision request to Claude Opus — roughly 1–2 cents per scan. Reviewing cards costs nothing (fully offline/local).

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages