Use this file to discover all available pages before exploring further.
Repository interfaces define the contract between the domain layer and data layer. They specify what data operations are available without exposing implementation details. All repositories return Flow for reactive data streams or suspend functions for one-time operations.
Navigation modes: Supports browsing by surah, juz, or page with optional translations.Search: Full-text search across Arabic text and translations.Bookmarks and favorites: Users can bookmark ayahs with notes and colors, or mark them as favorites.Reading progress: Tracks the last read position and total ayahs read for khatam tracking.
Manages prayer times calculation, prayer tracking records, and location-based settings.
View interface definition
interface PrayerRepository { // Today's prayer records — shared flow for cross-screen sync fun getTodayPrayerRecords(): Flow<Map<PrayerName, PrayerStatus>> // Prayer times calculation fun getPrayerTimesForDate(date: LocalDate, location: Location): PrayerTimes fun getPrayerTimesForRange(startDate: LocalDate, endDate: LocalDate, location: Location): List<PrayerTimes> // Prayer records fun getPrayerRecordsForDate(date: Long): Flow<List<PrayerRecord>> fun getPrayerRecordsInRange(startDate: Long, endDate: Long): Flow<List<PrayerRecord>> suspend fun getPrayerRecord(date: Long, prayerName: PrayerName): PrayerRecord? fun getPrayerRecordsByStatus(status: PrayerStatus): Flow<List<PrayerRecord>> fun getMissedPrayersRequiringQada(): Flow<List<PrayerRecord>> // Prayer record operations suspend fun insertPrayerRecord(record: PrayerRecord) suspend fun insertPrayerRecords(records: List<PrayerRecord>) suspend fun updatePrayerStatus( date: Long, prayerName: PrayerName, status: PrayerStatus, prayedAt: Long?, isJamaah: Boolean ) // Statistics suspend fun getPrayerStats(startDate: Long, endDate: Long): PrayerStats suspend fun getCurrentStreak(currentDate: Long): Int suspend fun getLongestStreak(): Int suspend fun markPastPrayersAsMissed(): Int // Location operations fun getAllLocations(): Flow<List<Location>> fun getCurrentLocation(): Flow<Location?> suspend fun getCurrentLocationSync(): Location? fun getFavoriteLocations(): Flow<List<Location>> suspend fun getLocationById(id: Long): Location? fun searchLocations(query: String): Flow<List<Location>> suspend fun insertLocation(location: Location): Long suspend fun updateLocation(location: Location) suspend fun deleteLocation(location: Location) suspend fun setCurrentLocation(id: Long) suspend fun toggleFavorite(id: Long)}
Prayer times: Calculates times based on location using various calculation methods (MWL, ISNA, etc.).Prayer tracking: Records prayer status (prayed, missed, qada) with timestamps and congregation tracking.Statistics: Provides streak tracking, prayer counts by type, and perfect day counts.Location management: Stores multiple locations with custom calculation settings.
Provides access to hadith collections, books, chapters, and individual hadiths.
View interface definition
interface HadithRepository { // Hadith of the day suspend fun getHadithOfTheDay(): Hadith? // Book operations fun getAllBooks(): Flow<List<HadithBook>> suspend fun getBookById(bookId: String): HadithBook? // Chapter operations fun getChaptersByBook(bookId: String): Flow<List<HadithChapter>> suspend fun getChapterById(chapterId: String): HadithChapter? fun searchChapters(bookId: String, query: String): Flow<List<HadithChapter>> // Hadith operations fun getHadithsByChapter(chapterId: String): Flow<List<Hadith>> fun getHadithsByBook(bookId: String): Flow<List<Hadith>> suspend fun getHadithById(hadithId: String): Hadith? suspend fun getHadithByNumber(bookId: String, hadithNumber: Int): Hadith? fun getHadithsByGrade(grade: HadithGrade): Flow<List<Hadith>> // Search operations fun searchHadiths(query: String): Flow<List<HadithSearchResult>> fun searchHadithsInBook(bookId: String, query: String): Flow<List<HadithSearchResult>> // Bookmark operations fun getAllBookmarks(): Flow<List<HadithBookmark>> fun getBookmarksByBook(bookId: String): Flow<List<HadithBookmark>> suspend fun getBookmarkByHadithId(hadithId: String): HadithBookmark? fun isHadithBookmarked(hadithId: String): Flow<Boolean> suspend fun toggleBookmark(hadithId: String, bookId: String, hadithNumber: Int) suspend fun updateBookmark(bookmark: HadithBookmark) suspend fun deleteBookmark(hadithId: String) // Data initialization suspend fun initializeHadithData() suspend fun isDataInitialized(): Boolean}
Hierarchical browsing: Navigate from books to chapters to individual hadiths.Search: Full-text search across hadith text in Arabic and English.Grading: Filter hadiths by authenticity grade (Sahih, Hasan, Daif, etc.).Hadith of the day: Provides a daily hadith feature.
Manages duas (supplications) organized by categories and occasions.
View interface definition
interface DuaRepository { // Category operations fun getAllCategories(): Flow<List<DuaCategory>> suspend fun getCategoryById(categoryId: String): DuaCategory? // Dua operations fun getDuasByCategory(categoryId: String): Flow<List<Dua>> suspend fun getDuaById(duaId: String): Dua? fun getDuasByOccasion(occasion: DuaOccasion): Flow<List<Dua>> // Search operations fun searchDuas(query: String): Flow<List<DuaSearchResult>> // Bookmark operations fun getAllBookmarks(): Flow<List<DuaBookmark>> fun getFavoriteDuas(): Flow<List<DuaBookmark>> suspend fun getBookmarkByDuaId(duaId: String): DuaBookmark? fun isDuaBookmarked(duaId: String): Flow<Boolean> fun isDuaFavorite(duaId: String): Flow<Boolean> suspend fun toggleFavorite(duaId: String, categoryId: String) suspend fun updateBookmark(bookmark: DuaBookmark) suspend fun deleteBookmark(duaId: String) // Progress operations suspend fun getProgressForDuaOnDate(duaId: String, date: Long): DuaProgress? fun getProgressForDate(date: Long): Flow<List<DuaProgress>> fun getProgressHistoryForDua(duaId: String): Flow<List<DuaProgress>> suspend fun incrementDuaProgress(duaId: String, date: Long, targetCount: Int) suspend fun decrementDuaProgress(duaId: String, date: Long) // Data initialization suspend fun initializeDuaData() suspend fun isDataInitialized(): Boolean}
Category browsing: Duas organized by categories with icons and descriptions.Occasion-based: Filter duas by time or situation (morning, evening, before sleep, etc.).Progress tracking: Track daily completion of duas with repeat counts.Favorites: Mark frequently used duas for quick access.
Manages Quran completion goals and reading progress tracking.
View interface definition
interface KhatamRepository { // Khatam CRUD suspend fun createKhatam(khatam: Khatam): Long suspend fun getActiveKhatam(): Khatam? fun observeActiveKhatam(): Flow<Khatam?> suspend fun setActiveKhatam(khatamId: Long) // Progress tracking suspend fun markAyahsRead(khatamId: Long, ayahIds: List<Int>) suspend fun getReadAyahIds(khatamId: Long): Set<Int> fun observeReadAyahIds(khatamId: Long): Flow<Set<Int>> suspend fun getJuzProgress(khatamId: Long): List<JuzProgressInfo> fun observeDailyLogs(khatamId: Long): Flow<List<DailyLogEntry>> // Status updates suspend fun completeKhatam(khatamId: Long) suspend fun abandonKhatam(khatamId: Long) suspend fun reactivateKhatam(khatamId: Long) suspend fun deleteKhatam(khatamId: Long) // Statistics suspend fun getKhatamStats(): KhatamStats suspend fun getNextUnreadPosition(khatamId: Long): Pair<Int, Int>?}
Active tracking: One khatam can be active at a time for focused tracking.Granular progress: Tracks which specific ayahs have been read.Juz visualization: Shows progress across all 30 juz.Daily logs: Records daily reading counts for streak and pace calculation.
Tracks Ramadan fasting, voluntary fasts, and makeup fasts.
View interface definition
interface FastingRepository { // Fast records fun getFastRecordsForDateRange(startDate: Long, endDate: Long): Flow<List<FastRecord>> suspend fun getFastRecord(date: Long): FastRecord? suspend fun insertFastRecord(record: FastRecord) suspend fun updateFastRecord(record: FastRecord) suspend fun deleteFastRecord(date: Long) // Makeup fasts fun getMakeupFasts(): Flow<List<MakeupFast>> fun getPendingMakeupFasts(): Flow<List<MakeupFast>> suspend fun insertMakeupFast(makeupFast: MakeupFast) suspend fun completeMakeupFast(id: Long, completedDate: Long) // Statistics suspend fun getFastingStats(startDate: Long, endDate: Long): FastingStats suspend fun getRamadanProgress(year: Int): RamadanProgress}
Daily tracking: Records fasting status with suhoor and iftar times.Exemptions: Tracks reasons for not fasting (travel, illness, etc.).Makeup tracking: Manages makeup fasts with status and fidya tracking.Ramadan overview: Special progress view for Ramadan month.
interface ZakatRepository { // Calculations suspend fun saveCalculation(calculation: ZakatCalculation): Long fun getCalculationHistory(): Flow<List<ZakatCalculation>> suspend fun getLatestCalculation(): ZakatCalculation? // Metal prices suspend fun getCurrentMetalPrices(): Pair<MetalPrice, MetalPrice> // Gold, Silver suspend fun updateMetalPrice(metalPrice: MetalPrice)}
Calculation: Computes zakat based on assets, liabilities, and nisab threshold.History: Stores past calculations for reference.Metal prices: Tracks current gold and silver prices for nisab calculation.
interface TasbihRepository { // Presets fun getAllPresets(): Flow<List<TasbihPreset>> fun getPresetsByCategory(category: TasbihCategory): Flow<List<TasbihPreset>> suspend fun insertPreset(preset: TasbihPreset): Long suspend fun updatePreset(preset: TasbihPreset) suspend fun deletePreset(id: Long) // Sessions fun getSessionHistory(): Flow<List<TasbihSession>> suspend fun insertSession(session: TasbihSession): Long suspend fun updateSession(session: TasbihSession) // Statistics suspend fun getTasbihStats(startDate: Long, endDate: Long): TasbihStats}
Presets: Predefined dhikr phrases with target counts.Sessions: Tracks individual counting sessions with duration.Statistics: Total counts, completed sessions, and most used presets.
interface AsmaUlHusnaRepository { fun getAllNames(): Flow<List<AsmaUlHusna>> suspend fun getNameByNumber(number: Int): AsmaUlHusna? fun getFavoriteNames(): Flow<List<AsmaUlHusna>> suspend fun toggleFavorite(id: Int) fun searchNames(query: String): Flow<List<AsmaUlHusna>>}
Complete list: All 99 names with meanings, explanations, and benefits.Search: Find names by Arabic, transliteration, or meaning.Favorites: Mark frequently referenced names.