Offline Todo App with Local Storage and Syncing

Built an *Offline-first Todo App* that keeps working even when the backend or internet goes down ⚡ Try it: https://lnkd.in/guCR4Gua This started as a basic full-stack project, but I pushed it further to handle real-world issues like unreliable networks. --- ## ⚙️ How it works - Data is stored locally using IndexedDB (Dexie) - You can create/update/delete todos fully offline - Changes are stored locally and marked as unsynced A background sync process runs only when: - 🌐 internet is available - 🔐 user is authenticated - 🖥️ server is reachable - Polling (~5s) keeps data in sync across devices - UI shows connection state (internet + server) ### 🧩 Manual controls - Force sync → push local changes immediately - Refetch → pull latest state from backend Even if the backend is down, the app still works using the local database. --- ## 🧠 Design choices I chose polling over WebSockets: - simpler, stateless backend - easier to deploy and scale - real-time updates weren’t critical **Tradeoff:** updates are delayed by a few seconds.(5 sec ) --- ## 📚 What I learned - Offline-first architecture ≠ API-first thinking - Syncing data is harder than CRUD - Handling failure cases changes how you design apps --- ## 🚀 Next step Batching updates and improving retry logic. --- #webdevelopment #fullstack #reactjs #javascript

To view or add a comment, sign in

Explore content categories