Skip to content

feat: add PWA offline support and Firestore offline persistence#668

Merged
Aditya948351 merged 2 commits into
devpathindcommunity-india:masterfrom
Shiva210Jyoti:feat/pwa-offline-support
Jun 20, 2026
Merged

feat: add PWA offline support and Firestore offline persistence#668
Aditya948351 merged 2 commits into
devpathindcommunity-india:masterfrom
Shiva210Jyoti:feat/pwa-offline-support

Conversation

@Shiva210Jyoti

Copy link
Copy Markdown
Contributor

Description
Adds PWA capabilities and Firestore offline persistence so users can continue viewing roadmaps and checking off skills without an active internet connection.

Type of Change
✅ New feature

Related Issue
Closes #636

What's Changed

  • Configured next-pwa to generate service workers and cache static assets
  • Added public/manifest.json for PWA installability
  • Updated src/app/layout.tsx to link the manifest
  • Enabled Firestore IndexedDB offline persistence in src/lib/firebase.ts, guarded for client-only execution
  • Handled multi-tab persistence limitation gracefully (failed-precondition/unimplemented errors caught and logged, not crashing)
  • Fixed unrelated Jest version mismatch (25.x vs 30.x) that was crashing the test runner before any tests could run
  • Adjusted AuthContext test mock for Jest 30 compatibility

Verification
✅ npm run lint — clean
✅ npm run build — successful, service worker generated at public/sw.js
✅ npm test — 17/17 tests passing
✅ Firestore offline persistence properly scoped to client-side only
✅ Existing auth and data fetching functionality untouched

Closes #636

- Configure next-pwa for service worker generation and asset caching
- Add web app manifest for installability
- Enable Firestore IndexedDB offline persistence, guarded for client-only execution
- Handle multi-tab persistence limitation gracefully
- Fix Jest version mismatch (25.x -> 30.x) causing test runner crash
- Adjust AuthContext test mock for Jest 30 compatibility

Closes devpathindcommunity-india#636
@github-actions github-actions Bot added gssoc26 This is a official GirlScript Summer of Code label. level:advanced Advanced issues type:feature labels Jun 20, 2026
@Shiva210Jyoti

Copy link
Copy Markdown
Contributor Author

@Aditya948351 PR ready for review! Implemented next-pwa for service worker caching, web app manifest for installability, and Firestore IndexedDB offline persistence (properly client-guarded). Also fixed an unrelated Jest version mismatch that was crashing the test runner.

  • Lint clean
  • Build successful
  • 17/17 tests passing

Ready whenever you get a chance

@Aditya948351 Aditya948351 added the gssoc:approved give 50+ base points label Jun 20, 2026
@Shiva210Jyoti

Copy link
Copy Markdown
Contributor Author

@Aditya948351 Fixed the formatting issue — ran Prettier on the files I touched (next.config.ts, package.json, src/app/layout.tsx, src/lib/firebase.ts, src/lib/firestore-offline.ts). Lint and build still passing. Ready for re-review

@Aditya948351 Aditya948351 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work! The Firestore offline persistence is implemented perfectly, utilizing persistentMultipleTabManager and gracefully falling back if IndexedDB fails. Updating the test mocks to support the new offline config was also a fantastic touch. Highly appreciable! LGTM! 🚀

@Shiva210Jyoti

Copy link
Copy Markdown
Contributor Author

@Aditya948351 Thank you so much for the kind words and quick review! Really glad the implementation worked out well. Looking forward to contributing more to DevPath-Web .

@Aditya948351

Aditya948351 commented Jun 20, 2026

Copy link
Copy Markdown
Collaborator

@Aditya948351 Thank you so much for the kind words and quick review! Really glad the implementation worked out well. Looking forward to contributing more to DevPath-Web .

@Shiva210Jyoti Loved your change of Implementing this features, Excellent work! The Firestore offline persistence is implemented perfectly. Using persistentMultipleTabManager and gracefully falling back if IndexedDB fails is great enhancement.

Updating the test mocks to seamlessly support the new offline config was also a fantastic touch. I am adding the quality:exceptional label to this PR because of the high quality of this architecture work and also that app can be installed now on their Home screen this feels really great.

Keep Contributing More on this Repo!

Do star repo if not already!

@Shiva210Jyoti

Copy link
Copy Markdown
Contributor Author

@Aditya948351 Really appreciate that, thank you! Glad the offline persistence and PWA install flow turned out solid. Will keep an eye out for more issues to pick up here .

@Aditya948351 Aditya948351 merged commit e1b1a4c into devpathindcommunity-india:master Jun 20, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved give 50+ base points gssoc26 This is a official GirlScript Summer of Code label. level:advanced Advanced issues quality:exceptional type:feature type:refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Architecture]: Add offline support via next pwa and Firestore offline persistence

2 participants