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
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 addedstatus=academy— routed to the academy pathsearch— 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:
| Column | Description |
|---|---|
| Position | FCFS order within the season |
| Name / Email | From the linked enquiry |
| DOB | Athlete date of birth |
| Status | waiting / invited / accepted / declined / etc. |
| Returning | ✓ if is_returning = 1 (attended a prior season) |
| Added | Date the entry was created |
| Response | Parent’s yes/no (if invited and responded) |
Admin actions:
- Invite — mark entry as
invitedand (optionally) send theacademy_inviteemail - 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:
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
{{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).
| Setting | Description |
|---|---|
| Site name | Club name used in emails |
| Site URL | Base URL for all email links |
| Email from | Sender address (must be verified in Resend) |
| Venue name | Shown in booking confirmations and reminders |
| Venue address | Shown in booking emails |
| Weeks ahead | How many weeks of dates to offer in booking invites |
| Capacity per slot | Default per-session capacity (overridden per age group) |
| Academy max age | Upper age limit for the Academy routing path |
| Admin email | BCC address for admin notifications |