Skip to content

refactor: harden data access, caching, and CI coverage - #25

Merged
stevenphanny merged 7 commits into
mainfrom
ci
Sep 29, 2026
Merged

stevenphanny merged 7 commits into
mainfrom
ci

Conversation

@stevenphanny

Copy link
Copy Markdown
Collaborator

What changed

This PR strengthens MAC Study’s database, data-access and testing foundations while preserving existing application behaviour.

  • Added CI checks for linting, typechecking, unit tests, production builds and dependency vulnerabilities.
  • Added repeatable local Supabase resets to verify every migration from an empty database.
  • Generated database types and applied them to all Supabase clients.
  • Split the large app-data.ts module into timer, units, groups, friends, chat and notifications modules.
  • Replaced broad social snapshot queries with focused RPCs, pagination and aggregate queries.
  • Scoped client caches per user and added freshness, request deduplication and mutation/realtime invalidation.
  • Consolidated dashboard realtime subscriptions and paused loading for hidden dashboards.
  • Added Playwright coverage for authentication, starting a timer, creating a group and RLS-protected access.

Validation

  • ESLint
  • TypeScript typecheck
  • Vitest unit tests
  • Next.js production build
  • Fresh Supabase migration reset
  • Generated database types check
  • Playwright critical browser flows
  • All three GitHub Actions jobs passing

Add push and pull-request quality gates, repair the existing lint
baseline, and update dependencies to audited versions.
Pin the Supabase CLI, add isolated local database configuration and
scripts, and verify the complete migration history in CI.
Generate the schema contract from the reset database, type every Supabase
client, and fail CI when committed database types drift from migrations.
Move timer, units, friends, groups, chat, and notification data access
into focused client modules while preserving the existing public API.
Replace the social snapshot fan-out with scoped aggregate RPCs, bound large lists with pagination, and expire or invalidate client caches after writes and realtime changes.
Scope persisted snapshots to the signed-in user, deduplicate concurrent reads, and route one app-level realtime stream to the active dashboard so hidden views do not fetch or subscribe.
@stevenphanny
stevenphanny merged commit 0b69709 into main Sep 29, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant