You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Next.js Fullstack Supabase Multi-Step Form Automation System
🧾 Executive Summary
Enterprise-grade full-stack animated multi-step form automation system built with Next.js 16, TypeScript, and Framer Motion v12.
Handles structured multi-stage data collection, real-time field validation via React Hook Form, secure multi-file uploads to Supabase Storage, and automated email acknowledgments.
Features a fully animated 4-step wizard UI with directional slide transitions, bezier easing, animated progress indicators, pill-based multi-select components, dark/light theming, and a pre-submission review panel.
Designed for scalability, automation, and production deployment using Vercel.
Layer
Technology
Purpose
Frontend
Next.js 16 + TypeScript
UI rendering, routing & type safety
Animation
Framer Motion v12
Step transitions, presence animations & easing
Forms
React Hook Form
Validation, field registration & submission
Theming
next-themes + Tailwind CSS
Dark/light mode with CSS variable tokens
Backend
Next.js API Routes
Processing & email logic
Database
Supabase PostgreSQL
Structured data storage
Storage
Supabase Storage
Multi-file upload & retrieval
Email
Nodemailer + Gmail SMTP
Automated acknowledgment delivery
Icons
lucide-react
UI iconography (Sun, Moon, Check, Chevrons)
📑 Table of Contents
🧩 Project Overview
🎯 Objectives & Goals
✅ Acceptance Criteria
💻 Prerequisites
⚙️ Installation & Setup
🔗 API Documentation
🖥️ UI / Frontend
🔢 Status Codes
🚀 Features
🧱 Tech Stack & Architecture
🛠️ Workflow & Implementation
🧪 Testing & Validation
🔍 Validation Summary
🧰 Verification Testing Tools
🧯 Troubleshooting & Debugging
🔒 Security & Secrets
☁️ Deployment and DevOps
⚡ Quick-Start Cheat Sheet
🧾 Usage Notes
🧠 Performance & Optimization
🌟 Enhancements & Features
🧩 Maintenance & Future Work
🏆 Project Milestones
🧮 High-Level Architecture
🗂️ Project Structure
🧭 How to Demonstrate Live
💡 Summary, Closure & Compliance
🧩 Project Overview
Animated multi-step public form-based intake system
Captures structured university participation data across 4 sequential steps
Validates all inputs in real time using React Hook Form with field-level error display
Uploads logos, headshots, brochures, and additional documents securely to Supabase Storage
Sends automated acknowledgment emails via Nodemailer SMTP
Supports dark and light mode with animated theme toggling
User → Animated 4-Step Form UI → React Hook Form Validation → API Route → Supabase DB + Storage → Email Service
🎯 Objectives & Goals
Enable seamless, guided multi-step form submissions with animated step transitions
Enforce real-time field validation and structured error feedback at each step
Automate backend workflows from submission to database insertion to email dispatch
1. Receive POST request at /api/send-email
2. Validate presence of required fields
3. Initialize Nodemailer transporter with Gmail SMTP credentials
4. Compose acknowledgment email with university and representative details
5. Dispatch email via SMTP
6. Return 200 on success or appropriate error code on failure
Non-Fatal Invocation
The email API is called as a best-effort, non-fatal side effect after successful
database insertion. A failure in email dispatch does not roll back or block the
form submission — the user is redirected to /thank-you regardless.
🖥️ UI / Frontend
Pages
/page.tsx → Entry point, renders the main Form component
/thank-you → Post-submission confirmation page with ThankYouContent component
- Track background rendered as absolute-positioned div
- Animated fill uses Framer Motion scaleX driven by (step - 1) / (totalSteps - 1)
- Each step node animates backgroundColor, borderColor, and boxShadow between states:
Active → blue (#0f62fe) with blue glow shadow
Complete → green (#22c55e) with green glow shadow
Inactive → CSS variable (--bg-card) / (--border)
- Completed nodes render animated Check icon via AnimatePresence
Directional Slide Transition System
- Direction state (dir) tracks +1 (forward) or -1 (backward)
- stepVariants object defines enter, center, and exit states
- Bezier easing typed as [number, number, number, number] tuple for framer-motion v12 compatibility
- AnimatePresence with mode="wait" ensures clean enter/exit sequencing
- Each step motion.div receives custom={dir} to pick directional offset
Dark / Light Theme Architecture
- ThemeProvider wraps the application via next-themes
- CSS custom properties (--bg-surface, --text-primary, --brand-primary, etc.) toggle per theme
- Theme toggle button uses AnimatePresence mode="wait" to swap Sun / Moon icons
- Mounted state guard prevents SSR hydration mismatch
State Flow
User Input → React Hook Form State + Custom State (phone, pills, files)
→ Per-Step trigger() Validation
→ Step Advance / Error Display
→ Final handleSubmit → Supabase Upload + DB Insert → Email API → Router Push
⬜ Admin panel for viewing, filtering, and exporting form submissions
⬜ Real-time analytics dashboard for submission volume and event popularity
⬜ AI-assisted field suggestions and programme highlight generation
⬜ Email template upgrade with HTML formatting and branding
⬜ Webhook integration for CRM or Slack notification on new submission
🧩 Maintenance & Future Work
Keep framer-motion, react-hook-form, next-themes, and lucide-react dependencies up to date — review changelogs for breaking animation API changes between major versions
Monitor Supabase Storage bucket usage and implement lifecycle policies for old submission files
Upgrade Nodemailer SMTP configuration to a transactional email provider (SendGrid, Resend, or AWS SES) for production-scale email delivery
Add unit tests for validation logic and integration tests for the Supabase insert pipeline
Implement structured logging and error monitoring (Sentry or Axiom) for production observability
Extend the submission payload schema to support additional recruitment data fields as requirements evolve
🏆 Project Milestones
✅ Initial project setup with Next.js, TypeScript, and Tailwind CSS
✅ Supabase PostgreSQL and Storage integration with RLS-enforced security
✅ React Hook Form integration with per-step field validation and inline errors
Toggle between dark and light mode using the theme button — observe the animated Sun/Moon icon swap
Complete Step 1: enter university name, upload a logo, and fill city/state/country
Complete Step 2: fill representative name, designation, email, phone, and optionally upload a headshot
Complete Step 3: select levels and events using the animated pill buttons; optionally select time slots
Observe the animated progress indicator advancing and completing nodes as you move through steps
On Step 4: upload a brochure, add remarks, and verify the live summary review card reflects your Step 1–3 entries
Check the consent checkbox and click Submit Confirmation — observe the loading spinner
Verify the inserted row in the Supabase Table Editor including arrays, file URLs, and metadata
Verify uploaded files appear in the Supabase Storage bucket under the UUID-namespaced folder
Confirm the acknowledgment email was received at the representative email address
💡 Summary, Closure & Compliance
System delivers a production-grade animated multi-step form automation pipeline from UI through database and email
All advanced UI interactions — step transitions, progress animation, pill selection, theme toggle, error banners — are powered by Framer Motion v12 with correct TypeScript tuple typing
React Hook Form provides robust per-step validation with inline error feedback; custom state guards cover phone and pill inputs outside RHF scope
Supabase integration covers both structured PostgreSQL storage and UUID-namespaced file storage with parallel upload optimization
Email automation is implemented as a best-effort, non-fatal side effect — submission integrity is never dependent on SMTP availability
Full TypeScript coverage enforced with zero type errors; EASE tuple pattern resolves framer-motion v12 BezierDefinition compatibility
Secure by design: RLS-enforced database, environment-secured secrets, UUID-isolated storage paths, and no server-side credentials exposed to the client
Compliant with modern Next.js App Router architecture, React 18 patterns, and Vercel deployment standards
Ready for enterprise-level enhancements including admin dashboard, AI-assisted validation, and transactional email provider upgrade
About
Production-ready animated multi-step university participation registration portal built with Next.js, TypeScript, and Framer Motion. Features Supabase-backed storage, React Hook Form validation, international phone input, multi-file uploads, dark/light theming, and automated acknowledgement emails — purpose-built for education event organizers.