How gustavoviti/kaisen works
Kaisen is a gamified habit-tracking PWA. Users sign in, manage and complete habits, and receive XP, levels, streaks, badges, activity history, and progress charts. The dashboard controller coordinates Firebase-backed profile and habit operations, while charting and install-prompt features support the main experience. The README documents offline caching and push notifications; excerpts show service-worker cache and notification handling, though page registration and some wiring were not shown.
Main entry points: app.js Dashboard controller · dashboard.html Habit dashboard · firebase.js Habit persistence · service-worker.js Offline and push worker
Components 21
Habit experience
- Authentication screens
login.html - Habit dashboard
dashboard.html - Dashboard controller
js/app.js - Habit management
js/app.js - Progress and badges
js/app.js - Progress charts
js/charts.js
Firebase services
- Authentication
js/firebase.js - Profile and streaks
js/firebase.js - Habit persistence
js/firebase.js - XP and levels
js/firebase.js - Badge awards
js/firebase.js - Push subscriptions
js/firebase.js
PWA capabilities
- Install prompt
js/pwa.js - Offline and push worker
service-worker.js - Offline fallback
offline.html - PWA manifest
manifest.json
External services
- Cloud Firestore
- Firebase Authentication
- Chart.js CDN
- Push notification services
Other components
- Habit user
Connections 27
- Habit user → Authentication screens: signs in
README.md - Authentication screens → Authentication: authenticates
- Authentication → Firebase Authentication: uses
js/firebase.js - Habit user → Habit dashboard: uses
README.md - Habit dashboard → Dashboard controller: loads
README.md - Dashboard controller → Authentication: checks session
js/app.js - Dashboard controller → Profile and streaks: loads profile
js/app.js - Dashboard controller → Habit persistence: seeds habits
js/app.js - Dashboard controller → Habit management: renders and handles
js/app.js - Habit management → Habit persistence: manages and completes
js/app.js - Habit persistence → XP and levels: awards XP
js/firebase.js - Dashboard controller → Badge awards: checks awards
js/app.js - Dashboard controller → Progress and badges: renders progress
js/app.js - Progress and badges → XP and levels: calculates level
js/app.js - Dashboard controller → Progress charts: updates charts
js/app.js - Progress charts → Chart.js CDN: renders with
README.md - Profile and streaks → Cloud Firestore: reads and writes
js/firebase.js - Habit persistence → Cloud Firestore: reads and writes
js/firebase.js - XP and levels → Cloud Firestore: updates profile
js/firebase.js - Badge awards → Profile and streaks: stores awards
js/firebase.js - Dashboard controller → Push subscriptions: requests permission
js/app.js - Push subscriptions → Push notification services: subscribes
js/firebase.js - Habit user → Install prompt: installs app
js/pwa.js - Offline and push worker → Offline fallback: serves fallback
service-worker.js - Offline and push worker → Push notification services: shows and opens
service-worker.js - Habit dashboard → PWA manifest: uses
- Offline and push worker → Habit dashboard: caches assets
service-worker.js