# Tracka
Single-user, offline-first Android app for a private tutor: track class sessions per student (live timer — solo or group — or manual entry, also solo or group), read earnings daily / weekly / monthly, and export PDF summary reports. No server, no auth, no runtime network. Built from the system design in `tracka-system-design/` (Ref: NHT-TRK-2026-001).
## Stack
- Expo SDK 57 / React Native, expo-router
- On-device SQLite via expo-sqlite + drizzle-orm (raw DDL with CHECK constraints is the authority — see `src/db/migrations.ts`)
- @notifee/react-native for the ongoing chronometer notification + stop-from-shade (headless)
- expo-print + fflate for PDF reports and zipped backups
- Custom dark UI kit (zinc/shadcn-inspired palette, Space Grotesk) — no third-party component library
## Key conventions
- Money: rates stored as **integer kobo**; earnings stored as **tenths of kobo** (`earned_kobo` ÷ 10 for display)
- Durations in **seconds** (60 – 86 400); timestamps in epoch ms UTC
- `local_date` is the Africa/Lagos (UTC+1, no DST) calendar day the session **started**; weeks start Monday
- A timer runs for a *group* of one or more students at once — each gets their own session row (own rate snapshot, own earnings) sharing a `group_id` and start time. At most one running group globally, enforced by a per-student partial unique index plus a trigger
- Manual logging follows the same shape: one class, one or more students — a row each, sharing a `group_id` when several. Start/end times can be entered directly (duration auto-computed, end ≤ start crosses midnight); the per-session rate override is a single-student affordance
- Every rule expressible as a constraint lives in the database (`PRAGMA foreign_keys = ON` on every connection)
## Running
```bash
bun install
# Development build is REQUIRED for notifications (@notifee) and PDF export
# (expo-print) — Expo Go works for everything else and degrades gracefully.
bunx expo run:android # or: eas build -- …