JapaCounter is a production-grade, privacy-first, AI-assisted mantra repetition counter built as a precision spiritual instrument.
- Trustworthy counting over flashy novelty.
- Immersive premium minimalist ritual UX.
- Local-first audio processing and storage.
- Next.js App Router + React + TypeScript strict mode
- Tailwind CSS + Framer Motion
- Vercel-compatible architecture
app/: routes for marketing, live session, settings, history, privacy.hooks/useChantSession.ts: microphone pipeline and real-time loop.lib/audio/fingerprint.ts: deterministic fingerprint extraction + cosine similarity.lib/engine/counting-engine.ts: anti-double-counting, cooldown gating, confidence thresholds.hooks/useLocalSessions.ts: local-only persistence.
- Capture microphone stream with
getUserMedia. - Analyze frames with
AnalyserNode. - Build compact spectral-temporal fingerprint per frame.
- Compute similarity against recorded reference mantra.
- Run VAD energy gate to filter silence/breathing/noise.
- Send candidates to deterministic counting engine.
- Deterministic first: a repetition is counted only when threshold and cooldown windows pass.
- Adaptive cooldown scales with the reference tempo.
- Confidence is continuously exposed to UI.
- No server-side audio storage.
- No mandatory account.
- Session history kept in localStorage.
npm install
npm run buildDeploy directly to Vercel.
- AudioWorklet + Worker offloading
- Silero/WebRTC VAD integration
- Optional ONNX local model refinement
- IndexedDB archival + export/import
- PWA offline temple mode