Best way to build offline-first attendance system (PWA + GPS)?
Hey devs,
I’m working on an attendance module for an ERP project and could really use some advice from people who’ve built similar systems.
The idea is to make it offline-first, since a lot of users will have poor or no internet.
What I have so far:
- React PWA with IndexedDB
- Service Worker for background sync
- Django + PostgreSQL backend
What it needs to do:
- Punch in/out with GPS + face photo
- Work fully offline and sync later
- Track location periodically during work hours
Where I’m stuck:
- Offline sync:
Not sure what’s the best way to handle conflicts and retries without creating duplicate records. Also, should I trust device time or server time?
- GPS tracking:
Worried about battery drain and also how to deal with fake/spoofed locations.
- Scaling sync:
What happens when a lot of users come back online at the same time and all try to sync?
- Face capture:
Is storing photos enough for attendance, or is it better to go for face recognition?
If you’ve worked on something like this, I’d love to hear what worked (and what didn’t). Any tips or pitfalls to avoid would really help.
Thanks 🙏