TEST
MAC Study is a mobile-first PWA for Monash Association of Coding students to track study time, study with friends, and compete in lightweight group leaderboards.
- Next.js App Router with TypeScript
- Tailwind CSS with MAC dark/yellow theme tokens
- Local timestamp-based study timer prototype
- PWA manifest and starter service worker
- Install-ready PNG/SVG icons for iPhone and Android
- Supabase-ready schema migration scaffold
npm install
npm run devCreate .env.local from .env.example before wiring Supabase auth or database
features.
Docker Desktop must be running. The Supabase CLI version is pinned in
package.json, and the local database settings live in supabase/config.toml.
npm install
npm run db:start
npm run db:reset
npm run db:types
npm run db:stopdb:start creates a fresh local Postgres database and applies every migration.
db:reset drops the local schemas and replays the complete migration history.
db:types regenerates the TypeScript database contract after schema changes.
These commands do not connect to or modify the hosted Supabase project.
The Playwright suite uses two deterministic local profiles and the ephemeral ES256 key generated by the local Supabase Auth container. It covers signed-out routing, starting a timer, creating a group, and a private-group RLS denial. It never connects to MAC Auth or the hosted Supabase project.
Docker Desktop and Google Chrome must be available on Windows. Run:
npm run db:start:e2e
npm run db:reset
npm run test:e2e
npm run db:stopdb:start:e2e starts only the local services required by the browser suite.
The generated browser sessions and traces are written under test-results/,
which is ignored by Git. CI installs its own Playwright Chromium browser and
runs the same suite against a freshly reset database.
The production app is deployed through Dokploy at
https://study.monashcoding.com. The PWA install flow needs HTTPS on a real
phone.
iPhone:
- Open the URL in Safari.
- Tap Share.
- Tap Add to Home Screen.
- Open MAC Study from the new home-screen icon.
Android:
- Open the URL in Chrome.
- Tap the three-dot menu.
- Tap Add to Home screen or Install app.
- Open MAC Study from the new app icon.
The MVP PWA can feel app-like with a home-screen icon, standalone window, app shell caching, and future push notifications. Native iOS/Android widgets, Dynamic Island, and Live Activities are not available to a web-only PWA and belong in the later native extension.
MAC Study uses the shared account system at https://auth.monashcoding.com.
MAC Auth handles Google/Microsoft sign-in and MAC Study exchanges its verified
token for a short-lived Supabase-compatible session. Supabase remains the data
store and enforces Row Level Security.
- Create a Supabase project.
- Run the SQL migrations in
supabase/migrationsin filename order. - Import an ES256 private signing key into Supabase JWT Signing Keys and keep the same private JWK only in the MAC Study server environment.
- Add these environment variables locally and in Dokploy:
NEXT_PUBLIC_SUPABASE_URL=
NEXT_PUBLIC_SUPABASE_ANON_KEY=
SUPABASE_SERVICE_ROLE_KEY=
SUPABASE_JWT_PRIVATE_JWK=
NEXT_PUBLIC_SITE_URL=https://study.monashcoding.com
NEXT_PUBLIC_MAC_AUTH_URL=https://auth.monashcoding.comThe signing JWK is server-only. Never prefix it with NEXT_PUBLIC_, expose it
to browser code, or commit it to Git.
Study reminders are claimed atomically by claim_due_study_reminders and sent
by POST /api/study-reminders/run. After applying
20260805010000_study_session_reminders.sql, configure a once-per-minute
Supabase Cron or Dokploy job to call that endpoint with:
Authorization: Bearer <STUDY_REMINDER_CRON_SECRET>
The scheduler secret is server-only. Do not add it to a migration or browser environment variable.
npm run dev
npm run build
npm run typecheck
npm run test
npm run test:e2e
npm run lintMAC Study is proprietary software. All rights reserved. No part of this codebase may be copied, modified, distributed, or used without permission.