- docs, AGENT.md, the 16 skills, PROGRAMISTA and README use the preferred names (scripted, same list of forms); past CHANGELOG entries and the proposals in docs/dev are not rewritten - AGENT.md: 'Names: IAPL and ipal-kit' — old name, new name, state in 1.x; what is not renamed; storageNames - iapl-upgrade '→ 1.17.0', PROGRAMISTA §6 item 72, CHANGELOG 1.17.0 (draft): nothing required - env.md, doctor.md (legacy-names, storage-names), stats.md, security.md, project-starter.md, iapl-reference, iapl-setup - skill scripts read ipal-audit-skip and IPAL_IP_HEADER too; audit rule ids stay what they were - reference site: iapl(), iapl-doctor.json, iapl-* skills, storageNames: 'iapl'; INDEX.md regenerated Co-Authored-By: Claude Fable 5.2 <[email protected]>
54 lines
3.5 KiB
Markdown
54 lines
3.5 KiB
Markdown
# Example Studio — the IAPL reference site
|
|
|
|
One complete client site on `@intecion/ipal-kit` that uses every convention in `docs/agent/AGENT.md`, kept
|
|
current with each plugin release. The company, people, numbers and texts are **made up**; `example-studio.pl`
|
|
is a placeholder domain.
|
|
|
|
- **Agents** copy patterns from here (index: `docs/agent/reference-site/INDEX.md` in the plugin package).
|
|
- **The project starter** (`iapl create`) is generated from this folder; `starter.manifest.json` says what
|
|
it keeps, drops or turns into placeholders.
|
|
- **The plugin's CI** builds it, seeds it and runs the smoke tests on every change (`.gitea/workflows/ci.yml`).
|
|
|
|
## Run it locally
|
|
```bash
|
|
pnpm --dir .. build # the plugin's dist (this site uses it as file:.., injected)
|
|
pnpm install --ignore-workspace # re-run after every plugin build (refreshes the injected copy)
|
|
cp .env.example .env # then fill PAYLOAD_SECRET; DATABASE_URI points at a local MongoDB
|
|
pnpm seed # demo + base content, every language
|
|
pnpm dev # http://localhost:3000/pl
|
|
```
|
|
Production check: `pnpm build && pnpm payload run e2e/create-test-admin.ts && ALLOW_LOCAL_MEDIA=1 pnpm test:e2e`
|
|
(Playwright starts the built site on port 3100 itself; another port: `E2E_BASE_URL=http://localhost:3200`, built with
|
|
the same `NEXT_PUBLIC_SERVER_URL`; a server you started yourself: `E2E_REUSE_SERVER=1`).
|
|
|
|
Every Playwright run first resets the test admins and clears their stored 2FA attempt counts (`e2e/global-setup.ts`),
|
|
so a spec does not fail because of what ran before it. The fresh-site spec needs an EMPTY database:
|
|
`E2E_SKIP_ADMIN_SETUP=1 DATABASE_URI=<empty local database> pnpm exec playwright test two-factor-setup`.
|
|
|
|
What only a built site shows, with both bundlers — from the plugin repository's root, part of the release gate:
|
|
```bash
|
|
pnpm e2e:built # webpack, then Turbopack: build with the late-staff fixture, check the public files, run the specs
|
|
```
|
|
It checks the account rules of a staff collection that a plugin listed after iapl adds or copies
|
|
(`e2e/late-staff-fixture.ts`, on only with `E2E_LATE_STAFF=1`; `e2e/late-staff.spec.ts`) and that no package manifest
|
|
is among the public files. Unit tests run unminified code and cannot see what a bundle renames or publishes.
|
|
Without `E2E_LATE_STAFF=1` the fixture adds nothing and the spec is skipped. Rebuild with `pnpm build` afterwards.
|
|
|
|
## What is where
|
|
| Convention | Files |
|
|
|---|---|
|
|
| Languages | `src/i18n.config.ts`, `src/proxy.ts` |
|
|
| Data layer | `src/lib/content.ts`, `src/lib/globals.ts` |
|
|
| Pages, collections, globals | `src/collections/`, `src/globals/`, `src/content.config.ts` |
|
|
| Block library | `src/blocks/configs.ts`, `src/blocks/registry.ts` |
|
|
| Design tokens | `src/design/tokens.ts` → `src/design/tokens.css`, `src/app/(frontend)/styles.css`, `DESIGN.md`, `/design` |
|
|
| Layout, header, footer | `src/app/(frontend)/[locale]/layout.tsx`, `src/components/layout/` |
|
|
| Routes, 404, forms action | `src/app/(frontend)/[locale]/` |
|
|
| SEO / GEO / ops routes | `src/app/sitemap.xml`, `robots.ts`, `manifest.ts`, `llms*.txt`, `md/`, `api/mcp`, `api/health`, `api/csp-report`, `indexnow-key.txt` |
|
|
| Security headers, CSP | `next.config.ts` |
|
|
| Env validation | `src/instrumentation.ts`, `.env.example` |
|
|
| Seeds | `src/seed/` (`base.ts` kept by the starter, `demo.ts` + `showcase.ts` + `media.ts` dropped) |
|
|
| Deploy | `docs/DEPLOY.md` |
|
|
| Smoke tests | `e2e/`, `playwright.config.ts` |
|
|
| Project decisions | `AGENTS.md` |
|