Public Pages & Routing
Relevant source files
The following files were used as context for generating this wiki page:
The Lou Gehrig Fan Club (LGFC) website is built using the Next.js App Router and is designed for deployment on Cloudflare Pages as a static export. The public-facing portion of the site provides information about the club's history, community rules, and legal disclosures, while serving as the entry point for the authenticated FanClub area.
The routing architecture follows a standard Next.js file-system-based approach where directory structures within src/app define the available paths. Public routes are accessible to all users, whereas specific routes under /fanclub or /admin require authentication or specific roles.
Sources: context.md:7-13, context.md:33-35
Core Public Routes
The project defines a canonical list of public routes that must be maintained to satisfy design and navigation invariants. These pages are primarily informational or serve utility functions like search and legal compliance.
Canonical Route List
| Route | Purpose | Implementation Details |
|---|---|---|
/ | Homepage | Features hero banner, weekly matchups, and social wall. |
/about | About the Club | Overview of the mission and history. |
/contact | Contact Us | Communication channels for the club. |
/terms | Terms of Service | Rules for respectful use and user submissions. |
/privacy | Privacy Policy | Data collection and usage disclosures. |
/faq | FAQ | Searchable database of questions and answers. |
/join | Membership Sign-up | Entry point for new members. |
/search | Site Search | Search functionality (standard placeholder). |
Sources: context.md:37-45, src/app/terms/page.tsx, src/app/privacy/page.tsx
Navigation Structure
Navigation is primarily handled via a global header and a hamburger menu component. The navigation system enforces a strict hierarchy to ensure users can transition between public information and authenticated sections.
Global Navigation Flow
The following diagram illustrates how users navigate between public pages and the restricted FanClub or Admin areas.
The diagram shows the transition from public entry points to protected areas based on authentication state.
Sources: context.md:21-25, src/components/HamburgerMenu.tsx:14-26
Navigation Menu Implementation
The HamburgerMenu component serves as the primary mobile and secondary desktop navigation tool, linking to both internal Next.js routes and external assets like the store.
- Key Links:
/,/join,/library,/photos,/memorabilia,/charities,/calendar,/about,/contact,/privacy,/terms,/admin. - External Links: The "Store" link directs users to an external Bonfire site.
Sources: src/components/HamburgerMenu.tsx:14-30
Homepage Architecture (V6 Specification)
The homepage follows a strict "V6" structural specification to ensure design compliance. This order is verified by automated drift guard tests.
Section Ordering
The homepage must render sections in the following exact sequence:
- Hero Banner: Welcome heading (H1).
- Weekly Matchup: Photo voting section.
- Membership CTA: Join/Login section.
- Social Wall: Live social media integration.
- Recent Club Discussions: Preview of member posts.
- Friends of the Fan Club: Partnerships and affiliates.
- Milestones: Historical timelines.
- Events Calendar: Fan club activities.
- FAQ: Frequently asked questions preview.
Sources: tests/homepage-structure.test.tsx:21-125
Data-Driven Public Pages
Several public pages utilize dynamic data fetching, either through static generation helpers or client-side API calls.
FAQ System
The FAQ page (/faq) implements a client-side search and filtering system.
- Data Fetching: Uses
apiGetto fetch from/api/faq/list?limit=50. - Logic: Items are sorted by a
pinnedflag first, then byupdated_atin descending order. - Analytics: Expanding an FAQ item triggers an optimistic view count increment and a
POSTrequest to/api/faq/view.
Sources: src/app/faq/page.tsx:16-100
Legal & Informational Pages
Pages like /terms and /privacy utilize a shared content fetching utility to allow for CMS-driven updates while providing hardcoded fallbacks.
// src/app/terms/page.tsx:6-12
export default async function Page() {
const data = await fetchPageContent("/terms");
const sections = data?.sections;
const title = sections?.title?.content ?? "Terms";
const leadHtml = sections?.lead_html?.content ?? null;
const bodyHtml = sections?.body_html?.content ?? null;
// ... renders with fallbacks if fetchPageContent fails
}
Sources: src/app/terms/page.tsx:4-13, src/app/privacy/page.tsx:4-13
Summary
Public Pages & Routing in the LGFC project are structured to prioritize design consistency and accessibility. The routing is managed via the Next.js App Router, ensuring that informational content is easily accessible while maintaining strict gates for the FanClub and Admin areas. The use of automated tests for homepage structure ensures that the visual hierarchy remains intact across development cycles.
Sources: context.md, tests/homepage-structure.test.tsx