Event & Fundraiser Management
Relevant source files
The following files were used as context for generating this wiki page:
Event & Fundraiser Management encompasses the administrative and public-facing systems used to coordinate club activities and promotional campaigns. This system allows administrators to manage a calendar of events and configure temporary "Campaign Spotlight" cards for fundraising efforts on the homepage.
The module is divided between the Admin Area, where content is authored and validated, and the Public Interface, which renders active events and published fundraiser snapshots using data stored in Cloudflare D1.
Sources: src/app/admin/events/page.tsx, src/app/admin/fundraiser-preview/page.tsx, src/components/CalendarSection.tsx
Event Management System
The event system handles the creation, listing, and display of scheduled activities. It utilizes a centralized database to serve event data to various UI components including the homepage banner, a monthly calendar view, and the admin management dashboard.
Admin Event Operations
Administrators manage events through a dedicated interface that supports creating new entries and viewing existing ones. Creation involves providing a title and date, with optional fields for time, location, and description.
The administrative workflow for adding events.
Sources: src/app/admin/events/page.tsx:39-71
Data Structures & Models
Events are represented by the EventRow or CalendarEvent types, which include temporal and descriptive metadata.
| Field | Type | Description |
|---|---|---|
id | number | Unique identifier for the event. |
title | string | The name of the event. |
start_date | string | Format: YYYY-MM-DD. Starting date. |
end_date | string | Optional. Format: YYYY-MM-DD. Ending date. |
location | string | Optional physical or virtual location. |
description | string | Optional detailed text about the event. |
external_url | string | Optional link to third-party registration or info. |
Sources: src/components/CalendarSection.tsx:6-16, src/components/calendar/EventsMonth.tsx:6-16
Public Display Components
- EventsBanner: A high-level summary component displaying upcoming events (e.g., "Annual Fan Meetup"). Sources: src/components/EventsBanner.tsx
- CalendarSection: A complex interactive calendar allowing users to navigate months and view details for specific days. It uses
calendarCellsto generate a 7-column grid layout. Sources: src/components/CalendarSection.tsx:50-81 - EventsMonth: A simplified monthly list view that fetches data for a specific
monthKey(YYYY-MM). Sources: src/components/calendar/EventsMonth.tsx:47-50
Fundraiser & Campaign Spotlight
The Campaign Spotlight is a specialized CMS block designed for fundraising. It is managed via a "Preview" workflow that allows administrators to build and validate configurations in a gated area before they are made public on the homepage.
Campaign Configuration & Persistence
Campaigns are stored as serialized configurations within the content_blocks table. They follow a draft-to-publish lifecycle.
The lifecycle of a fundraiser campaign spotlight.
Sources: src/app/admin/fundraiser-preview/page.tsx:94-154, src/app/admin/cms/page.tsx:75-103
Spotlight Editor Fields
The Fundraiser Preview editor provides granular control over the campaign's visual and functional elements.
| Category | Fields |
|---|---|
| Labels | eyebrow, badge, title, deadlineLabel, progressLabel |
| Content | description, note, archiveLabel |
| Metrics | goalAmount, raisedAmount, supporterCount |
| Actions | primaryCtaLabel, primaryCtaHref, secondaryCtaLabel, secondaryCtaHref |
| Control | enabled (Boolean toggle for homepage visibility) |
Sources: src/app/admin/fundraiser-preview/page.tsx:21-30, src/app/admin/fundraiser-preview/page.tsx:185-240
Validation and Preview
The system enforces validation before allowing a save or publish. Errors are displayed in the UI if required fields are missing or improperly formatted. Administrators can view a "Local Draft Preview" alongside the currently "Published Snapshot" to compare changes before going live.
Sources: src/app/admin/fundraiser-preview/page.tsx:103-107, src/app/admin/fundraiser-preview/page.tsx:254-265
API Endpoints
The management system relies on several internal API routes for data synchronization.
| Endpoint | Method | Purpose |
|---|---|---|
/api/events/month | GET | Fetches all events for a specific month (YYYY-MM). |
/api/events/next | GET | Fetches upcoming events (limited to 10 by default). |
/api/admin/events/create | POST | Creates a new event record (Admin only). |
/api/admin/cms/save | POST | Saves a draft fundraiser configuration. |
/api/admin/cms/publish | POST | Promotes a draft configuration to the public state. |
/api/admin/cms/list | GET | Retrieves CMS blocks filtered by page. |
Sources: src/app/admin/events/page.tsx:26, src/app/admin/fundraiser-preview/page.tsx:64, src/components/CalendarSection.tsx:162, src/app/admin/cms/page.tsx:62
Event and Fundraiser Management provides a robust framework for site administrators to keep the community informed and engaged. By combining a flexible event calendar with a strictly validated fundraiser spotlight system, the project ensures that critical organizational information is both manageable and reliably presented to users.