The book exists. Al-Masāʾil al-Muntakhaba, Sayyid Ali al-Sistani’s practical treatise, is published in full on sistani.org, and it’s the reference for millions of people’s daily practice. What didn’t exist was a good way to read it on a phone: the site needs a connection, PDF scans don’t search, and the forum posts quoting it are quoting from memory.
Marjai (مرجعي, “my marjaʿ”) is a reader for that book. It’s not a fatwa service, it doesn’t summarise, and there is no AI between you and the text. Those three negatives are the design.
Table of contents
Open Table of contents
Get the text, then prove you got it
The content pipeline is a Python scraper that fetches all 200 sections of the book from the official site and writes them to JSON: 26 chapters, 1,463 numbered rulings, plus the section preambles. Then a second script, validate.py, does the part that matters: it compares every ruling’s text to the raw page text minus markup and confirms zero mismatches, checks that every ruling number equals the source’s marker, and checks for empties. The app ships a prebuilt SQLite database generated from that validated JSON.
Two quirks in the source were deliberately preserved. Section 585 has a numbering typo on the site itself (a ruling numbered 258 where 358 is clearly meant), and the final chapter on new questions restarts its numbering. A reader that “fixes” its source is no longer a faithful copy, and a user cross-referencing with the printed book needs the same numbers the book has. So the typo ships. There’s a note about it in the repository and nowhere else.
Masʾala numbering, incidentally, is continuous across the whole book rather than per-section. I “corrected” that once, early, and had to put it back.
Search that works the way people type
Arabic on a phone keyboard is typed without diacritics, with whatever hamza or alef form the keyboard offers first, and with the taa marbuta and haa used interchangeably. A search that requires exact orthography finds nothing.
Every ruling is indexed in a normalised column: tashkīl stripped, hamza variants (أ إ آ ٱ) folded to bare alef, ى folded to ي, ة folded to ه. The query is normalised the same way. So الصلاه finds الصَّلاة, and a user who spells a word slightly differently from the book still lands on the right page. On the original SwiftUI prototype this was SQLite FTS5 with a custom normaliser; in the shipped Compose Multiplatform version it’s a LIKE over the normalised column, which for 1,500 short rulings is instant and far simpler to keep in sync across platforms.
Arabic-only, on purpose
Early on I had a bilingual toggle scaffolded — English text column, English index, a language switch. I ripped all of it out. The rulings are written in Arabic; a translation is an interpretation, and the whole point of the app is that it doesn’t interpret. The interface is Arabic too, set in Amiri, a Naskh typeface designed for exactly this kind of text, with full right-to-left layout via LayoutDirection.Rtl. One typeface everywhere, adjustable size, light and dark.
Browse is a six-tab pager grouping the 26 chapters into fiqh domains — preliminaries, worship, transactions, family and inheritance, food and oaths, new questions — with each chapter carrying an icon and a colour for its domain, so you can find your place by shape before you’ve read a title.
No AI. Really none.
It would be easy to bolt a chat model onto this and call it “ask your marjaʿ”. I won’t. A model that paraphrases a ruling has produced a new ruling with no authority behind it, and a user who trusts the app’s name won’t know the difference. Marjai’s About screen says, in Arabic, that no AI is used to generate or modify rulings and that for taqlid, precaution or new circumstances you refer to the marjaʿ’s office — which is what the book itself says.
One codebase, two stores
Marjai started as a native SwiftUI app with GRDB and FTS5, and I rewrote it in Kotlin Multiplatform with Compose Multiplatform so one codebase could ship to iOS and Android. It’s a good fit for KMP: the shared surface is nearly everything (data, search, navigation, every screen), the UI is text-heavy rather than platform-idiomatic, and the only expect/actual seams are the SQLite driver and the share sheet. SQLDelight for the database, Koin for wiring.
The multi-marjaʿ switcher (the app also carries Sayyid Fadlallah’s Fiqh al-Sharia) came out of the same structure: each book is its own bundled dataset with its own chapter tree, and the reader doesn’t care which one it’s showing.
Free, no ads, forever
The text belongs to its author. The app is a reading aid built on top of it, and charging for it — or putting ads next to it — would be wrong. There’s no account, no analytics, no network call after install. Airplane mode is identical to Wi-Fi.
Marjai is on the App Store and Google Play. If you follow the taqlid of Sayyid Sistani, it’s the book, in your pocket, exactly as printed.