How alfaazplus/quranapp works
Project type and purpose
• This is a native Android mobile application (“QuranApp”) with one main Gradle module (app/) and a secondary UI library module (peacedesign/).
• Purpose: Provide an ad-free, privacy-focused Quran reading and exploration experience.
File structure
• Top-level modules:
• app/ – the main application containing UI, business logic, data, assets and resources.
• peacedesign/ – a reusable UI component library (dialogs, animations, widgets, utils).
• app/src/main/java/com/quranapp/android/ subdivides into:
• activities/, frags/, views/, viewModels/ → presentation layer (Screens + ViewModels).
• api/ → Retrofit configuration, remote endpoints (QuranApi, GithubApi) and related model classes.
• db/ → SQLite contracts & helpers for bookmarks, search history, translations, read history.
• components/ → data models shared across layers.
• reader_managers/, utils/, interfaceUtils/, services/, receivers/ → domain and background services.
• adapters/, vh/ → RecyclerView adapters and view holders.
• app/src/main/assets/ and inventory/ store static JSON data for verses, translations, recitations, tafsir, fonts and version manifests.
• Build, CI and deployment files: build.gradle, GitHub Actions (.github/workflows/ci.yml), Fastlane metadata.
README
• Confirms it’s a feature-rich Quran reading app: multiple fonts, translations, recitations, reminders.
• Points to external data sources (QuranEnc, Tanzil, quran.com) and shows distribution targets (Google Play, F-Droid).
a. Main components
• UI Layer
– Activities & Fragments
– Custom Views & Widgets (from peacedesign/ and app/src/main/java/.../views)
• Presentation Layer
– ViewModels (MVVM)
– Adapters & ViewHolders
• Domain & Business Services
– ReaderManagers (navigation, rendering logic)
– Background Services & Broadcast Receivers (downloads, network state, VOTD)
• Data Layer
– Local Data Sources:
· SQLite DB via DBHelpers (bookmarks, history, search, translations)
· SharedPreferences (SPReader, SPAppConfigs, etc.)
· Asset JSON files (verses, translations, tafsir, fonts)
– Remote Data Sources:
· Retrofit APIs (QuranApi, GithubApi)
· Inventory JSON (versions, recitation info)
• External Services
– Google Play / F-Droid (app distribution)
– Third-party data providers (QuranEnc, quran.com)
– CI/CD pipeline (GitHub Actions, Fastlane)
b. Relationships & interactions
• UI → Presentation: user events in Activities/Fragments call ViewModel methods.
• Presentation → Domain: ViewModel invokes ReaderManagers and Business Services to process data.
• Domain → Data: services query local DB/assets first, fall back to remote APIs, then persist updates.
• Background services triggered by Receivers (e.g., network available → start TranslationDownloadService).
• Peacedesign UI library is consumed by app/ for consistent dialog and widget rendering.
c. Architectural patterns & principles
• MVVM separation: Activities/Fragments (View) ↔ ViewModels ↔ Data layer.
• Repository-style data abstraction: local and remote sources behind helpers and APIs.
• Modularization: separate UI library (peacedesign/) from core app.
• SingleResponsibility: each package has a distinct concern (api, db, utils, components).
• Dependency injection patterns (manual or via RetrofitInstance).
d. Key technologies & libraries
• Kotlin & Java on Android SDK
• AndroidX Components (ViewModel, LiveData, RecyclerView, Room-style DB helpers)
• Retrofit + OkHttp for HTTP APIs
• Gradle multi-module build
• Fastlane for release metadata
• GitHub Actions for CI