|
| 1 | +# Project Overview |
| 2 | + |
| 3 | +This is the PrairieLearn marketing website built with Next.js 16 and TypeScript. It showcases PrairieLearn's educational assessment platform features and hosts content from the PrairieLearn example course via a git submodule. |
| 4 | + |
| 5 | +## Guidelines |
| 6 | + |
| 7 | +- NEVER amend commits or force push unless specifically requested. |
| 8 | +- NEVER rebase unless specifically requested, always use merge commits. |
| 9 | +- NEVER use `as any` casts in TypeScript code to avoid type errors. |
| 10 | +- Don't add extra defensive checks or try/catch blocks that are abnormal for that area of the codebase (especially if called by trusted / validated codepaths). |
| 11 | +- Don't add extra comments that a human wouldn't add or that are inconsistent with the rest of the file. |
| 12 | + |
| 13 | +## Commands |
| 14 | + |
| 15 | +```bash |
| 16 | +yarn dev # Start development server on localhost:3000 |
| 17 | +yarn build # Production build |
| 18 | +yarn lint # Run ESLint and Prettier checks |
| 19 | +yarn format # Auto-format with Prettier |
| 20 | +``` |
| 21 | + |
| 22 | +## Git Submodule |
| 23 | + |
| 24 | +The `PrairieLearn/` directory is a git submodule containing the example course content: |
| 25 | + |
| 26 | +```bash |
| 27 | +git submodule init && git submodule update # Initial setup |
| 28 | +git submodule update --remote # Update to latest |
| 29 | +``` |
| 30 | + |
| 31 | +## Architecture |
| 32 | + |
| 33 | +### Content Pipeline |
| 34 | + |
| 35 | +The site pulls content from `PrairieLearn/exampleCourse/` and processes it for display: |
| 36 | + |
| 37 | +- **src/lib/catalog/** - Utilities that read markdown files from the submodule, parse frontmatter with `gray-matter`, and expose content for pages |
| 38 | +- **src/remarkPlugins/** - Custom Remark plugins for markdown processing (extractImages, loadCode, rewriteAssessmentLinks) |
| 39 | +- `COURSE_ROOT` in `src/lib/catalog/util.ts` points to `PrairieLearn/exampleCourse/` |
| 40 | + |
| 41 | +### MDX Configuration |
| 42 | + |
| 43 | +MDX support is configured in `next.config.ts` with: |
| 44 | +- Math rendering via `remark-math` and `rehype-katex` |
| 45 | +- GitHub Flavored Markdown via `remark-gfm` |
| 46 | +- Auto-linking headings via `rehype-slug` and `rehype-autolink-headings` |
| 47 | + |
| 48 | +### Page Structure |
| 49 | + |
| 50 | +- **src/pages/** - Next.js page routes (catalog/, about/, products/, pricing/, etc.) |
| 51 | +- **src/components/** - Reusable React components with co-located `.module.scss` files |
| 52 | +- **src/lib/images/** - Static image assets |
| 53 | + |
| 54 | +### Key Components |
| 55 | + |
| 56 | +- `ExampleQuestion.tsx` - Renders interactive PrairieLearn question examples |
| 57 | +- `ExampleEditor.tsx` - Shows code editor examples |
| 58 | +- `BlogMarkdownLayout.tsx` - Layout wrapper for markdown content pages |
0 commit comments