- Add in-memory rate limiter (src/lib/rateLimit.ts) to public registration endpoints
- Add DB migration #9 with 8 performance indexes on booking/registration tables
- Fix N+1 query in getUpcomingReminders() — single IN() query instead of per-title
- Add loading="lazy" to all non-hero images (MasterClasses, News, Classes, Team)
- Add sizes attribute to Classes images for better responsive loading
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Auto-surfaces bookings for today and tomorrow. Admin sets status per
person: coming, no answer, or cancelled. Summary stats per day.
DB migration 8 adds reminder_status column to all booking tables.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- MC registrations: notification toggles (confirm/remind) with urgency
- Group bookings: save to DB from BookingModal, admin CRUD at /admin/bookings
- Open Day: full event system with schedule grid (halls × time), per-class
booking, discount pricing (30 BYN / 20 BYN from 3+), auto-cancel threshold
- Unified SignupModal replaces 3 separate forms — consistent fields
(name, phone, instagram, telegram), Instagram DM fallback on network error
- Centralized /admin/bookings page with 3 tabs (classes, MC, Open Day),
collapsible sections, notification toggles, filter chips
- Unread booking badge on sidebar + dashboard widget with per-type breakdown
- Pricing: contact hint (Instagram/Telegram/phone) on price & rental tabs,
admin toggle to show/hide
- DB migrations 5-7: group_bookings table, open_day tables, unified fields
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sessions from before CSRF was added lack the bh-csrf-token cookie,
causing 403 on first save. Middleware now auto-generates the cookie
if the user is authenticated but missing it.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Double-submit cookie pattern: login sets bh-csrf-token cookie,
proxy.ts validates X-CSRF-Token header on POST/PUT/DELETE to /api/admin/*.
New adminFetch() helper in src/lib/csrf.ts auto-includes the header.
All admin pages migrated from fetch() to adminFetch().
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix header nav overflow by switching to lg: breakpoint with tighter gaps
- Fix file upload path traversal by whitelisting allowed folders and extensions
- Fix BookingModal using hardcoded content instead of DB-backed data
- Add input length validation on public master-class registration API
- Add ID validation on team member and reorder API routes
- Fix BookingModal useCallback missing groupInfo/contact dependencies
- Improve admin news date field to use native date picker
- Add missing Мастер-классы and Новости cards to admin dashboard
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- NewsItem type with title, text, date, optional image and link
- Admin page at /admin/news with image upload and auto-date
- Public section between Pricing and FAQ, hidden when empty
- Nav link auto-hides when no news items exist
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Group extraction now uses groupId (from admin panel) instead of
type+time heuristic, with mergeSlotsByDay for proper day/time display.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Replace single popular dropdown with per-item toggle switch in pricing admin
- Add PriceField component to master classes admin (strips/adds BYN suffix)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add groupId field to ScheduleClass for admin-defined group identity
- Add versioned DB migration system (replaces initTables) to prevent data loss
- Redesign GroupView: Trainer → Class Type → Group → Datetimes hierarchy
- Group datetimes by day, merge days with identical time sets
- Auto-assign groupIds to legacy schedule entries in admin
- Add mc_registrations CRUD to db.ts
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- BookingModal now accepts optional groupInfo for pre-filled message
- Trainer profile: each group card has Записаться button
- Schedule group view: each group card has Записаться button
- Message includes class type, trainer, days, and time
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Extract classes from schedule matching trainer name
- Group by type+time+location, combine days (e.g. ПН, СР)
- Display as horizontal scroll cards with time, location, level
- Show recruiting badge and address (without city prefix)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Replace wrapping grid with horizontal ScrollRow (drag to scroll)
- Apply to victories, education, and experience sections
- Grid overlay for victory tabs so height stays stable across tabs
- Fixed-width cards (w-44/w-48) with items-stretch for uniform height
- Remove scrollbar, add grab cursor for drag interaction
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Widen layout (max-w-5xl), larger photo column
- Fix place badge: clean pill instead of clipped diamond
- Increase victory card text sizes for readability
- Cards fill available width instead of fixed size
- Move back button above photo
- Add Escape key: closes lightbox or returns to gallery
- Clicking inactive carousel photos scrolls to them
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Predefined options: 1-6 место, Финалист, Полуфиналист, Лауреат,
Номинант, Участник, Победитель, Гран-при, Best Show, Vice Champion,
Champion — with emoji indicators for top places and nominations.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Merge place/category/competition into single row for compact layout
- Inline date range picker (no wrapper div causing overflow)
- Remove restrictive Nominatim filter — show all location results
- Reduce padding/gaps across all bio fields for denser layout
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Team list: click card to open editor (remove pencil button), keep drag-to-reorder
- Instagram field: username-only input with @ prefix, async account validation via HEAD request
- Victory dates: date range picker replacing text input, auto-formats to DD.MM.YYYY / DD-DD.MM.YYYY
- Victory location: city autocomplete via Nominatim API with suggestions dropdown
- Links: real-time URL validation with error indicators on all link fields
- Save button blocked when any validation errors exist
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add VictoryItem type (place, category, competition, location, date, image, link)
- Add RichListItem type for education with image/link support
- Backward-compatible DB parsing for old string[] formats
- Admin forms with structured fields and image upload per item
- Victory/education cards with photo overlay and lightbox
- Remove max-width constraint from trainer profile for full-width layout
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Extend TeamMember type with experience/victories/education string arrays
- Add DB columns with auto-migration for existing databases
- Update API POST route to accept bio fields
- Add ListField component for editing string arrays in admin
- Add bio section (Опыт/Достижения/Образование) to team member admin form
- Create TeamProfile component with full profile view (photo + bio sections)
- Add "Подробнее" button to TeamMemberInfo that toggles to profile view
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove trainer dropdown from filter bar — filter by clicking names in schedule cards
- Make trainer/type clickable in DayCard with gold highlight on active filter
- Fix showcase layout shift: track max detail height to prevent section from shrinking
- Remove key-based grid remount that re-triggered Reveal animations on filter change
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add "Все студии" tab merging all locations by weekday with location sub-headers
- Location tabs show hall name + address subtitle for clarity
- Add day multi-select and time-of-day preset filters (Утро/День/Вечер) behind collapsible "Когда" button
- Make trainer and type names clickable in day cards for inline filtering
- Add group view clustering classes by trainer+type+location
- Remove trainer dropdown from filter bar — filter by clicking names in schedule
- Add searchable icon picker and lucide-react icon rendering for classes admin/section
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace per-item toggles with top-level dropdown selects for popular and featured items.
Add PriceField component with inline gold BYN suffix badge.
Public Pricing component now uses dynamic popular/featured flags from data.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Custom gold checkbox for 'Одинаковое время'
- Delete button moved to right with text label
- Save button on left
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Validate trainer, type, and time before saving
- Show overlap warnings for conflicting classes
- Reset end time when start time exceeds it
- Block setting end time earlier than start
- Remove day change hints from modal
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- "Одинаковое время" checkbox (default on) syncs time across all days
- Uncheck to set per-day times (e.g., Mon 12:00, Fri 18:00)
- Checkbox only appears when 2+ days selected
- Single day: just shows one time field, no checkbox
- Unified day selector for both new and edit modes
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Group = trainer + type (time-independent)
- Edit modal shows per-day time fields (Mon 12:00, Fri 18:00)
- Calendar blocks colored by group, not class type
- Color picker for site dots moved to classes editor
- New class: single time + multi-day selector
- Edit class: per-day times, add/remove days from group
- Delete removes group from all days
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Auto-detect class groups (same trainer + type + time across days)
- Edit modal shows all group days pre-selected (e.g., ВТ/ПТ both lit)
- Toggle days to add/remove class from specific days
- Delete removes class from all days in the group
- New class modal lets you pick multiple days at once
- Visual hints: green +day / red −day for pending changes
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add clickable color picker in schedule legend (16 distinct colors)
- Two-pass smart assignment: explicit colors first, then unused palette slots
- Hide already-used colors from the picker (both explicit and fallback)
- Colors saved to classes section and flow to public site schedule dots
- Expanded palette: rose, orange, amber, yellow, lime, emerald, teal, cyan,
sky, blue, indigo, violet, purple, fuchsia, pink, red
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Card-body drag was causing accidental drags in complex form cards
(classes, FAQ, pricing). Keep grip-icon-only drag for ArrayEditor,
card-body drag remains on team page (simple cards).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Defer onChange call in ArrayEditor drag drop to queueMicrotask to
avoid calling parent setState inside React updater. Add hover
highlight on draggable cards for better visual feedback.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Drag from grip icon (instant) or card body (8px movement threshold)
- Floating clone + placeholder at drop position
- Disable text selection during drag
- Auto-resize textareas, hidden scrollbar/resize handle
- Dark admin scrollbar styles
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Textareas auto-grow with content and on window resize, no scrollbar
or resize handle needed. Added dark admin scrollbar styles for cases
where overflow is needed.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace arrow buttons with mouse-based drag-and-drop in ArrayEditor
and team page. Dragged card follows cursor with floating clone, empty
placeholder shows at drop position. SectionEditor now auto-saves with
800ms debounce instead of manual save button.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Complete admin panel for content management:
- SQLite database with better-sqlite3, seed script from content.ts
- Simple password auth with HMAC-signed cookies (Edge + Node compatible)
- 9 section editors: meta, hero, about, team, classes, schedule, pricing, FAQ, contact
- Team CRUD with image upload and drag reorder
- Schedule editor with Google Calendar-style visual timeline (colored blocks, overlap detection, click-to-add)
- All public components refactored to accept data props from DB (with fallback to static content)
- Middleware protecting /admin/* and /api/admin/* routes
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>