Skip to content

Repository files navigation

LessonLoop

A mobile-first PWA for tracking recurring class attendance and billing cycles within a household.

Live: https://lesson-loop-project.web.app
Stack: React + Vite + TypeScript + Firebase Auth + Cloud Firestore + vite-plugin-pwa


Dev setup

npm install
npm run dev        # emulators + Vite dev server (uses .env.emulator, no setup needed)
npm run seed       # seed test data into emulators
npm run dev:prod   # run against production Firebase (needs .env.local)

See .env.example for required environment variables.

Seeding production data

For one-off historical data loads (e.g. backfilling attendance and payments):

  1. Download a service account key from Firebase Console → Project Settings → Service accounts → Generate new private key and save it to secrets/ (gitignored).
  2. Create a data file at scripts/prod/seed-<name>-data.json and a script at scripts/prod/seed-<name>-prod.ts (both gitignored — keep personal/financial data out of git).
  3. Run:
    GOOGLE_APPLICATION_CREDENTIALS=secrets/<key-file>.json npx tsx scripts/prod/seed-<name>-prod.ts

Attendance docs use deterministic IDs (personId_activityId_date) so re-running is safe. Payment docs use auto-IDs — run once only to avoid duplicates.

Deploy

npm run build
firebase deploy --only hosting                                    # frontend only
firebase deploy --only firestore:indexes                          # composite indexes only
firebase deploy --only firestore:rules,firestore:indexes          # rules + indexes
firebase deploy --only firestore:rules,firestore:indexes,hosting  # everything

Firestore requires a composite index whenever a query filters on one field and sorts by another (e.g. payments filters on activityId and sorts by paidDate; attendance filters on activityId and sorts by date). Index definitions live in firebase/firestore.indexes.json and only need to be deployed once — they persist until explicitly removed.

Project layout

src/app/           auth + navigation context
src/screens/       Dashboard, Activity, Insights, Settings
src/services/      Firestore read/write per domain
src/domain/        pure business logic (billing cycles)
src/types/         domain types
firebase/          Firestore rules and indexes
scripts/           emulator seed script

Requirements

Agreed requirements that are not yet implemented are tracked in docs/requirements.md.


Credits

App icon: Sitar icons by Magnific – Flaticon

About

An app for tracking recurring class attendance and billing cycles within a household.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages