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 pages mix static/server props, service calls, SWR-style helpers, and client-only widgets. Do not assume all data is fetched client-side.
- 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. - 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.
- 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.
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 Searches
rtk rg "communityLink|activeCommunity|membership|UnifiedProduct" src/pages/[communityLink] src/components/features/CommunityPage src/hooks src/services
rtk rg "ProductCard|StartCta|WelcomeToCommunity|PendingCommMembership" src/components/features/CommunityPage src/features
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, or community-specific CTA rules change.