feat: implement reading progress tracking system

Database & API:
- Enhanced ReadingHistory model with versionId field and unique constraint per user/version
- Created /api/user/reading-progress endpoint (GET/POST) for saving and retrieving progress
- Upsert operation ensures one reading position per user per Bible version

Bible Reader Features:
- Auto-save reading position after 2 seconds of inactivity
- Auto-restore last reading position on page load (respects URL parameters)
- Visual progress bar showing completion percentage based on chapters read
- Calculate progress across entire Bible (current chapter / total chapters)
- Client-side only loading to prevent hydration mismatches

Bug Fixes:
- Remove 200 version limit when loading "all versions" - now loads ALL versions
- Fix version selection resetting to favorite when user manually selects different version
- Transform books API response to include chaptersCount property
- Update service worker cache version to force client updates
- Add comprehensive SEO URL logging for debugging 404 issues

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-09-30 11:42:39 +00:00
parent 2ae2f029ec
commit 2a031cdf76
8 changed files with 300 additions and 14 deletions

View File

@@ -1,8 +1,8 @@
// Biblical Guide Service Worker
const CACHE_NAME = 'biblical-guide-v1.0.0';
const STATIC_CACHE = 'biblical-guide-static-v1.0.0';
const DYNAMIC_CACHE = 'biblical-guide-dynamic-v1.0.0';
const BIBLE_CACHE = 'biblical-guide-bible-v1.0.0';
const CACHE_NAME = 'biblical-guide-v1.0.1';
const STATIC_CACHE = 'biblical-guide-static-v1.0.1';
const DYNAMIC_CACHE = 'biblical-guide-dynamic-v1.0.1';
const BIBLE_CACHE = 'biblical-guide-bible-v1.0.1';
// Static resources that should be cached immediately
const STATIC_ASSETS = [