How mdchad/myhadeethapp works
Project type and purpose
• This is a single‑repository, client‑only React Native application built with Expo and following a file‑based navigation paradigm via expo-router.
• Its purpose is to present Hadith content (with search, volume browsing, prayers, qibla compass, user notes, audio playback, and offline/local data support) on mobile devices.
File structure
• Top‑level folders:
• app/ – primary entrypoint for screens & layouts (Expo Router).
• app/components/ – reusable UI components.
• app/shared/ – shared hooks, data‑fetcher logic, storage, online‑status utilities.
• app/utils/ – standalone helpers (e.g., sharing, superscript conversion).
• app/i18n/ – internationalization and locale files.
• context/ – React context providers (global state, “warm up” logic).
• assets/ – static assets (audio, fonts, media).
• data/ – bundled JSON data (hadith40.json).
• Config files: app.json, eas.json, babel.config.js, tailwind.config.js.
README for additional insights
• Confirms use of Expo Router for native navigation.
• No custom backend in this repo; data is either local (data/) or fetched via shared fetcher hooks (could point to remote APIs or local JSON).
• Build & deployment use EAS and standard Expo workflows.
a. Main components:
1. Mobile App Container (Expo + React Native runtime)
2. Navigation Layer (Expo Router’s file‑based router)
3. Screen/Feature Modules (tabs: default, hadith, prayers, qibla, search, profile, settings, introduction, user/hadith40)
4. UI Component Library (app/components/)
5. Data Layer
– Local JSON (data/hadith40.json)
– Shared fetcher hooks (app/shared/fetcher)
– Local Storage (app/shared/storage.js)
– Online‑status manager (useOnlineManager)
6. Global State & Context Providers (context/provider.js)
7. Utilities & i18n (app/utils/, app/i18n/)
8. Static Assets (audio, fonts, media)
9. Build & Deployment (Expo CLI, EAS, Babel, Tailwind config)
b. Relationships & interactions:
– Navigation Layer orchestrates which Screen Modules are mounted.
– Screens invoke UI Components for rendering.
– Screens/hooks call Data Layer to fetch data (local JSON or remote API).
– Data Layer reads/writes to Local Storage and reacts to network status via Online Manager.
– Global Context wraps the entire app/ subtree to provide theme, auth state, user preferences, etc.
– Utilities and i18n are injected into screens/components as needed.
– Static Assets are loaded by components (audio player, fonts).
– Build & Deployment tools consume config files and package the Mobile App Container.
c. Architectural patterns & design principles:
– File‑based routing (Expo Router) → implicit navigation graph.
– Component‑based UI (atomic/reusable components).
– Hooks for separation of concerns (data fetching, state, side effects).
– Context API for cross‐cutting global state.
– Layered architecture: Presentation → Domain (screens + hooks) → Data (fetcher + storage) → Assets.
d. Key technologies/frameworks/libraries:
– Expo Router & Expo SDK (navigation, asset loading)
– React Native & React Hooks
– Context API
– Tailwind CSS via tailwind.config.js
– Babel for transpilation
– EAS for build & over‑the‑air updates
– Localization with react-i18n style files