My platform is a flashcard tool focused on spaced repetition. The current logic is as follows:
- Data Structure:
- Bubble: Manages users, decks, and subdecks.
- Supabase: Stores original flashcards and progress data (interval, next review).
- Review Flow:
- When a user clicks on a subdeck, Bubble fetches the flashcards from Supabase and creates a copy in the progress table.
- During the review, the user rates each flashcard as “Easy,” “Medium,” or “Hard.”
- Bubble updates the progress in Supabase one by one (each click generates an API call).
- Current Issues:
- Internet Dependency: If the connection fails, the next flashcard is not displayed until the data is sent.
- User Experience: Waiting for API confirmation makes the review process slow and frustrating.
#Why I Want to Use LocalStorage
To solve these issues, I’m considering migrating to an offline-first approach using LocalStorage. The idea is:
- Save Interactions Locally:
- Each click on “Easy/Medium/Hard” would be saved immediately in LocalStorage, without waiting for Supabase.
- The next flashcard would be displayed instantly, improving the user experience.
- Background Synchronization:
- Periodically data would be sent in bulk to Supabase.
- If the internet goes down, interactions would remain saved locally until the connection is restored.
- Expected Benefits:
- Offline Resilience: Functionality without internet.
- Smooth Experience: No delays between clicks.
- Fewer API Calls: Reduced costs and backend load.
Community Help
If anyone has implemented something similar or has suggestions, I’d greatly appreciate it!