You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A utility meter reading and billing management system. Automates the workflow from capturing readings to generating accurate per-tenant bills — with a web dashboard and an Android companion app.
Quick Start
Prerequisites
Node.js 24+
1. Clone & Start
git clone <repo>cd new-utility-calculator
# Terminal 1 — API (port 5002)cd api/functions
npm ci
export APP_ENV=staging
export GOOGLE_APPLICATION_CREDENTIALS=$(pwd)/secrets/utilitool-staging-firebase-adminsdk-fbsvc-50221e4bd0.json
npm run dev:watch
# Terminal 2 — UI (port 5173)cd ui && npm ci && npm run dev
# Terminal 3 — Mobile web preview (port 5174, optional)cd mobile && npm ci && npm run dev
Sign up with any email/password → You're in the dashboard.
Docker alternative
docker-compose up
Starts API, UI, and the mobile web preview in watch mode, each in its own container with source bind-mounted from your host (no local Node install needed). File watching uses polling so edits made on Windows are picked up reliably — costs more memory (vmmem) than the manual setup but skips the 3-terminal juggling. Requires api/functions/secrets/.env.staging — see API_SETUP.md. Note: the mobile container is web-preview only; Capacitor/Android builds still require the manual workflow in mobile/CLAUDE.md.
What is This?
Utilitool manages the meter-to-bill workflow:
Capture readings from utility meters (electricity, water)
Create a billing cycle — validate all readings match consumption (3% tolerance)
Generate bills — one bill per tenant, per property, per cycle
Track payments — see which bills are paid, pending, or overdue
npm run dev:watch # Watch mode — standard local dev
npm run build # Compile TypeScript
npm run lint # ESLint
npm test# Jest (all tests)
UI (ui/)
npm run dev # Dev server (port 5173)
npm run check # TypeScript check
npm run lint # ESLint + Prettier
npm run test:unit # Vitest
npm run test:e2e # Playwright E2E
npm run build # Production build
Mobile (mobile/)
npm run dev # Dev server (port 5174)
npm run build # Build SPA
npx cap sync # Sync to Android
npx cap open android # Open in Android Studio
Deployment
Staging (Automatic on push to main)
API: Deploys to utilitool-staging Firebase project
UI: Vercel Preview deploy — triggered for pull requests and also on push to main (this is what's actually configured as staging; there's no separate custom Vercel Environment)
Production (Manual)
Firebase project: utilitool-3fe70
Deploy via Firebase CLI or console
See CLAUDE.md → CI/CD & Deployment for the full workflow