Community Public Pages Feature Context
Source: .agents/references/features/community-public-pages.md
Content
Community Public Pages Feature Context
Purpose
Community public pages are the visitor/member-facing surfaces for a community. They include the community home/profile, product listing, feed, events, courses, challenges, files, forms, memberships, and zero-link pages under dynamic community routes. These pages need to preserve SEO, static rendering behavior, member/non-member visibility rules, and checkout/product CTA behavior.
User-Facing Workflows
- Visitors land on
src/pages/[communityLink]/index.page.js,home.page.js,community.page.js, or product/event/feed child routes and browse public content. - Members see member-specific CTAs, welcome/splash states, feed access, enrolled product state, membership details, and chat/community access cards.
- Non-members see join/buy/apply CTAs, public descriptions, product cards, and upsell content.
- Community pages must handle inactive/missing communities, preview states, product availability, and localized copy without editing generated locale files unnecessarily.
- Public pages are mobile-heavy. Keep CTAs, carousels, filters, and modals ergonomic on narrow viewports and avoid stretching controls unless the design explicitly does so.
Key Entrypoints
- Routes:
src/pages/[communityLink]/index.page.jssrc/pages/[communityLink]/home.page.jssrc/pages/[communityLink]/community.page.jssrc/pages/[communityLink]/products.page.jssrc/pages/[communityLink]/events/[eventSlug]/index.page.jssrc/pages/[communityLink]/feed/[postSlug].page.jssrc/pages/[communityLink]/courses/[courseSlug].page.tsxsrc/pages/[communityLink]/challenges/[challengeSlug]/index.page.jssrc/pages/[communityLink]/forms/[formSlug].page.tsxsrc/pages/[communityLink]/zerolink/[zeroLinkSlug].page.js
- Components:
src/components/features/CommunityPage/src/components/features/CommunityPage/components/home/src/components/features/CommunityPage/components/allProducts/src/components/features/CommunityPage/components/common/src/features/CommunityProductPage/src/features/EventPublicPage/src/features/ResourcePage/src/features/ZeroLinksContent/
- Hooks:
src/hooks/useCommunityData.jssrc/hooks/useCommonPublicPageData.jssrc/hooks/useActiveCommunity.jssrc/hooks/useCommunityPricingData.jssrc/hooks/useStartCta.jssrc/hooks/useUserRoleInCommunity.ts
- Services:
src/services/communitiesService.jssrc/services/communitiesService/types.tssrc/services/unifiedProduct/unifiedProductServices.tssrc/services/commonService.js
- Utilities:
src/utility/communityHelpers.jssrc/utility/communityUtils.tssrc/utility/routesHelper.tssrc/utility/pageTypes.js
Data Flow and Service Boundaries
- Dynamic community routes usually derive
communityLinkand product/entity slugs from Next.js route params. Inspect route-level data fetching before changing client hooks. - Public route families are also exposed to AI agents through the read-only public page catalog
(
public/.well-known/public-pages.json,public/public-pages.md, andpublic/public-pages/llms.txt). Keep those docs aligned with public community, feed, offer, membership, zero-link, inactive, and physical-product variant routes when route families change. - Public pages mix static/server props, service calls, SWR-style helpers, and client-only widgets. Do not assume all data is fetched client-side.
- Public event client refreshes must preserve valid static event data when a successful response omits
eventInfo; incomplete refresh payloads must not clear the rendered event state. - Product cards often use unified product data. Check
src/components/features/CommunityPage/components/allProducts/andsrc/services/unifiedProduct/before changing labels, pricing, enrollment, or CTA logic. - Lead forms are part of public unified product discovery:
hasLeadForms/lead form counts should make the public Products tab and home product sections visible, while an otherwise empty community with no products, posts, or non-owner members can hide landing tabs and the home empty state. - Member-specific UI often depends on active community, user role, membership, pending approval, and product enrollment state. Keep those checks close to the rendering component when it already has the needed hook data.
- Analytics are spread across utilities and feature-specific helpers. Preserve existing event names and action IDs unless the task explicitly changes tracking.
Conventions and Gotchas
- Use
t('english-copy-as-kebab-case')for user-facing strings. Add only focused local English keys if required by the current repo rule. - Public routes are SEO-sensitive. Preserve meta tag helpers, static props, canonical URLs, and JSON-LD when touching page shells.
- Preserve semantic landmarks in public page shells: one primary
main, withheader,nav, andfootersupplied by the shared layout; route content should use labelledsectionregions and repeated product cards should usearticlewithout changing their visual classes. - Public page AI discovery must stay read-only. Page-context and MCP resources may describe visible public pages, but must not imply checkout/payment internals, member-only content, private feed/chat, learner lists, submissions, hidden pricing, seller/admin APIs, OAuth, API keys, webhooks, or MCP write tools.
- Private/member-only route families such as
/{communityLink}/courses/{courseSlug}/view,/{communityLink}/digital-files/{digitalFileSlug}/view, and/{communityLink}/products/{productSlug}/vieware blocked from public page context. - Avoid unnecessary
useEffect; derive view state from loaded community/product/member data when possible. - Do not use raw
<img>for content images when existing code uses Next image wrappers or sizing helpers. - Keep card/button widths faithful to Figma or existing UI. Do not add
flex-1orw-fullto CTA rows unless the design shows full-width behavior. - For conditional Tailwind classes, use
classnamesimported asclassNames. - Treat slugs and query params as untrusted input. Validate/guard before using them in service calls or redirects.
- ZeroLink checkout entry from a custom-domain public page must resolve the relative NAS-only
/checkout-globaldestination throughresolveNavigationHrefbefore hard navigation. Preserve the current forced navigation and affiliate query construction while avoiding a custom-host checkout hop. - Legacy community social links may store their value in
urlorlinkwithoutusername. Public social link clicks must use the stored-field fallback and skip navigation when every value is empty.
Related Standards
.agents/rules/clean-react.mdc.agents/rules/direct-translation-and-component-files.mdc.agents/rules/no-direct-locale-additions.mdc.agents/rules/no-try-catch-service-api.mdc.agents/rules/web-security.mdc.agents/references/coding-standard/useeffect-guidance.md.agents/references/coding-standard/figma-guidance.mdfor Figma-driven UI work
Useful Graph Queries and Fallback Searches
Use the terms below with search_graph/search_code, then run trace_path on central page-context,
membership, or product-card symbols. Run these shell searches only as documented fallbacks.
rtk rg "communityLink|activeCommunity|membership|UnifiedProduct|hasLeadForms|getPublicPageVisibilityConfig" src/pages/[communityLink] src/components/features/CommunityPage src/hooks src/services
rtk rg "ProductCard|StartCta|WelcomeToCommunity|PendingCommMembership|leadForms" src/components/features/CommunityPage src/features
rtk rg "public-pages|page-context|nas-page://|getPublicRouteFamilyContext|REGISTERED_PUBLIC_PAGE_CONTEXTS" public src/services/agentDiscovery src/pages/api src/utility
rtk find src/components/features/CommunityPage -maxdepth 4 -type f
Update Triggers
Update this reference when route names, community membership checks, unified product card behavior, public page data loading, public tab/empty-state visibility, public page catalog entries, route-family page-context behavior, or community-specific CTA rules change.