Skip to content

feat: full platform implementation — security, Mukoko compliance, features#17

Merged
bryanfawcett merged 6 commits intomainfrom
claude/add-claude-documentation-Kwmpp
Mar 25, 2026
Merged

feat: full platform implementation — security, Mukoko compliance, features#17
bryanfawcett merged 6 commits intomainfrom
claude/add-claude-documentation-Kwmpp

Conversation

@bryanfawcett
Copy link
Copy Markdown
Contributor

@bryanfawcett bryanfawcett commented Mar 25, 2026

Summary

  • 17 security vulnerabilities fixed: writeAuth on unprotected routes, CORS restricted to trusted origins, timing-safe API key comparison, 10MB upload limit, generic error messages, auth fallback removed, JWT on write API calls, redirect validation, rate limiting expanded
  • Mukoko registry compliance: structured [mukoko] logging (frontend + backend), section error boundary with retry, circuit breaker for external services, retry with exponential backoff, AI safety middleware (prompt injection detection)
  • Full event platform features: email notifications (Resend, 5 templates), social sharing (WhatsApp-first), recurring events & series (RRULE), waitlists with auto-promotion, QR check-in, payment infrastructure (Paynow), host analytics, CSV export, event cancellation workflow, user account deletion with PII anonymization, audit logging, categories in DB, i18n (English + Shona), PWA with service worker, FTS5 full-text search

47 files changed, 3587 insertions, 175 deletions. 370 tests passing (160 frontend + 210 backend).

Test plan

  • Frontend tests pass (160 tests) — npx vitest run
  • Worker tests pass (210 tests) — cd worker && npx vitest run
  • Worker type check passes — cd worker && npx tsc --noEmit
  • Lint passes — npm run lint
  • Build passes — npm run build
  • CI pipeline (5 jobs) passes on push
  • Run DB migrations (005, 006, 007) on staging before deploy
  • Verify Resend email delivery with RESEND_API_KEY configured
  • Verify Paynow integration with test credentials

https://claude.ai/code/session_01VoNT9jtzVApFrV1ahA6pgz

The backend was restructured from a single ~3400-line index.ts to a
modular Hono-based architecture with 14 route modules, middleware layer,
and utils. Updated all sections to match: routing docs, key files table
with line counts, tech stack versions, middleware/utils docs, expanded
database schema details (14 tables), frontend structure breakdown, and
added test file inventory.

https://claude.ai/code/session_01VoNT9jtzVApFrV1ahA6pgz
@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nhimbe Ready Ready Preview, Comment Mar 25, 2026 11:03pm

Request Review

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Mar 25, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
mukoko-nhimbe-api b7cc458 Commit Preview URL

Branch Preview URL
Mar 25 2026, 11:03 PM

…iance, and new features

Security fixes (17 vulnerabilities):
- Add writeAuth to unprotected routes (users, reviews, referrals)
- Restrict CORS to trusted origins (nyuchi.com, mukoko.com, nhimbe.com)
- Timing-safe API key comparison, 10MB upload limit, generic error messages
- Remove auth fallback user creation, add JWT to write API calls
- Redirect URL validation, search log truncation, pagination fix

Mukoko registry compliance:
- Structured logging with [mukoko] prefix (frontend + backend)
- Section error boundary with retry (3-layer pattern)
- Circuit breaker for external services (stytch, vectorize, ai, r2)
- Retry with exponential backoff and jitter
- AI safety middleware (prompt injection detection)

New platform features:
- Email notifications via Resend (5 templates, queue-based)
- Social sharing (WhatsApp-first share button, invite friends with referral)
- Recurring events & series (RRULE support)
- Waitlists with auto-promotion
- QR-based check-in and attendance tracking
- Payment infrastructure (Paynow provider abstraction)
- Host analytics endpoints
- CSV data export for registrations
- Event cancellation workflow
- User account deletion with PII anonymization
- Audit logging for destructive operations
- Categories moved to database with seed endpoint
- i18n infrastructure (English + Shona)
- PWA with service worker (cache-first static, network-first API)
- FTS5 full-text search migration

Test coverage: 370 tests (160 frontend + 210 backend)
New test files: events, registrations, users routes

https://claude.ai/code/session_01VoNT9jtzVApFrV1ahA6pgz
@bryanfawcett bryanfawcett changed the title Update CLAUDE.md to reflect current codebase architecture feat: full platform implementation — security, Mukoko compliance, features Mar 25, 2026
…components

UI primitive layer (34 shadcn/Radix components):
- Installed: button, card, badge, input, dialog, drawer, tabs, select,
  dropdown-menu, separator, sheet, label, textarea, switch, toggle,
  scroll-area, skeleton, avatar, popover, tooltip, form, checkbox,
  radio-group, progress, calendar, sonner, spinner, collapsible,
  hover-card, navigation-menu, breadcrumb, pagination, table, toggle-group
- All use data-slot attributes, CVA variants, Radix primitives
- Added success/warning/error variants to Badge for domain needs
- Created ResponsiveModal (Drawer on mobile / Dialog on desktop)
- Refactored BottomSheetModal to use ResponsiveModal underneath

Component decomposition:
- create-event-form.tsx: 639 → ~270 lines
  Extracted: CoverImageUpload, ThemeSelector, EventOptionsCard, FormFieldRow
- event-detail-content.tsx: 512 → ~200 lines
  Extracted: EventCover, EventSidebar (with StatBox)

Compatibility fixes:
- variant="primary" → variant="default" across all consumers
- size="large" → size="lg"
- Removed custom badge/icon/variant props from Tabs, Input, Progress
- Added use-mobile hook from registry

https://claude.ai/code/session_01VoNT9jtzVApFrV1ahA6pgz
…-bar, status-indicator, timeline, copy-button, file-upload, share-dialog, lazy-section, detail-layout

Adds 10 Mukoko registry components that go beyond standard shadcn primitives,
providing domain-specific building blocks with mineral branding, data-slot
attributes, and full TypeScript support.

https://claude.ai/code/session_01VoNT9jtzVApFrV1ahA6pgz
- Replace duplicate renderStars() in event-ratings and host-reputation with Rating primitive
- Replace inline stat boxes in community-insights with StatsCard primitive
- Refactor share-button to use DropdownMenu + CopyButton primitives
- Refactor invite-friends to use Input + CopyButton primitives
- Refactor referral-leaderboard to use Button primitive
- Replace inline star in event-detail-content with Rating primitive
- Add use-toast hook (sonner wrapper)
- Add use-memory-pressure hook (Pressure Observer + deviceMemory fallback)
- Add fallback-chain utility (cascading data source pattern)

https://claude.ai/code/session_01VoNT9jtzVApFrV1ahA6pgz
…wiring

Phase 1-2: Critical security fixes
- Fix SQL injection in payments webhook (parameterized queries + status whitelist)
- Fix authorization bypass in registrations (JWT auth instead of body.user_id)
- Add audit logging to event deletion and cancellation
- Add payment amount validation and env var checks

Phase 3: HTTP security headers
- Add X-Content-Type-Options, X-Frame-Options, Referrer-Policy, HSTS,
  Permissions-Policy, X-DNS-Prefetch-Control to next.config.ts

Phase 4: Accessibility
- Add prefers-reduced-motion media query to globals.css
- Add role="alert" to error boundary for screen reader announcements
- Replace raw button in error boundary with Button primitive

Phase 5: SEO
- Add page-level metadata to about, privacy, terms, events pages
- Add layout.tsx metadata for client pages (search, my-events, profile, calendar, help)
- Fix hardcoded JSON-LD eventStatus to use dynamic event status

Phase 6: Registry primitive wiring (46 instances across 21 files)
- Modals: capacity, category, date-time, description, location, ticketing
- Prompts: name, interests, location
- Pages: search, profile, profile/edit, help, home-client, events-client,
  my-events, event-actions
- Admin: events, users, support
- UI: theme-toggle, ai-description-wizard, event-ratings

All raw <button>, <input>, <textarea> replaced with Button, Input, Textarea,
Label, Switch primitives from @/components/ui/.

https://claude.ai/code/session_01VoNT9jtzVApFrV1ahA6pgz
@bryanfawcett bryanfawcett merged commit 8f0a07b into main Mar 25, 2026
16 checks passed
@bryanfawcett bryanfawcett deleted the claude/add-claude-documentation-Kwmpp branch March 25, 2026 23:19
bryanfawcett pushed a commit that referenced this pull request Apr 9, 2026
#16: FilterBar scroll affordance - edge fade gradients that appear
     when content overflows left/right (ResizeObserver + scroll listener)
#17: Search result images use lazy loading (img loading="lazy" instead
     of inline background-url CSS)
#32: FAQ open state persisted to localStorage, restored on page load
#35: Signage auto-refresh pause/resume toggle button (pause/play icons)
#36: Calendar month/year quick-select dropdowns replace plain heading
#37: Admin pagination page number buttons (up to 5 visible pages with
     sliding window) for both events and users tables
#38: Admin sidebar shows all nav items - inaccessible ones greyed out
     with lock icon and "Requires X role" tooltip instead of hidden
#39: Cmd+K / Ctrl+K keyboard shortcut navigates to /search from anywhere

https://claude.ai/code/session_01GBDmHPeMz4FCeN4fn5Ujnx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants