-
Notifications
You must be signed in to change notification settings - Fork 20
Development environment setup #624
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
05693d7
Add AGENTS.md with cloud dev instructions and missing jest.setup.ts
cursoragent d773c8b
Update AGENTS.md with E2E test instructions
cursoragent af4fd73
Update AGENTS.md: use npm run test:e2e:local for E2E tests
cursoragent 7fb1326
Add pre-commit formatting instruction to AGENTS.md
cursoragent File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| # AGENTS.md | ||
|
|
||
| ## Cursor Cloud specific instructions | ||
jon-bell marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| ### Overview | ||
|
|
||
| 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. | ||
|
|
||
| ### Starting services | ||
|
|
||
| 1. **Docker daemon**: `sudo dockerd &>/tmp/dockerd.log &` — wait a few seconds, then verify with `docker info`. | ||
| 2. **Supabase**: `npx supabase start` — starts all Supabase services in Docker. Output includes local API URL and keys. | ||
| - **Known issue**: Migration `20260217000000_binary_submission_files.sql` may fail with `must be owner of table objects` because it creates RLS policies on `storage.objects`. Workaround: temporarily move the migration file, run `supabase start`, apply it via `docker exec -i supabase_db_pawtograder-platform psql -U postgres -d postgres < <migration_file>`, record it in `supabase_migrations.schema_migrations`, then restore the file. | ||
jon-bell marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| 3. **Configure `.env.local`**: After `supabase start`, get keys with `npx supabase status -o env` and set `NEXT_PUBLIC_SUPABASE_URL`, `NEXT_PUBLIC_SUPABASE_ANON_KEY`, `SUPABASE_SERVICE_ROLE_KEY`, `SUPABASE_URL`, `NEXT_PUBLIC_PAWTOGRADER_WEB_URL=http://localhost:3000`, and `ENABLE_SIGNUPS=true`. | ||
| 4. **Next.js dev server**: `npm run dev` — serves at `http://localhost:3000`. | ||
|
|
||
| ### Seeding the database | ||
|
|
||
| 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>`. | ||
|
|
||
| ### Before committing | ||
|
|
||
| **Always** run `npm run format` before committing. This runs Prettier on the entire codebase. CI will reject unformatted code. | ||
|
|
||
| ### Lint / Test / Build | ||
|
|
||
| - **Lint**: `npm run lint` (ESLint + Prettier). See `package.json` scripts. | ||
| - **Unit tests**: `npm test` (Jest). Note: `jest.setup.ts` must exist (import `@testing-library/jest-dom`). The existing test has a pre-existing issue with `Request` not being defined in jsdom. | ||
| - **E2E tests**: `npm run test:e2e:local` — this sets `BASE_URL=http://localhost:3000` and runs Playwright. Requires local Supabase running + dev server at port 3000. Also needs `SUPABASE_URL` and `SUPABASE_ANON_KEY` exported (or in `.env.local`), since `TestingUtils.ts` reads them from `process.env`. Tests run against chromium and webkit. | ||
| - **Build**: `npm run build` (requires ~8 GB memory via `NODE_OPTIONS=--max-old-space-size=8000`). | ||
| - **Format**: `npm run format` (Prettier auto-fix). | ||
|
|
||
| ### Key ports | ||
|
|
||
| | Service | Port | | ||
| | ------------------------ | ----- | | ||
| | Next.js dev server | 3000 | | ||
| | Supabase API | 54321 | | ||
| | Supabase DB (PostgreSQL) | 54322 | | ||
| | Supabase Studio | 54323 | | ||
| | Mailpit (email testing) | 54324 | | ||
|
|
||
| ### Notes | ||
|
|
||
| - The staging Supabase backend (`.env.local.staging`) has signups disabled; use local Supabase for full dev. | ||
| - Docker in this cloud VM requires `fuse-overlayfs` storage driver and `iptables-legacy`. These are configured during initial setup. | ||
| - Edge Functions (`npx supabase functions serve`) are optional unless you need webhook/autograder/notification processing locally. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| import "@testing-library/jest-dom"; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.