bir ayet — “one verse.” An evidence-based verbatim-memory engine for Quran Hifz — not a Quran reader.
Doesn't help you read Quran. Stops you forgetting it — by attacking the exact ways huffaz actually fail.
English · Azərbaycanca
BirAye is an evidence-based Quran memorization app. Where most apps are audio players with a full mushaf, BirAye is built around the cognitive science of verbatim sequence memory and traditional Hifz pedagogy: spaced review, deliberate scaffold withdrawal, and similar-verse disambiguation.
- Three-tier spaced review mirroring the classic sabaq / sabqi / manzil cycle, driven by an SM-2 / FSRS-lite scheduler tuned for verbatim recall — not flashcard facts.
- Scaffold withdrawal — audio and text support fade as a memory strengthens
(
full → text → first-word → blind recall), because research shows audio aids encoding but reduces retrieval difficulty at review. - Mutashabihat engine — automatic contrastive drilling of mutually-similar verses, the #1 cause of Hifz errors and a gap in every existing app.
- Teacher's logbook, not a replacement — the human teacher stays the accuracy gate; the app schedules, tracks, and exports a log.
- Repeat trainer — loop any verse range with configurable per-ayah and whole-range repeats and adjustable playback speed.
- Backend: Python / FastAPI + SQLite
- Frontend: responsive web (browser + installable PWA, phone-friendly)
- Data: open APIs — quran.com for word-by-word Uthmani text, English (Saheeh International) and Azerbaijani (Bünyadov–Məmmədəliyev) translations, Mishary Alafasy per-ayah audio and the word-level audio timings that drive the highlight; alquran.cloud for the full-text similarity graph — all cached locally.
pip install -r requirements.txt
cd src
python -m uvicorn biraye.app:app --reloadOpen http://127.0.0.1:8000.
The app has five tabs: Read, Drill, Similar, Review, Log. Switch language (English / Azerbaijani) from the toggle in the top-right corner.
- Pick a surah from the dropdown.
- For each ayah you can:
- ▶ Listen — play the recitation.
- + Memorize — start tracking it (enters the sabaq queue for review).
- ≈ Similar — show mutashabihat (similar verses) with the differing words highlighted in yellow so you can learn to tell them apart.
Loop a range of verses to drum them in.
- Choose a Surah, then a From ayah and To ayah (e.g. Al-Baqarah 7 → 20).
- Set the loop counts — each button cycles on every click:
- Each ayah × — how many times each ayah repeats before moving on
(
1 → 2 → 3 → 4 → 5 → 10 → ∞). - Whole range × — how many times the entire range repeats
(
1 → 2 → 3 → 4 → 5 → 10 → ∞). - Speed — playback tempo (
×0.5 → ×1 → ×1.5 → ×2); can be changed live while a drill is playing.
- Each ayah × — how many times each ayah repeats before moving on
(
- Press ▶ Start drill. A status line shows the current ayah, which repeat, and which pass you're on. ⏸ Pause holds your place; ⏹ Stop resets.
Browse every pair of verses that are easy to confuse (computed automatically — ~1,400 pairs). Filter by surah, then tap any pair to expand the two verses side by side with the differing words highlighted. This is the feature no other app has — see How the mutashabihat engine works.
Example: Baqarah 7→20, Each ayah ×5, Whole range ×∞, Speed ×1 — plays each verse five times, walks the whole range, then loops the range forever.
- Memorized ayahs become due here over time. The due badge shows how many.
- Each due ayah is a recall card. How much help you get depends on how strong the
memory is (the scaffold level, shown in a note):
- full — text shown, audio available
- text — text only, audio withdrawn (recall the sound)
- first word — only the first word shown
- blind — nothing shown; recite from memory, then Reveal ayah to self-check
- Recite, then rate honestly: Again / Hard / Good / Easy. This reschedules the ayah.
- If the ayah has similar verses, a ⚠ contrast panel appears so you drill the difference while it's fresh.
- The "Review as of" date picker lets you jump to a future day to see what would be due — handy for trying the scheduler without waiting.
A table of every tracked ayah (tier, repetitions, lapses, last review, due date). Press Export CSV to download it and share with a teacher.
BirAye is a Progressive Web App. In a mobile browser (or desktop Chrome) use
Add to Home Screen / the install icon to run it like a native app; it works
offline after the first load. (Installation requires https:// or localhost —
plain http:// over a local network won't enable it.)
| Method | Endpoint | Purpose |
|---|---|---|
GET |
/api/health |
liveness |
GET |
/api/surahs |
list all 114 surahs |
GET |
/api/surah/{n} |
one surah: text + translation + audio |
POST |
/api/memorize |
start tracking an ayah |
POST |
/api/review |
rate recall, reschedule |
GET |
/api/queue?as_of=YYYY-MM-DD |
due ayahs by tier |
GET |
/api/progress |
counts per tier |
GET |
/api/similar/{s}/{a} |
similar verses with contrastive diffs |
GET |
/api/mutashabihat |
all unique similar-verse pairs |
GET |
/api/log |
full logbook of tracked ayahs |
Mutashabihat (المتشابهات) are mutually-similar verses — near-identical wording that differs by a word, particle, or order. They are the #1 cause of Hifz errors: the memory pattern-matches the shared part and "jumps the track" onto the wrong verse. Traditional teachers drill these pairs side by side; no mainstream app does.
BirAye builds the similar-verse graph algorithmically from the Quran text — no curated dataset:
- Normalize each ayah — strip diacritics/tatweel and fold letter variants
(
أ إ آ ٱ → ا,ة → ه, …) so comparison is on essence, not spelling. - Candidate gate — index every shared 4-word phrase; two verses are candidates only if they share one. (Cheap; throws away unrelated pairs.)
- Score candidates by token-sequence similarity; keep pairs ≥ 55% alike.
- Diff each pair both ways and flag the differing words for highlighting.
The graph (~1,400 pairs over 6,236 ayahs) is computed once and cached. The Similar tab lets you browse it; in Review, twins surface automatically beside a due ayah.
BirAye's design rests on two studies — one on the value of Hifz itself, one on the learning science behind its core feature. (In the app, the 📖 Research button shows these with a short note on how each is applied.)
- Nawaz, N. & Jahangir, S. F. (2015). Effects of memorizing Quran by heart (Hifz) on later academic achievement. Journal of Islamic Studies and Culture, 3(1), 58–64. — children who completed Hifz showed stronger later academic achievement; disciplined verbatim memorization trains memory, attention, and persistence. BirAye treats Hifz as serious verbatim training and gives it a retention engine.
- Birnbaum, M. S., Kornell, N., Bjork, E. L. & Bjork, R. A. (2013). Why interleaving enhances inductive learning: The roles of discrimination and retrieval. Memory & Cognition, 41(3), 392–402. — studying similar items mixed together forces the brain to discriminate between confusable things. This is the Similar (mutashabihat) tab: near-identical verses drilled side by side with the differences highlighted.
Built milestone-by-milestone — see ROADMAP.md. Done: M0–M6 (skeleton, read+listen, three-tier scheduler, scaffold-withdrawal recall, mutashabihat engine, PWA + teacher logbook, repeat trainer), the similar-verse browser, and English/Azerbaijani localization — plus CI / CodeQL / Dependabot / pre-commit and a test suite.
⚠️ Alpha. In testing with early users. Data is per-device for now; accounts, cloud sync, and a persistent database are planned.
