Skip to content

About

iPhone PWA: photo of printed text → transcribe + speak aloud. Vite + React + Cloudflare Worker + Gemini 2.5 Flash.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

reader-app

PWA that captures a photo of printed text, transcribes it, detects the language, and speaks it aloud using the OS speech engine.

Live: https://reader-app.pages.dev — API: https://reader-app-api.ohrytskov20230516.workers.dev

reader-app/
├── src/                     # React app (the PWA)
├── worker/                  # Cloudflare Worker (Gemini integration)
│   ├── src/index.ts
│   └── wrangler.toml
└── index.html

Local dev

pnpm install
cd worker && pnpm install && cd ..

# worker
cd worker
echo "GEMINI_API_KEY=<your-key>" > .dev.vars
pnpm dev

# frontend (in another shell)
echo "VITE_API_URL=http://localhost:8787" > .env.local
pnpm dev

Deploy

cd worker
pnpm wrangler secret put GEMINI_API_KEY
pnpm wrangler deploy

cd ..
echo "VITE_API_URL=https://reader-app-api.<account>.workers.dev" > .env.production
pnpm build
pnpm wrangler pages deploy dist --project-name=reader-app

API

POST /
Content-Type: application/json
{ "imageBase64": "<base64-no-prefix>", "mimeType": "image/jpeg" }

→ 200 { "text": "...", "language": "uk" }
→ 400 { "error": "missing_image" | "invalid_json" }
→ 502 { "error": "ai_failed" | "ai_no_answer" | "ai_bad_format" }

Gemini is asked with a JSON-schema-enforced response, so language is a 2-letter ISO 639-1 code.

About

iPhone PWA: photo of printed text → transcribe + speak aloud. Vite + React + Cloudflare Worker + Gemini 2.5 Flash.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages