Project Overview
Relevant source files
The following files were used as context for generating this wiki page:
The Lou Gehrig Fan Club (LGFC) repository serves as the technical foundation for the club's public website and an authenticated FanClub area. The project is designed as a high-performance, static-first web application that integrates dynamic content management through Cloudflare's edge infrastructure. Its primary objective is to maintain strict design and navigation invariants while providing a robust platform for historical archives, member discussions, and community engagement.
The architecture leverages Next.js 15 for the frontend, Cloudflare Pages for hosting and deployment, and Cloudflare D1 as a serverless SQL database for dynamic data such as FAQs, milestones, and content blocks. Media assets are managed externally via Backblaze B2, while the commercial store is handled through an external integration with Bonfire.
Sources: README.md:1-12, context.md:1-16, package.json:54-58
Core Technical Stack
The LGFC project utilizes a modern full-stack web development suite optimized for the Cloudflare ecosystem.
| Component | Technology | Purpose |
|---|---|---|
| Framework | Next.js 15 (App Router) | Core application logic and routing |
| Language | TypeScript | Type-safe development |
| Deployment | Cloudflare Pages | Static site hosting and Edge Functions |
| Database | Cloudflare D1 | Dynamic content storage (FAQs, quotes, CMS) |
| Assets | Backblaze B2 | Media and image storage |
| Styling | CSS Variables & Global CSS | Design system enforcement |
Sources: context.md:14-22, package.json:54-65
System Architecture
The LGFC platform follows a decentralized architecture where the frontend is served as a static export, but interacts with dynamic Edge Functions (Cloudflare Workers) for data persistence and retrieval.
Data Flow Diagram
The following diagram illustrates how the frontend interacts with the Cloudflare Edge and D1 database.
The application separates static content delivery from dynamic data operations, ensuring fast page loads while maintaining interactive features like the FAQ search and Admin CMS.
Sources: context.md:14-22, scripts/cf_pages_snapshot.sh:42-45, lgfc-lite-configure-remaining.sh:137-145
Content Management System (CMS)
The project includes a custom CMS implementation located in the /admin area. This system manages "Content Blocks" stored in the D1 database.
Content Block Workflow
The CMS implements a Draft-and-Publish workflow to ensure that changes are reviewed before going live on the public site.
CMS Data Structure
| Field | Type | Description |
|---|---|---|
key | string | Unique identifier for the content block |
page | string | The page the block belongs to (e.g., "/") |
status | string | Either 'draft' or 'published' |
body_md | text | Raw Markdown content |
version | integer | Incremental version number |
Sources: src/app/admin/cms/page.tsx:9-25, src/app/admin/content/page.tsx:14-23
Routing and Auth Model
The project defines strict canonical routes to ensure navigation consistency across the public and member-only areas.
Route Categories
- Public Routes: accessible to everyone (e.g.,
/,/about,/faq,/join). - FanClub Routes:
/fanclub/**subpages requiring client-side authentication. - Admin Routes:
/admin/**pages for site management.
Authentication Implementation
Authentication is currently handled through a lightweight client-side model:
- Member State: Represented by the
localStoragekeylgfc_member_email. - Admin Privilege: Determined by a backend call to
/api/member/role?email=.... - Protection: Unauthenticated traffic to
/fanclubis redirected to the homepage (/).
Sources: context.md:27-44
Infrastructure and Automation
Cloudflare Snapshots
The project includes a robust backup mechanism for Cloudflare Pages metadata. The cf_pages_snapshot.sh script fetches project configurations, domain settings, and deployment history, saving them as timestamped JSON files.
CI/CD and Governance
The repository enforces strict governance through CI scripts:
- Docs Check:
docs_check_headers.shensures all markdown documentation contains required metadata headers (Doc Type, Audience, etc.). - Lock Verification:
verify_v6_lock.shchecks for the presence of specific CSS classes and DOM structures to prevent design drift. - Snapshots: Daily automated snapshots at 07:00 UTC.
Sources: scripts/cf_pages_snapshot.sh:11-30, scripts/cf_pages_snapshot.sh:135-138, audits/verify_v6_lock.sh:16-45
Conclusion
The LGFC repository is a purpose-built Next.js application that leverages the Cloudflare stack to provide a secure, scalable, and easily maintainable platform. By combining static generation with Edge-based CMS and database operations, it achieves high performance while maintaining the flexibility needed for community-driven content updates.