Admin Panel

The admin panel is a server-rendered Astro application at /admin. All pages require the egac_admin_token cookie (set on login). The panel provides a full management interface over the club’s enquiries, bookings, Academy waitlist, email templates, and system configuration.

Authentication

Access /admin/login to authenticate. On success, an HttpOnly egac_admin_token cookie is set for the session. Logout clears the cookie.

In development environment, the token dev can be used without looking up the real token.

Page map

flowchart TD L[/admin/login] --> Home Home[/admin] --> E[/admin/enquiries\nList + search] Home --> B[/admin/bookings\nAll bookings] Home --> AC[/admin/academy\nWaitlist management] Home --> R[/admin/reports\nDashboard] Home --> M[/admin/memberships\nForm submissions] Home --> T[/admin/templates\nEmail templates] Home --> S[/admin/settings\nSystem config]

E —> ED[/admin/enquiries/:id\nDetail + actions] T —> TD[/admin/templates/:id\nEdit + preview]

Enquiries (/admin/enquiries)

The main working list. Shows all enquiries with inline status indicators.

Filters:

  • status=pending — not yet processed (no invite sent)
  • status=processed — invite sent or academy waitlist added
  • status=academy — routed to the academy path
  • search — name or email substring match

Actions from the list:

  • View enquiry detail
  • Resend booking invite (admin POST to /api/admin/invites/resend)

Enquiry detail (/admin/enquiries/:id)

Shows the complete record for one athlete:

  • Contact details, DOB, resolved age group
  • Invite status and token link
  • All bookings with session dates and statuses
  • Full event log — a chronological timeline of every action taken
  • Membership form submission (if completed)

The event log renders the enquiry.events JSON array as a human-readable timeline, showing timestamps and event type labels.

Bookings (/admin/bookings)

All taster session bookings across all dates.

Filters: ?date=YYYY-MM-DD, ?status=confirmed

Attendance recording: click any confirmed booking to record attendance. The modal POSTs to /api/admin/bookings/:id/attendance with:

{
  "status": "attended | no_show | cancelled",
  "note": "optional free text",
  "send_membership_link": true
}

When send_membership_link: true is checked and attendance is attended, a membership OTP is generated and the membership_invite email is sent automatically.

Academy (/admin/academy)

Displays the current Academy season and waitlist.

Waitlist table columns:

ColumnDescription
PositionFCFS order within the season
Name / EmailFrom the linked enquiry
DOBAthlete date of birth
Statuswaiting / invited / accepted / declined / etc.
Returning if is_returning = 1 (attended a prior season)
AddedDate the entry was created
ResponseParent’s yes/no (if invited and responded)

Admin actions:

  • Invite — mark entry as invited and (optionally) send the academy_invite email
  • Ineligible — remove from consideration without contacting the parent
  • Withdraw — mark as withdrawn

Reports (/admin/reports)

The reports dashboard surfaces the data from GET /api/admin/reports:

flowchart LR subgraph Funnel E[Enquiries] --> I[Invites sent] I --> B[Booked] B --> A[Attended] end subgraph KPIs EM[Enquiries\nthis month] BM[Bookings\nthis month] CR[Conversion\nrate %] AP[Academy\npending] end subgraph Calendar S1[Next Tue\nX/Y slots] S2[+1 week] S3[+2 weeks] S4[+3 weeks] end

Included metrics:

  • Enquiries: total, this month, last month
  • Bookings: total, this month, attended, no-show, conversion rate
  • Academy: total waitlist, responded yes/no, unassigned pending
  • Upcoming 4 sessions with per-age-group capacity fill
  • 6-month enquiry volume trend

Memberships (/admin/memberships)

Lists all completed membership form submissions with athlete details. Use ?format=csv in the URL to download a CSV export covering all membership data fields including emergency contacts and consent flags.

Email Templates (/admin/templates)

Lists the six system email templates. Each can be edited, previewed, and test-sent.

Template editor (/admin/templates/:id)

  • Subject — editable plain text
  • HTML body — editable, with {{variable}} support
  • Plain text body — optional fallback
  • Variable reference panel — lists all {{tokens}} found in the current template
  • Preview pane — live render using sample variables
  • Test send — dispatches to a specified email using sample data
  • Active toggle — disabled templates cause send attempts to fail gracefully
warning
Saving a template with an unknown {{variable}} (one not in the template's defined variable list) will show a warning. The save is not blocked, but sending with an unfilled variable will cause the email send to fail.

Settings (/admin/settings)

Editable system configuration. Values are stored in Cloudflare KV and take effect immediately (5-minute cache TTL).

SettingDescription
Site nameClub name used in emails
Site URLBase URL for all email links
Email fromSender address (must be verified in Resend)
Venue nameShown in booking confirmations and reminders
Venue addressShown in booking emails
Weeks aheadHow many weeks of dates to offer in booking invites
Capacity per slotDefault per-session capacity (overridden per age group)
Academy max ageUpper age limit for the Academy routing path
Admin emailBCC address for admin notifications