feat: add booking management, Open Day, unified signup modal
- 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>
This commit is contained in:
40
CLAUDE.md
40
CLAUDE.md
@@ -25,23 +25,25 @@ Content language: Russian
|
||||
src/
|
||||
├── app/
|
||||
│ ├── layout.tsx # Root layout, fonts, metadata
|
||||
│ ├── page.tsx # Landing: Hero → About → Team → Classes → MasterClasses → Schedule → Pricing → News → FAQ → Contact
|
||||
│ ├── page.tsx # Landing: Hero → [OpenDay] → About → Team → Classes → MasterClasses → Schedule → Pricing → News → FAQ → Contact
|
||||
│ ├── globals.css # Tailwind imports
|
||||
│ ├── styles/
|
||||
│ │ ├── theme.css # Theme variables, semantic classes
|
||||
│ │ └── animations.css # Keyframes, scroll reveal, modal animations
|
||||
│ ├── admin/
|
||||
│ │ ├── page.tsx # Dashboard with 11 section cards
|
||||
│ │ ├── page.tsx # Dashboard with 13 section cards
|
||||
│ │ ├── login/ # Password auth
|
||||
│ │ ├── layout.tsx # Sidebar nav shell
|
||||
│ │ ├── _components/ # SectionEditor, FormField, ArrayEditor
|
||||
│ │ ├── layout.tsx # Sidebar nav shell (14 items)
|
||||
│ │ ├── _components/ # SectionEditor, FormField, ArrayEditor, NotifyToggle
|
||||
│ │ ├── meta/ # SEO editor
|
||||
│ │ ├── hero/ # Hero editor
|
||||
│ │ ├── about/ # About editor
|
||||
│ │ ├── team/ # Team list + [id] editor
|
||||
│ │ ├── classes/ # Classes editor with icon picker
|
||||
│ │ ├── master-classes/ # MC editor with registrations
|
||||
│ │ ├── master-classes/ # MC editor with registrations + notification toggles
|
||||
│ │ ├── open-day/ # Open Day event editor (settings + grid + bookings)
|
||||
│ │ ├── schedule/ # Schedule editor
|
||||
│ │ ├── bookings/ # Group booking management with notification toggles
|
||||
│ │ ├── pricing/ # Pricing editor
|
||||
│ │ ├── faq/ # FAQ editor
|
||||
│ │ ├── news/ # News editor
|
||||
@@ -55,9 +57,15 @@ src/
|
||||
│ │ ├── team/[id]/ # GET/PUT/DELETE single member
|
||||
│ │ ├── team/reorder/ # PUT reorder
|
||||
│ │ ├── upload/ # POST file upload (whitelisted folders)
|
||||
│ │ ├── mc-registrations/ # CRUD registrations
|
||||
│ │ ├── mc-registrations/ # CRUD registrations + notification toggle
|
||||
│ │ ├── group-bookings/ # CRUD group bookings + notification toggle
|
||||
│ │ ├── open-day/ # CRUD events
|
||||
│ │ ├── open-day/classes/ # CRUD event classes
|
||||
│ │ ├── open-day/bookings/ # CRUD event bookings + notification toggle
|
||||
│ │ └── validate-instagram/ # GET check username
|
||||
│ └── master-class-register/ # POST public signup
|
||||
│ ├── master-class-register/ # POST public MC signup
|
||||
│ ├── group-booking/ # POST public group booking
|
||||
│ └── open-day-register/ # POST public Open Day booking
|
||||
├── components/
|
||||
│ ├── layout/
|
||||
│ │ ├── Header.tsx # Sticky nav, mobile menu, booking modal ("use client")
|
||||
@@ -68,6 +76,7 @@ src/
|
||||
│ │ ├── Team.tsx # Carousel + profile view
|
||||
│ │ ├── Classes.tsx # Showcase layout with icon selector
|
||||
│ │ ├── MasterClasses.tsx # Cards with signup modal
|
||||
│ │ ├── OpenDay.tsx # Open Day schedule grid + booking (conditional)
|
||||
│ │ ├── Schedule.tsx # Day/group views with filters
|
||||
│ │ ├── Pricing.tsx # Tabs: prices, rental, rules
|
||||
│ │ ├── News.tsx # Featured + compact articles
|
||||
@@ -76,8 +85,9 @@ src/
|
||||
│ └── ui/
|
||||
│ ├── Button.tsx
|
||||
│ ├── SectionHeading.tsx
|
||||
│ ├── BookingModal.tsx # Booking form → Instagram DM
|
||||
│ ├── BookingModal.tsx # Booking form → Instagram DM + DB save
|
||||
│ ├── MasterClassSignupModal.tsx # MC registration form → API
|
||||
│ ├── OpenDaySignupModal.tsx # Open Day class booking → API
|
||||
│ ├── NewsModal.tsx # News detail popup
|
||||
│ ├── Reveal.tsx # Intersection Observer scroll reveal
|
||||
│ ├── BackToTop.tsx
|
||||
@@ -87,10 +97,11 @@ src/
|
||||
├── lib/
|
||||
│ ├── constants.ts # BRAND constants, NAV_LINKS
|
||||
│ ├── config.ts # UI_CONFIG (thresholds, counts)
|
||||
│ ├── db.ts # SQLite DB, migrations, CRUD
|
||||
│ ├── db.ts # SQLite DB, 6 migrations, CRUD for all tables
|
||||
│ ├── auth.ts # Token signing (Node.js)
|
||||
│ ├── auth-edge.ts # Token verification (Edge/Web Crypto)
|
||||
│ └── content.ts # getContent() — DB with fallback
|
||||
│ ├── content.ts # getContent() — DB with fallback
|
||||
│ └── openDay.ts # getActiveOpenDay() — server-side Open Day loader
|
||||
├── proxy.ts # Middleware: auth guard for /admin/*
|
||||
└── types/
|
||||
├── index.ts
|
||||
@@ -119,7 +130,10 @@ src/
|
||||
- Cookie: `bh-admin-token` (httpOnly, secure in prod)
|
||||
- Auto-save with 800ms debounce on all section editors
|
||||
- Team members: drag-reorder, photo upload, rich bio (experience, victories, education)
|
||||
- Master classes: slots, registration viewer, trainer/style autocomplete from existing data
|
||||
- Master classes: slots, registration viewer with notification tracking (confirm + reminder), trainer/style autocomplete
|
||||
- Group bookings: saved to DB from BookingModal, admin page at `/admin/bookings` with notification toggles
|
||||
- Open Day: event settings (date, pricing, discount rules, min bookings), schedule grid (halls × time slots), per-class booking with auto-cancel threshold, public section after Hero
|
||||
- Shared `NotifyToggle` component (`src/app/admin/_components/NotifyToggle.tsx`) used across MC registrations, group bookings, and Open Day bookings
|
||||
- File upload: whitelisted folders (`team`, `master-classes`, `news`, `classes`), max 5MB, image types only
|
||||
|
||||
## Security Notes
|
||||
@@ -128,6 +142,10 @@ src/
|
||||
- API routes validate: input types, string lengths, numeric IDs
|
||||
- Public MC registration: length-limited but **no rate limiting yet** (add before production)
|
||||
|
||||
## Upcoming Features
|
||||
- **Rate limiting** on public endpoints (`/api/master-class-register`, `/api/group-booking`, `/api/open-day-register`)
|
||||
- **DB backup mechanism** — automated/manual backup of `db/blackheart.db` with rotation
|
||||
|
||||
## AST Index
|
||||
- **Always use the AST index** at `memory/ast-index.md` when searching for components, props, hooks, types, or styles
|
||||
- Contains: component tree, all exports, props, hooks, client/server status, CSS classes, keyframes
|
||||
|
||||
Reference in New Issue
Block a user