- Initialize Git repository with main branch - Create comprehensive .gitignore for Node.js, React, and environment files - Set up directory structure (frontend/, backend/, docs/) - Create detailed README.md with project overview and setup instructions - Add .env.example with all required environment variables - Configure Prettier for consistent code formatting All acceptance criteria met: ✅ Git repository initialized with appropriate .gitignore ✅ Directory structure matches Technical Assumptions ✅ README.md created with project overview and setup docs ✅ .env.example file with all required environment variables ✅ Prettier config files added for code formatting consistency 🤖 Generated with Claude Code (https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
7.1 KiB
Epic 5: PWA Features & Production Readiness
Epic Goal: Transform the application into a fully functional Progressive Web App with offline support, installability, and mobile optimizations, then finalize production deployment to Coolify to deliver a complete, production-ready MVP.
Story 5.1: PWA Manifest & Service Worker Setup
As a user, I want the app to be installable on my mobile device, so that it feels like a native app and is easily accessible from my home screen.
Acceptance Criteria:
- PWA manifest file created in
frontend/public/manifest.json:- App name: "Book Reading Tracker" (or final name)
- Short name: "ReadTrack" (or similar)
- Description, theme color, background color
- Icons for various sizes (192x192, 512x512 minimum)
display: "standalone"for app-like experiencestart_url: "/"andscope: "/"
vite-plugin-pwaconfigured invite.config.js- Service worker generated for offline caching
- Static assets (JS, CSS, images) cached for offline access
- API responses cached with network-first or cache-first strategy where appropriate
- "Add to Home Screen" prompt appears on supported browsers
- App icon and splash screen display when launched from home screen
- Service worker updates automatically when new version deployed
- App works offline (cached pages accessible, with graceful degradation for API calls)
- PWA audit (Lighthouse) passes with score >80
Story 5.2: Offline Support & Sync Strategy
As a user, I want to log reading progress even when offline, so that I don't lose data if I don't have internet connection.
Acceptance Criteria:
- Service worker caches critical app shell (HTML, CSS, JS)
- Reading logs can be entered offline and stored in IndexedDB (or similar local storage)
- When connection restored, queued logs sync to backend API automatically
- UI indicates when user is offline (banner or icon)
- UI indicates when data is being synced
- Conflicts handled gracefully (e.g., if same book/date logged offline then online)
- User can view previously loaded book list and progress data offline
- Search for new books disabled offline (requires API call)
- Offline mode tested on mobile devices (airplane mode)
Story 5.3: Mobile Responsiveness & Touch Optimization
As a user, I want the app to work smoothly on my phone with touch-friendly interactions, so that it's easy to use on small screens.
Acceptance Criteria:
- All screens tested and responsive on screen sizes: 320px, 375px, 414px, 768px, 1024px, 1920px
- Touch targets minimum 44x44px for all interactive elements (buttons, links, inputs)
- Form inputs use appropriate input types (
type="number"for page numbers,type="date"for dates) - Mobile keyboards optimized (numeric keyboard for page input)
- Scroll behavior smooth and natural on mobile (no janky scrolling)
- No horizontal scrolling on mobile (all content fits within viewport)
- Text readable without zooming (minimum 16px font size for body text)
- Images and covers optimized for mobile (lazy loading, appropriate sizes)
- Pull-to-refresh works on home screen for updating book list
- Tested on real devices: iOS (iPhone) and Android
Story 5.4: Performance Optimization
As a user, I want the app to load quickly and respond instantly, so that I can log my progress without waiting.
Acceptance Criteria:
- Lighthouse performance score >80 on mobile, >90 on desktop
- First Contentful Paint <1.5 seconds on 3G connection
- Time to Interactive <3 seconds on 3G connection
- Frontend bundle size <500KB (gzipped)
- Images optimized (compressed, appropriate formats, lazy loaded)
- API responses compressed (gzip enabled on backend)
- Critical CSS inlined or loaded first
- Non-critical JavaScript lazy loaded
- Database queries optimized (indexes used, no N+1 queries)
- API response times <200ms for common endpoints (GET /api/books, POST /api/books/:id/logs)
Story 5.5: Error Handling & User Feedback
As a user, I want clear error messages and feedback when something goes wrong, so that I understand what happened and how to fix it.
Acceptance Criteria:
- All API errors return user-friendly error messages (not technical stack traces)
- Frontend displays error messages in a consistent UI pattern (toast notifications, inline errors)
- Network errors handled gracefully ("Unable to connect. Please check your internet connection.")
- Validation errors show specific field-level feedback ("Deadline must be in the future")
- Loading states shown for all async operations (spinners, skeleton screens)
- Success feedback shown after actions (e.g., "Book added!" or "Progress logged!")
- 404 errors handled with "Not Found" page and navigation back to home
- 500 errors handled with "Something went wrong" message and retry option
- Empty states provide clear CTAs ("No books yet. Add your first book!")
- Offline state clearly communicated to user
Story 5.6: Production Deployment to Coolify
As a developer, I want the application deployed to Coolify production environment, so that it's accessible to the user via a public URL with HTTPS.
Acceptance Criteria:
- Coolify project configured with:
- Frontend container (serving React build via nginx or similar)
- Backend container (Node.js Express API)
- PostgreSQL database container
- Environment variables configured in Coolify (DATABASE_URL, API URL, etc.)
- Database migrations run successfully on production database
- HTTPS enabled via Coolify (automatic SSL with Let's Encrypt)
- Custom domain configured (if applicable) or Coolify subdomain used
- Health check endpoints monitored (
/api/health) - Application accessible via public URL
- PWA installable from production URL
- Database backups configured (automated via Coolify PostgreSQL management)
- Deployment documented in
docs/deployment.mdwith rollback procedure
Story 5.7: Testing & Quality Assurance
As a developer, I want comprehensive testing to ensure the MVP works correctly, so that we can ship a reliable product.
Acceptance Criteria:
- Unit tests written for:
- Frontend: Pace calculation logic, form validation, utility functions
- Backend: API endpoints, paceCalculationService, openLibraryService
- Integration tests written for:
- All backend API endpoints with test database
- Frontend API integration (mocked backend responses)
- Test coverage >70% for critical business logic (pace calculation, logging, validation)
- Manual testing checklist completed:
- Add book flow (search, select, set deadline, add)
- Log progress flow (tap book, enter page, save)
- View book list with progress metrics
- View calendar with logged days
- Install PWA on mobile device
- Use app offline, sync when online
- Responsive design on multiple screen sizes
- Cross-browser testing completed (Chrome, Safari, Firefox on desktop; Safari iOS, Chrome Android)
- Accessibility testing (keyboard navigation, screen reader basics)
- Performance testing (Lighthouse audits pass thresholds)
- Critical bugs fixed, known issues documented