How amornthip66/petcosttrack works
PetCostTrack is a shared pet-care expense web app. Owners and co-caretakers sign in, manage pets and shared access, record expenses (including hidden costs, multi-pet allocation and receipts), and review dashboards and budgets; reminders and invitations support ongoing care. The static browser UI talks directly to Supabase Auth, REST and Storage, with database policies enforcing access. The graph preserves documented features whose precise frontend wiring was not sampled; those links are left unasserted. Email delivery is an optional Edge Function and requires a configured provider key.
Main entry points: api.js Supabase API client · history.js Expense history · auth.js Auth & profile · pets.js Pet profiles
Components 23
Identity & access
- Sign-in flow
js/login.js - Auth & profile
js/auth.js - User records
supabase/migrations/20260831000000_remote_schema.sql
Pet & family care
- Pet profiles
js/pets.js - Family access
js/profile.js - Care invitations
js/reminders.js
Expense management
- Expense history
js/history.js - Pet cost shares
js/expense-allocation.js - Receipt files
js/history.js - Expense categories
js/history.js
Planning & insights
- Spending dashboard
js/dashboard.js - Monthly budgets
js/budgets.js - Care reminders
js/reminders.js - In-app alerts
js/notifications.js
Backend services
- PetCostTrack UI
index.html - Shared interface
js/components.js - Supabase API client
js/api.js - Supabase Auth
- PostgreSQL & RLS
supabase/migrations/20260904000000_enforce_strict_rls.sql - Supabase Storage
supabase/migrations/20260910000000_receipts_pdf_and_rls.sql - Reminder email function
supabase/functions/send-reminder-emails/index.ts
Other components
- Pet carers
- Resend email service
Connections 24
- Pet carers → PetCostTrack UI: uses
README.md - PetCostTrack UI → Sign-in flow: opens
- Sign-in flow → Auth & profile: signs in
js/login.js - Auth & profile → Supabase Auth: authenticates
js/auth.js - Auth & profile → Supabase API client: loads profile
js/auth.js - Supabase API client → PostgreSQL & RLS: queries
README.md - Auth & profile → User records: links account
js/auth.js - PetCostTrack UI → Shared interface: renders shared UI
- Pet profiles → Supabase API client: loads pet access
js/pets.js - Pet profiles → Supabase Storage: stores pet photos
README.md - Pet profiles → PostgreSQL & RLS: creates pet with owner
js/pets.js - Family access → Supabase API client: manages family access
js/profile.js - Care invitations → Supabase API client: accepts invitations
js/reminders.js - Expense history → Supabase API client: saves expenses
js/history.js - Expense history → Pet cost shares: allocates costs
- Expense history → Expense categories: creates categories
js/history.js - Expense history → Supabase Storage: uploads receipts
README.md - Spending dashboard → Supabase API client: queries spending
js/dashboard.js - Monthly budgets → Supabase API client: reads budgets
js/budgets.js - Monthly budgets → Expense history: compares spending
- Care reminders → Supabase API client: loads reminders
js/reminders.js - Care reminders → In-app alerts: shows due alerts
- Reminder email function → PostgreSQL & RLS: reads due reminders
supabase/functions/send-reminder-emails/index.ts - Reminder email function → Resend email service: sends email
supabase/functions/send-reminder-emails/index.ts