Adding Favorites
Mark reciters as favorites for quick access:- Find a reciter you enjoy
- Click the star icon on their card or in the player
- The star fills in to indicate favorite status
- Your favorite is saved locally and synced to the network
Favorites are indicated with a filled yellow star, while non-favorites show an outlined gray star.
Removing Favorites
To unfavorite a reciter:- Click the filled star icon
- The star returns to outlined state
- The favorite is removed locally and the network is updated
GunDB Synchronization
Open Tarteel uses GunDB for decentralized data synchronization:Local Storage
Favorites saved to browser localStorage
Peer Network
Synced across GunDB distributed network
Real-time Updates
Live favorite counts from all users
No Account Required
Works without registration or login
How GunDB Works
- Distributed
- Real-time
- Offline-First
Data is distributed across multiple peers rather than stored on a central server. This makes the system resilient and fast.
Favorite Counts
See how many users have favorited each reciter:Favorite counts are fetched from the GunDB network with a 1-second timeout to ensure the app remains responsive.
Live Updates
Favorite counts update in real-time as users interact:Real-time Features
Live Statistics
Live Statistics
- Instant Updates - See favorite counts change as users interact
- Network Sync - Updates propagate through GunDB peer network
- No Polling - Uses WebSocket-like subscriptions for efficiency
- Automatic Cleanup - Subscriptions are properly disposed when components unmount
Filtering by Favorites
Quickly access your favorited reciters:- Open the reciter selector
- Toggle “Show only favorites”
- The list filters to show only your favorited reciters
- Toggle off to see all reciters again
The favorites filter state is maintained in the hook and can be toggled on/off without losing your place in the list.
Favorite Storage
Favorites are stored using Jotai atoms with persistence:Storage Features
Browser Storage
Saved to localStorage under key ‘favorite-reciter’
Array Format
Stored as array of reciter IDs
Persistent
Survives browser restarts and tab closes
Reactive
Updates trigger re-renders automatically
Generating Favorite IDs
Each favorite is identified by a unique ID:- Reciter ID
- Mushaf name
- Riwaya type
Network Synchronization
When you favorite a reciter:Sync Process
- Read Current Count - Fetch the current favorite count from GunDB
- Calculate Update - Increment if favoriting, decrement if unfavoriting
- Write to Network - Push the updated count to all peers
- Propagate - GunDB distributes the change to all connected clients
Favorites Hook
TheuseFavorites hook provides complete favorites functionality:
Hook Features
- State Management
- Real-time Sync
- Actions
- Manages local favorite list
- Tracks global favorite counts
- Controls filter toggle state
Visual Indicators
Favorite state is clearly indicated:In Reciter Cards
- Outlined star - Not favorited, gray color
- Filled star - Favorited, yellow/amber color
- Amber tint - Card background tints amber when favorited
- Count badge - Shows total favorite count from all users
In Player
- Star icon appears in the reciter selector bar
- Clicking toggles favorite status
- Color indicates current state (gray/yellow)
Favorite indicators are accessible with proper ARIA labels for screen readers (reciter-card.tsx:74).
Data Privacy
The favorites system respects your privacy:- No personal information is stored
- Only reciter IDs are synced to the network
- Local favorites remain in your browser
- No account or email required
- Anonymous participation in global counts
Clear browser data will remove your local favorites. They cannot be recovered as they’re stored locally, not on a server.
Troubleshooting
Common Issues
Common Issues
Favorites not syncing?
- Check your internet connection
- Verify GunDB peers are accessible
- Try refreshing the page
- Check browser console for errors
- Favorites are stored in localStorage
- Clearing browser data removes them permanently
- Re-favorite your preferred reciters
- Counts represent total actions, not unique users
- Network may take a moment to sync
- Refresh to fetch latest counts