SalahSync

πŸ•Œ SalahSync

Your personal Islamic companion β€” track prayers, read Qur’an, and sync across devices.

SalahSync is an Android app built around a powerful single-file WebView architecture. It combines a beautiful HTML/CSS/JS front-end with Firebase for cross-device cloud sync, and wraps it all in a native Android shell.


✨ Features

Feature Description
πŸ™ Prayer Tracker Mark each of the 5 daily prayers as done with beautiful toggle switches
πŸ•’ Salah Timetable Full monthly prayer times table with today’s row highlighted
πŸ“– Qur’an Reader Browse all 114 surahs, read full Arabic text with English translation
🀲 Duas Collection Searchable collection of duas with Arabic text and transliteration
πŸ•Œ How to Pray Namaz Step-by-step prayer guide
☁️ Cloud Sync Real-time Firestore sync β€” data stays identical across all your devices
πŸ” Account System Email/Password and Google Sign-In via Firebase Auth
🎨 22 Premium Themes Islamic, Luxury, Nature, and Tech themed color palettes
πŸŒ™ Dark / Light Mode Toggle between dark and light modes
πŸ“± Android Native Packaged as a native Android app with back-navigation support

πŸ–ΌοΈ App Sections

The app uses a tab-based layout with the following main views:


πŸ› οΈ Tech Stack

Layer Technology
Android Shell Kotlin, Jetpack Compose, WebView
Front-end HTML5, Vanilla CSS, Vanilla JavaScript
Authentication Firebase Auth v8 (Email/Password + Google Sign-In)
Database Cloud Firestore (real-time listener)
Fonts Google Fonts β€” Lexend, Noto Naskh Arabic, Bangers, Teko
Icons Font Awesome 6
Min SDK Android 7.0 (API 24)
Target SDK Android 17 (API 37)
Version 2.0.0

πŸ“ Project Structure

SalahSyncApp/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ src/main/
β”‚   β”‚   β”œβ”€β”€ assets/
β”‚   β”‚   β”‚   β”œβ”€β”€ SalahSync.html      # Main app (entire front-end in one file)
β”‚   β”‚   β”‚   └── login.html          # Login / Register / Password Reset page
β”‚   β”‚   β”œβ”€β”€ java/com/example/salahsync/
β”‚   β”‚   β”‚   β”œβ”€β”€ MainActivity.kt     # WebView host + AndroidBridge JS interface
β”‚   β”‚   β”‚   β”œβ”€β”€ data/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ PrayerDatabase.kt       # Hardcoded prayer times data
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ FirestoreRepository.kt  # Firestore read/write helpers
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ SurahRepository.kt      # Quran surah data
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ TrackingData.kt         # Prayer tracking data model
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ DataRepository.kt       # General data access
β”‚   β”‚   β”‚   β”‚   └── TimeUtils.kt            # Date/time helpers
β”‚   β”‚   β”‚   β”œβ”€β”€ ui/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ main/
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ MainScreen.kt       # Compose main screen
β”‚   β”‚   β”‚   β”‚   β”‚   └── MainScreenViewModel.kt
β”‚   β”‚   β”‚   β”‚   └── tabs/
β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ DashboardTab.kt     # Prayer stats dashboard
β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ DataTab.kt          # Salah timetable table
β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ LiveTab.kt          # Today's prayer checklist
β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ SurahTab.kt         # Quran surah browser
β”‚   β”‚   β”‚   β”‚       └── ViewModels...
β”‚   β”‚   β”‚   └── theme/                      # Compose theme definitions
β”‚   β”‚   β”œβ”€β”€ res/                            # Android resources (icons, strings)
β”‚   β”‚   └── AndroidManifest.xml
β”‚   β”œβ”€β”€ google-services.json               # Firebase project config
β”‚   └── build.gradle.kts
β”œβ”€β”€ build.gradle.kts
β”œβ”€β”€ settings.gradle.kts
└── gradle.properties

πŸ”₯ Firebase Setup

The app uses Firebase for authentication and cloud sync.

Firebase services used:

Firestore data structure:

elite_users/
  └── {userId}/
        └── trackingData: { "2024-01-15": { fajr: true, dhuhr: false, ... }, ... }

⚠️ If you fork this project, replace google-services.json and the firebaseConfig object inside both SalahSync.html and login.html with your own Firebase project credentials.


πŸš€ Getting Started

Prerequisites

Build & Run

  1. Clone the repository
    git clone https://github.com/yourusername/SalahSync.git
    cd SalahSync/SalahSyncApp
    
  2. Open in Android Studio
    • File β†’ Open β†’ select the SalahSyncApp folder
  3. Sync Gradle
    • Android Studio will automatically sync. If not, click Sync Now.
  4. Run the app
    • Connect a device or start an emulator
    • Click ▢️ Run or press Shift + F10

Building a Release APK

./gradlew assembleRelease

The APK will be output to app/build/outputs/apk/release/.


πŸ” Authentication Flow

App Launch
    β”‚
    β–Ό
SalahSync.html  (main app)
    β”‚
    β”œβ”€ User not signed in β†’ taps "Sign In / Sign Up"
    β”‚       β”‚
    β”‚       β”œβ”€ Android:  AndroidBridge.openLogin() β†’ loads login.html in WebView
    β”‚       └─ Desktop:  window.location.href = 'login.html'
    β”‚
    β–Ό
login.html
    β”œβ”€ Email/Password Sign In
    β”œβ”€ Email/Password Register
    β”œβ”€ Google Sign-In (popup on desktop)
    └─ Forgot Password (Firebase reset email)
    β”‚
    β–Ό
On success β†’ AndroidBridge.onLoginSuccess() / window.location.replace('SalahSync.html')
    β”‚
    β–Ό
Back to SalahSync.html  (signed in, cloud sync active)

πŸ“± Android Bridge

The AndroidBridge Kotlin class is registered as a JavaScript interface in the WebView, letting the HTML pages call native Android functions:

JS Call What it does
AndroidBridge.openLogin() Loads login.html in the WebView
AndroidBridge.onLoginSuccess() Returns to SalahSync.html after sign-in
AndroidBridge.openGoogleSignIn() (Reserved) Triggers native Google Sign-In

🎨 Themes

SalahSync includes 22 hand-curated themes across 4 categories:

Category Themes
β˜ͺ️ Islamic & Spiritual Sacred Gold, Madinah Green, Al-Aqsa Blue, Pre-Dawn Purple, Iftar Amber, Jannah Emerald
πŸ’Ž Luxury & Premium Royal Gold, Diamond Ice, Platinum, Rose Gold, Deep Velvet, Obsidian Violet
🌿 Nature & Elements Midnight Blue, Aurora Borealis, Sahara Dunes, Deep Ocean, Volcanic Fire, Nebula Pink
⚑ Modern & Tech Matrix Green, Neon Cyber, Steel & Amber, Monochrome

πŸ‘€ Developer

Type01warrior


πŸ“„ License

This project is for personal and educational use. All rights reserved Β© Type01warrior.


May Allah accept our prayers. 🀲