Pawtograder is a Next.js 15 + Supabase course operations platform (autograder, hand-grading, office hours, Q&A, gradebook). The codebase is a single Next.js application backed by a local Supabase instance (PostgreSQL, Auth, Realtime, Storage, Edge Functions) running in Docker.
- Docker daemon:
sudo dockerd &>/tmp/dockerd.log &— wait a few seconds, then verify withdocker info. - Supabase:
npx supabase start— starts all Supabase services in Docker. Output includes local API URL and keys.- Known issue: Migration
20260217000000_binary_submission_files.sqlmay fail withmust be owner of table objectsbecause it creates RLS policies onstorage.objects. Workaround: temporarily move the migration file, runsupabase start, apply it viadocker exec -i supabase_db_pawtograder-platform psql -U postgres -d postgres < <migration_file>, record it insupabase_migrations.schema_migrations, then restore the file.
- Known issue: Migration
- Configure
.env.local: Aftersupabase start, get keys withnpx supabase status -o envand setNEXT_PUBLIC_SUPABASE_URL,NEXT_PUBLIC_SUPABASE_ANON_KEY,SUPABASE_SERVICE_ROLE_KEY,SUPABASE_URL,NEXT_PUBLIC_PAWTOGRADER_WEB_URL=http://localhost:3000, andENABLE_SIGNUPS=true. - Next.js dev server:
npm run dev— serves athttp://localhost:3000.
Run npm run seed to create a test class with students, assignments, and login credentials. The output includes instructor/grader/student emails (all with password change-it). The instructor dashboard is at /course/<class_id>.
Always run npm run format before committing. This runs Prettier on the entire codebase. CI will reject unformatted code.
- Lint:
npm run lint(ESLint + Prettier). Seepackage.jsonscripts. - Unit tests:
npm test(Jest). Note:jest.setup.tsmust exist (import@testing-library/jest-dom). The existing test has a pre-existing issue withRequestnot being defined in jsdom. - E2E tests:
npm run test:e2e:local— this setsBASE_URL=http://localhost:3000and runs Playwright. Requires local Supabase running + dev server at port 3000. Also needsSUPABASE_URLandSUPABASE_ANON_KEYexported (or in.env.local), sinceTestingUtils.tsreads them fromprocess.env. Tests run against chromium and webkit. - Build:
npm run build(requires ~8 GB memory viaNODE_OPTIONS=--max-old-space-size=8000). - Format:
npm run format(Prettier auto-fix).
| Service | Port |
|---|---|
| Next.js dev server | 3000 |
| Supabase API | 54321 |
| Supabase DB (PostgreSQL) | 54322 |
| Supabase Studio | 54323 |
| Mailpit (email testing) | 54324 |
- The staging Supabase backend (
.env.local.staging) has signups disabled; use local Supabase for full dev. - Docker in this cloud VM requires
fuse-overlayfsstorage driver andiptables-legacy. These are configured during initial setup. - Edge Functions (
npx supabase functions serve) are optional unless you need webhook/autograder/notification processing locally.