- adding or editing CMS-backed public pages
- changing the
Page->Section->Text/Button/File/Datagraph - updating seed data for
lyre/content - tracing how SvelteKit consumes seeded pages and sections
- preparing AI-safe edits for the Aspire public website
packages/content/src/Models/Page.phppackages/content/src/Models/Section.phppackages/content/src/Http/Resources/Section.phppackages/content/src/Repositories/DataRepository.phpaspire-api/database/seeders/PageSeeder.phpaspire-api/database/seeders/PublicPageTemplateSeeder.phpaspire-api/database/data/pages.jsonaspire-api/database/data/public-page-templates.jsonaspire-ui/src/routes/(public)/+layout.server.tsaspire-ui/src/lib/components/page.svelteaspire-ui/src/lib/components/base.svelteaspire-ui/src/lib/components/registry.ts
Pageis mostly SEO and page identity.Sectionis the real layout/content building block.- section relationships are recursive through
section_sections. - sections collect
texts,buttons,files,icon, anddata. Sectioneagerly loads those relations by default.Sectionresource transformsdatafrom an array ofDatamodels into a keyed object by lowercased data name.
- public layout fetches all pages from
/pages?with=sections&unpaginated=true - each route using the shared page component selects a page by slug
base.sveltemaps eachsection.nameto a concrete Svelte component fromregistry.ts
This means:
- section names are component identifiers
- order is stored in pivot tables, not only in JSON
- changing a section contract requires checking the matching Svelte component
- Prefer editing JSON data files, not hand-building pages in PHP.
- Use the shared seeding concern for recursive pages.
- Keep seeders idempotent with
updateOrCreate. - For dynamic pages, use
miscto describe route params, endpoints, and query semantics. - Use
dataonly when the currentDataRepositorycan actually resolve the dataset you want.
DataRepository currently supports these filter concepts well:
limitoffsetunpaginatedorderByColumnorderByOrderrelationfacet
It does not currently provide a fully generic pass-through for every repository query-string feature, so do not assume every frontend listing can be expressed purely through section data.
There are two categories of pages:
- already CMS-driven pages like
home - hard-coded Svelte pages that now have seeded templates for migration, such as
blog,contact-us,study/exams, andstudy/notes
For migration work:
- lock the section names and
misccontract in seeded templates - build the matching Svelte components
- switch the route to the shared page renderer last