Skip to content

joelpeter-c/item-usage-tracker

Repository files navigation

item-usage-tracker

A React Native Android app for tracking the lifecycle and cost of personal purchases. Each item moves through three states (purchased, opened, finished) on a calendar-based view, with category filters and per-item cost-per-day calculations once finished.

Built and tested as a sideloaded debug APK on Android. Not published to Google Play.

Stack

  • React Native 0.73 (TypeScript)
  • React Navigation v6 (bottom tabs + stack)
  • React Native Paper (Material Design components)
  • SQLite via react-native-sqlite-storage
  • date-fns

Screens

Screen Purpose
Calendar Main view. Tap a date to see items and add new ones for that date.
Add Item Create an item with name, price, category, and purchase date.
Item Details View an item and advance its state (purchased to opened to finished).
Analytics Monthly spending totals, per-category breakdown, lifecycle stats.
Categories Manage categories (name, color, icon).
Settings Backup and restore the local database.

Building the APK

The build runs on Linux or WSL with JDK 17 and the Android SDK (platform 34, build-tools 34.0.0).

pnpm install                  # or: npm install
chmod +x build.sh
./build.sh

build.sh honors JAVA_HOME and ANDROID_HOME if they're set. If they're not, it falls back to a self-contained directory at build-env/jdk-17.0.2/ and build-env/android-sdk/ (not committed to the repo; you provide your own).

The build runs ./gradlew assembleDebug --no-daemon -x checkDebugAarMetadata and produces ItemsUsageTracker.apk in the repo root.

Why those Gradle flags

  • --no-daemon: avoids stale-daemon issues in clean / CI-like environments.
  • -x checkDebugAarMetadata: skips the strict AAR metadata check that blocks builds when transitive dependencies advertise a newer compile SDK than this project targets. The same intent is captured by android.overrideVersionCheck=true and android.suppressUnsupportedCompileSdk=34 in android/gradle.properties.

Installing on a device

adb install ItemsUsageTracker.apk

Or copy the APK to the device, enable Install from unknown sources, and tap it.

Database

Two tables, both local:

  • items (id, name, price, purchase_date, opened_date, finished_date, category_id, status, created_at)
  • categories (id, name, color, icon, created_at)

Default categories are seeded on first run from src/config/defaultCategories.ts.

Project layout

src/
  App.tsx                      Navigation setup
  screens/                     One file per screen
  components/                  Reusable widgets (Calendar, ItemCard, SearchBar, etc.)
  services/database.ts         SQLite repository
  services/backupService.ts    Export/import JSON
  hooks/                       useSearch, usePagination, useBackButton
  utils/                       dateUtils, validation, sanitization
  types/                       Shared TypeScript types
  theme/                       Paper theme overrides
android/                       React Native Android project
build.sh                       APK build entrypoint

Notes

  • Charts on the Analytics screen are placeholders. Spending and category totals render as numbers; chart visualizations are not implemented.
  • The standard react-native run-android live-reload workflow is not wired up. Builds are produced as debug APKs and installed onto a device.
  • iOS build files are present but untested.

About

React Native Android app for tracking the lifecycle and cost of personal purchases. Items move through purchased, opened, and finished states with category filters and per-item cost-per-day calculations. SQLite for local storage.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors