Convert an existing Figma design into a fully-functional subscription-cancellation flow for Migrate Mate. This challenge tests your ability to implement pixel-perfect UI, handle complex business logic, and maintain security best practices.
Implement the Figma-designed cancellation journey exactly on mobile + desktop, persist outcomes securely, and instrument the A/B downsell logic.
This repository contains:
- ✅ Next.js + TypeScript + Tailwind scaffold
- ✅
seed.sql
with users table (25/29 USD plans) and empty cancellations table - ✅ Local Supabase configuration for development
- ✅ Basic Supabase client setup in
src/lib/supabase.ts
- Next.js with App Router
- React with TypeScript
- Tailwind CSS for styling
- Supabase (Postgres + Row-Level Security)
Alternative stacks allowed if your solution:
- Runs with
npm install && npm run dev
- Persists to a Postgres-compatible database
- Enforces table-level security
- Implement the exact cancellation journey from provided Figma
- Ensure pixel-perfect fidelity on both mobile and desktop
- Handle all user interactions and state transitions
- On first entry: Assign variant via cryptographically secure RNG
- Persist variant to
cancellations.downsell_variant
field - Reuse variant on repeat visits (never re-randomize)
Variant A: No downsell screen Variant B: Show "$10 off" offer
- Price $25 → $15, Price $29 → $19
- Accept → Log action, take user back to profile page (NO ACTUAL PAYMENT PROCESSING REQUIRED)
- Decline → Continue to reason selection in flow
- Mark subscription as
pending_cancellation
in database - Create cancellation record with:
user_id
downsell_variant
(A or B)reason
(from user selection)accepted_downsell
(boolean)created_at
(timestamp)
- Row-Level Security (RLS) policies
- Input validation on all user inputs
- CSRF/XSS protection
- Secure handling of sensitive data
npm run db:setup
creates schema and seed data (local development)- Clear documentation for environment setup
- Payment processing - Stub with comments only
- User authentication - Use mock user data
- Email notifications - Not required
- Analytics tracking - Focus on core functionality
- Clone this repository
git clone [repo]
- Install dependencies:
npm install
- Set up local database:
npm run db:setup
- Start development:
npm run dev
The seed.sql
file provides a starting point with:
users
table with sample userssubscriptions
table with $25 and $29 planscancellations
table (minimal structure - you'll need to expand this)- Basic RLS policies (enhance as needed)
The current cancellations
table is intentionally minimal. You'll need to:
- Analyze the cancellation flow requirements from the Figma design
- Design appropriate table structure(s) to capture all necessary data
- Consider data validation, constraints, and relationships
- Ensure the schema supports the A/B testing requirements
- Functionality (40%): Feature completeness and correctness
- Code Quality (25%): Clean, maintainable, well-structured code
- Pixel/UX Fidelity (15%): Accuracy to Figma design
- Security (10%): Proper RLS, validation, and protection
- Documentation (10%): Clear README and code comments
- Working implementation in this repository
- NEW One-page README.md (replace this) (≤600 words) explaining:
- Architecture decisions
- Security implementation
- A/B testing approach
- Clean commit history with meaningful messages
Submit your solution within 72 hours of receiving this repository.
Using Cursor, ChatGPT, Copilot, etc. is encouraged. Use whatever accelerates your development—just ensure you understand the code and it runs correctly.
Review the challenge requirements carefully. If you have questions about specific implementation details, make reasonable assumptions and document them in your README.
Good luck! We're excited to see your implementation.