CodeIssuesPull RequestsActionsSecurityInsights
✨ AI
More
Settings

Full architecture upgrade: Vercel Serverless + Engineering Quality Rules #3721

Merged⚡ AI-generatedXLccantynz wants to mergeclaude/identify-engineering-gaps-7DFa1mainopened Mar 24, 20260/7 tasks
ccantynzcommented Mar 24, 2026

Originally written by @ccantynz-alt on GitHub.
Imported from https://github.com/ccantynz-alt/Hibiscus-to-airport/pull/26


Summary

  • Retire the FastAPI backend on Render — no more cold starts, no second system to monitor, no CORS headaches
  • Create complete Vercel Serverless API (/api/) — all endpoints migrated to Node.js serverless functions on the same domain
  • Fix 17 engineering gaps including critical security issues (password reset expiry, HTML injection in emails, non-idempotent Stripe webhooks)
  • Add The 10 Rules + 23 Engineering Quality Rules to CLAUDE.md — locked in permanently so every AI session follows them
  • Add public ErrorBoundary — no more white screens when a component crashes

What changed

Area Before After
Backend FastAPI on Render (cold starts, separate deploy) Vercel Serverless Functions (same domain, instant)
Database driver asyncpg (connection pool, not serverless-friendly) @neondatabase/serverless (HTTP-based, built for serverless)
Scheduled jobs APScheduler (dies with backend) Vercel Cron Jobs (reliable, managed)
Email templates User input injected raw (HTML injection risk) All user input HTML-escaped
Password reset Token expiry never checked Token expiry validated before reset
Stripe webhook Could send duplicate emails Idempotent — checks if already paid
Error handling White screen on crash (public site) ErrorBoundary with friendly fallback + refresh button
API responses Inconsistent formats Standardised { ok, data, error }
Database No indexes Indexes on booking_ref, email, date, created_at, status, payment_status

New files

  • api/lib/ — shared modules (db, auth, email, sms, pricing, helpers)
  • api/bookings.js — booking create + list
  • api/bookings/[ref].js — get/update/delete booking
  • api/bookings/[id]/ — cancel, resend-email, resend-sms, duplicate, update-status
  • api/admin/ — login, change-password, reset-password, bookings list
  • api/stripe/ — create-session, webhook, payment-status
  • api/drivers.js, api/promo.js, api/seo.js — supporting endpoints
  • api/cron/reminders.js — day-before reminder (Vercel Cron)
  • api/healthz.js, api/init-schema.js — operations
  • ENGINEERING_GAPS_REPORT.md — full audit of all identified issues

Test plan

  • Verify Vercel deployment builds successfully
  • Test booking creation flow end-to-end
  • Test admin login and dashboard
  • Test Stripe payment flow
  • Verify day-before reminder cron fires correctly
  • Confirm no white screens on component errors (ErrorBoundary)
  • Verify all API endpoints return consistent { ok, data, error } format

https://claude.ai/code/session_01KHJok1schmw3Cwa3KRF1oq

ccantynzcommented Mar 24, 2026

Originally written by @vercel[bot] on GitHub.


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

Project Deployment Actions Updated (UTC)
hibiscus-to-airport Ready Ready Preview, Comment Mar 25, 2026 9:23pm

Request Review

Cross-repo impact

See what breaks downstream if this PR merges.

Analyze →
⮌ Merged

This pull request was merged into main.

c comment · e edit title · m merge · a approve · r request changes · ? shortcuts