Content Module Feature List
Section-wise CMS coverage for home, about, faq, legal, category pages, and global footer.
Content Module - Feature List
1. Feature Overview
The Content module provides section-wise CMS editing for frontend static copy/layout blocks while keeping runtime lists dynamic.
It covers:
- homepage static sections
- about page static sections
- FAQ page intro section
- legal document pages (
/privacy-policy,/terms-of-service) - product-category page static sections
- global footer static sections
- SEO linkage per page through existing
seorecords
It does not replace runtime data sources for:
- products list
- blog list
- FAQ list
Those remain served by existing feature APIs. Content stores only the section copy/config that wraps those runtime blocks.
2. Route Ownership and Surfaces
| Surface | Route prefix | Owner |
|---|---|---|
| Admin CMS | /api/admin/content/pages | ContentAdminController |
| Public CMS | /api/content/pages | ContentCustomerController |
| Mobile-composed public CMS | /api/mobile/content/pages | MobileModule composition of ContentCustomerModule |
Swagger tags used by controllers:
Content Pages (Admin)Content Pages
3. Page Coverage Matrix
| Page key | Frontend route | Status |
|---|---|---|
home | / | Covered |
about | /about | Covered |
products_thangkas | /products/thangkas | Covered |
products_singing_bowls | /products/singing-bowls | Covered |
products_statues | /products/statues | Covered |
products_jewellery | /products/jewellery | Covered |
faq | /faq | Covered |
privacy_policy | /privacy-policy | Covered |
terms_of_service | /terms-of-service | Covered |
global_footer | Global layout footer | Covered |
4. Section Coverage Matrix
4.1 Homepage (home)
Ordered sections:
herotop_pickscategoriesheritagewhy_usfaq_introblogs
4.2 About (about)
Ordered sections:
heroquotewhy_choosestory_blocksfaq_introblogs
4.3 Product category pages (products_*)
Ordered sections:
heroproducts_headerblogs_header
4.4 FAQ page (faq)
Ordered sections:
faq_intro
4.5 Global footer (global_footer)
Ordered sections:
brand_blockquick_linkscollections_linkssupport_linksfeatured_collections_cardscopyright
4.6 Legal pages (privacy_policy, terms_of_service)
Ordered sections:
document
5. Feature Matrix (Admin)
| Capability | Endpoint | AuthZ |
|---|---|---|
| Get page with all sections | GET /api/admin/content/pages/:pageKey | Content_READ |
| Update page metadata | PATCH /api/admin/content/pages/:pageKey/meta | Content_UPDATE |
| Upsert section payload | PUT /api/admin/content/pages/:pageKey/sections/:sectionKey | Content_UPDATE |
| Delete section payload | DELETE /api/admin/content/pages/:pageKey/sections/:sectionKey | Content_DELETE |
Notes:
- Admin
GETauto-creates a page row if it does not exist yet. PATCH metaandPUT sectionalso auto-create page rows.DELETE sectiondoes not auto-create and returnsCONTENT_NOT_FOUNDif page/section does not exist.
6. Feature Matrix (Public + Mobile)
| Capability | Endpoint | Runtime mode |
|---|---|---|
| Fetch published page payload | GET /api/content/pages/:pageKey | Synchronous read |
| Mobile mirror | GET /api/mobile/content/pages/:pageKey | Synchronous read |
Public behavior:
- returns only enabled sections (
isEnabled = true) - returns sections ordered by
position ASC, thenid ASC - returns
404 CONTENT_NOT_FOUNDwhen page row does not exist
7. Validation and Safety Rules
7.1 Page-to-section allowlist
A section can only be written if it is explicitly allowed for the target page key.
Violation result:
- HTTP
400 - errorCode:
CONTENT_SECTION_KEY_INVALID
7.2 Section payload schema validation
Every section payload is validated via a central schema registry.
Violation result:
- HTTP
400 - errorCode:
CONTENT_SECTION_PAYLOAD_INVALID
7.3 Tiptap-first text model
Display text fields are Tiptap JSON docs:
- must contain
{ type: "doc", content: [...] } contentarray must be non-empty
Technical fields remain primitive:
hrefsrcalticonKey- booleans
- numbers
7.4 URL safety
URL fields must be either:
- absolute HTTP(S), or
- site-relative path (
/...)
8. Section-Level Content Capabilities
8.1 Hero and list headers
Supports rich label/heading/description plus optional CTA and optional image slots.
8.2 Card/repeater blocks
why_us, why_choose, and story_blocks support repeaters with bounds:
- card arrays:
1..12 - story blocks:
1..10
8.3 Footer link groups
Link group sections support:
- rich
title items[]with richlabel+ safehref
9. SEO Linking Features
Each content page can point to one SEO record via seoId:
- nullable FK to
seo.id PATCH /metavalidates referenced SEO exists- response includes resolved
seoobject whenseoIdis present
Failure on invalid SEO id:
- HTTP
400 - errorCode:
CONTENT_SEO_NOT_FOUND
10. Permissions and Security
Permission module is Content and provides:
Content_CREATEContent_READContent_UPDATEContent_DELETE
Current admin usage:
Content_READContent_UPDATEContent_DELETE
Public route is explicitly marked with @Public() and has no admin role/permission guard.
11. Ordering and Visibility Behavior
Authoring control fields:
position(default0)isEnabled(defaulttrue)
Read behavior:
- admin read includes disabled sections
- public read filters out disabled sections
12. Frontend Integration Behavior
Expected frontend behavior with this module:
- fetch page payload by page key
- merge with runtime list APIs (products/blogs/faqs)
- render section blocks in returned order
- if page missing (
404 CONTENT_NOT_FOUND), fallback to hardcoded defaults
This keeps deployment safe while content is progressively authored.
13. Release/QA Checklist
- Admin page fetch auto-creates missing page row with default title.
- Public page fetch does not auto-create and returns
CONTENT_NOT_FOUNDfor missing rows. - Invalid page/section combination returns
CONTENT_SECTION_KEY_INVALID. - Invalid Tiptap JSON or malformed payload returns
CONTENT_SECTION_PAYLOAD_INVALID. - Invalid
seoIdreturnsCONTENT_SEO_NOT_FOUND. - Section ordering by
positionis stable. - Disabled sections are excluded from public payload.
- Mobile route parity (
/api/mobile/content/pages/:pageKey) returns same contract as/api/content/pages/:pageKey.
14. Feature Flow Diagram
15. File Map
apps/api/src/modules/content/content.contract.tsapps/api/src/modules/content/content-schema.registry.tsapps/api/src/modules/content/content.service.tsapps/api/src/modules/content/admin/content-admin.controller.tsapps/api/src/modules/content/customer/content-customer.controller.tspackages/db/src/schema/content/content-page.schema.tspackages/db/src/schema/content/content-section.schema.ts
Time fields in this module are stored as timezone-aware values and should be handled as ISO-8601 instants by API consumers.
See Also
- Backend Reference: See Content Module - Backend Documentation for DB, module composition, and validation internals.
- API Reference: See Content Module - API & Integration Guide for payload contracts and examples.