A Progressive Web App (PWA) and Capacitor mobile app to track addictions, visualize progress, and stay consistent.
- Addiction tracking with progress stats
- PWA support (installable + offline)
- Android support via Capacitor
- Dark and light theme
- Data export (CSV/TSV)
- JSON backup/import flow with last-backup info
- React 18 + TypeScript
- Vite
- Tailwind CSS
- Capacitor (Android)
- Workbox (PWA)
- Node.js 18+ (Node 22 is supported)
- npm
- Android Studio + Android SDK (for APK builds)
- Java 17 (required by recent Android Gradle plugins)
git clone <repository-url>
cd addiction_tracker
npm installStart dev server:
npm run devOpen:
http://localhost:5173
Build and preview production PWA locally:
npm run build
npm run previewnpm run dev:mobileThis pushes the app to a connected Android device/emulator with live reload.
Use the unified APK script:
npm run build:apkThis automatically runs:
npm run buildnpx cap sync androidandroid/gradlew(.bat) assembleDebug
APK output:
android/app/build/outputs/apk/debug/app-debug.apk
Optional dry run (prints the pipeline without executing):
npm run build:apk -- --dry-runnpm run build:androidThis builds web assets, syncs Capacitor, and opens Android Studio.
npm run dev: Start Vite dev servernpm run build: Production web buildnpm run preview: Preview production buildnpm run build:pwa: Build + Capacitor syncnpm run dev:mobile: Run Android with live reloadnpm run build:apk: Build debug APK in one commandnpm run build:android: Build + sync + open Android Studionpm run lint: Run ESLint
- If
viteis not recognized: runnpm install. - If Android build fails: verify Java 17 and Android SDK setup.
- If Vercel fails with Rollup native module errors: ensure lockfile is up to date and redeploy from latest
main.
MIT. See LICENSE.