Tech Stack
Praydo is built with the following core technologies:- Tauri - Cross-platform desktop framework
- SvelteKit - Web application framework
- TypeScript - Type-safe JavaScript
- Rust - Systems programming language for the backend
- Tailwind CSS - Utility-first CSS framework
- Skeleton UI - Component library for Svelte
Application Structure
The project follows a standard Tauri application structure:Frontend Architecture
The frontend is built with SvelteKit using the adapter-static adapter for static site generation. Since Tauri doesn’t have a Node.js server, the entire application is pre-rendered at build time.Key Frontend Components
PrayerManager (src/lib/logic/PrayerManager.svelte.ts)
The core business logic class that manages:
- Prayer time calculations using the PrayTimes.org library
- Real-time countdown to the next prayer
- Desktop notifications for prayer times
- Location-based calculations for accurate prayer times
- Islamic calendar conversions (Gregorian to Hijri)
- Qibla direction calculations
PrayerManager uses Svelte 5’s runes ($state, $derived) for reactive state management.
State Management
Praydo uses @tauri-store/svelte for persistent state management with the following stores:selectedLocation- User’s selected location for prayer timescalculationSettings- Prayer calculation method and adjustmentsselectedTimes- Enabled/disabled prayers and time formattimeRemaining- Pre-prayer notification settingsselectedAlert- Alert sound preferences per prayer
Build Configuration
The frontend uses Vite as the build tool with special configuration for Tauri:- Fixed port: 1420 (required by Tauri)
- HMR: Hot Module Replacement on port 1421
- Static adapter: Pre-renders all pages at build time
Backend Architecture
The backend is written in Rust and uses Tauri’s plugin system to provide native functionality.Tauri Plugins
Praydo uses the following official Tauri plugins:| Plugin | Purpose |
|---|---|
tauri-plugin-autostart | Launch app on system startup (desktop only) |
tauri-plugin-fs | File system access |
tauri-plugin-http | HTTP requests for location data |
tauri-plugin-notification | Native desktop notifications |
tauri-plugin-opener | Open URLs in default browser |
tauri-plugin-svelte | Svelte integration |
System Tray Integration
The application implements a system tray icon with a custom menu:Custom Commands
The backend exposes Rust functions to the frontend via Tauri commands:send_native_notification
Sends native desktop notifications:
Window Behavior
The application hides to the system tray instead of closing when the user clicks the close button:Data Flow
- User selects location → Stored in
selectedLocationstore - PrayerManager calculates prayer times → Uses PrayTimes.org library with location coordinates
- Times are displayed → Reactive updates using Svelte’s reactivity
- Countdown timer runs → 1-second interval checks for notifications
- Notification triggered → Calls Rust backend via
invoke() - Native notification shown → OS-level notification appears
External APIs
Praydo integrates with the following external services:- OpenStreetMap Nominatim - Location search and geocoding
- PrayTimes.org - Prayer time calculation algorithms (library)
Performance Considerations
- Static rendering: All pages pre-rendered at build time for instant loading
- Minimal dependencies: Only essential libraries included
- Native performance: Rust backend provides fast, efficient operations
- Single timer: One 1-second interval handles all time-based updates
- Derived state: Prayer times calculated reactively only when dependencies change