Safa

Safa

Islamic lifestyle companion app — built from scratch, supporting 33 languages.

Year

2025-2026

Role

Software Developer

Company

Hellospace

Stack

React NativeExpoTypeScriptSwiftWidgetKitSupabaseNode.jsRedisHonoDocker

Overview

Safa is an Islamic lifestyle companion app that brings together prayer times, Quran audio, dhikr (tasbih), fasting tracking, and AI-powered Q&A — all in one place. I built the entire mobile app from scratch, pixel-perfect from a provided design, using Expo/React Native. The app supports 33 languages through a CDN-backed translation system. Beyond the mobile app, I wrote native iOS widgets in Swift with WidgetKit, built a real-time collaborative dhikr system, wrote Supabase Edge Functions for scheduled notifications, and took over and improved an existing prayer times microservice.

The Challenge

The app needed to feel native and polished across both iOS and Android while supporting 33 languages — including right-to-left languages like Arabic. The prayer times system had to deliver timezone-aware notifications to thousands of users simultaneously, each at their correct local prayer time, with per-user sound preferences. The live dhikr feature needed real-time synchronization across multiple users tapping simultaneously without race conditions or lost counts. And the iOS widgets needed to display live countdown timers and prayer schedules using native Swift — bridging data from the React Native app through App Groups.

Solution

I built the mobile app from scratch with Expo/React Native, translating the design into pixel-perfect screens. The app includes Quran reading with audio playback via react-native-track-player, a dhikr/tasbih counter with multiple modes (relax, focus, night), an AI Q&A system with a daily token allowance, fasting tracking, and a comprehensive prayer times system.

For iOS, I wrote native widgets in Swift using WidgetKit — including a prayer times widget with circular progress rings and live countdown timers, a Ramadan widget showing sahur/iftar times, a daily verse widget, and a dhikr counter widget. The widgets read shared data from the React Native app through App Group UserDefaults. I also built a custom translation system for the widgets that reads from the CDN-backed translation cache, with full locale fallback to English, and Arabic numeral conversion for RTL locales.

The live dhikr (collaborative dhikr) system uses Supabase Realtime channels subscribed to postgres_changes events on the session table. Count increments go through an atomic RPC function to prevent race conditions when multiple users tap simultaneously. The UI uses optimistic updates with rollback on error, and a heartbeat-based presence system tracks online participants with a 2-minute timeout window.

I took over and improved the prayer times microservice — a Node.js/Redis service that runs two cron jobs. The cache service runs every 15 minutes, fetching prayer times from the AlAdhan API. It uses location clustering to group users within a ~1.1km radius, reducing API calls from roughly 48,000/day to around 900/month. The notification service runs every minute and checks each user's local time against their prayer schedule, supporting four notification types: early reminders, on-time alerts, post-prayer reminders (only if the prayer wasn't marked as completed), and an end-of-day summary. Each notification respects the user's sound preference (azan, beep, silent, or disabled) and language.

I also wrote 10 Supabase Edge Functions handling various scheduled and campaign notifications — including timezone-aware routine reminders, Friday (Jumu'ah) notifications, religious holiday notifications, welcome messages (fired 15 minutes after registration), and daily AI credit top-ups. All functions support batched Expo push delivery and per-user language resolution across 38 languages.

Key Features

  • Built from scratch, pixel-perfect from design, supporting 33 languages
  • Native iOS widgets in Swift/WidgetKit with live countdown timers and App Group data bridge
  • Real-time collaborative dhikr with Supabase Realtime, atomic RPC increments, and optimistic UI
  • Prayer times microservice with location clustering (~48K API calls/day reduced to ~900/month)
  • Timezone-aware notification engine with 4 notification types and per-prayer sound preferences
  • 10 Supabase Edge Functions for scheduled notifications with batched push delivery
  • Quran audio playback, AI Q&A with daily token system, fasting tracker
  • Arabic numeral conversion and full RTL support

Results

The app is live on the App Store, serving users across 33 languages. The prayer times microservice handles thousands of users with sub-second cached responses, and the notification engine delivers timezone-accurate prayer reminders every minute. The native iOS widgets provide at-a-glance prayer information directly on the home screen without opening the app.