You are VibeCoder — a full-stack production AI that builds modern, mobile-first, privacy-respecting web apps. Build a complete dating website called **SparkMeet** aimed at **Gen Z (ages 18–26)**. The deliverable must be a production-ready, accessible, performant, and secure full-stack app (frontend + backend + database + infra + tests + documentation). Use modern tech: React + TypeScript (Next.js recommended for SSR/edge), Tailwind CSS for styling, Prisma or an ORM for DB, PostgreSQL (or Supabase/PlanetScale), Redis for caching & rate limits, WebSocket (or Supabase Realtime) for chat, S3 (or equivalent) for images. Provide a runnable repo layout, README, and end-to-end tests.
eb66d76
verified
| ```html | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Discovery - SparkMeet</title> | |
| <script src="https://cdn.tailwindcss.com"></script> | |
| <script src="https://unpkg.com/feather-icons"></script> | |
| <script src="https://cdn.jsdelivr.net/npm/animejs/lib/anime.iife.min.js"></script> | |
| <style> | |
| .gradient-bg { | |
| background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); | |
| } | |
| .btn-primary { | |
| background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); | |
| } | |
| .btn-primary:hover { | |
| background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%); | |
| } | |
| .profile-card { | |
| transition: all 0.3s ease; | |
| cursor: grab; | |
| } | |
| .profile-card:active { | |
| cursor: grabbing; | |
| } | |
| .swipe-left { | |
| transform: translateX(-150%) rotate(-30deg); | |
| opacity: 0; | |
| } | |
| .swipe-right { | |
| transform: translateX(150%) rotate(30deg); | |
| opacity: 0; | |
| } | |
| .swipe-up { | |
| transform: translateY(-150%) scale(0.8); | |
| opacity: 0; | |
| } | |
| .match-modal { | |
| backdrop-filter: blur(10px); | |
| } | |
| .spark-animation { | |
| animation: sparkle 1.5s ease-in-out infinite; | |
| } | |
| @keyframes sparkle { | |
| 0%, 100% { transform: scale(1) rotate(0deg); } | |
| 50% { transform: scale(1.2) rotate(180deg); } | |
| } | |
| .action-button { | |
| transition: all 0.2s ease; | |
| box-shadow: 0 4px 15px rgba(0,0,0,0.1); | |
| } | |
| .action-button:hover { | |
| transform: scale(1.1); | |
| box-shadow: 0 8px 25px rgba(0,0,0,0.15); | |
| } | |
| .action-button:active { | |
| transform: scale(0.95); | |
| } | |
| </style> | |
| </head> | |
| <body class="bg-gray-50 font-sans"> | |
| <!-- Navigation --> | |
| <nav class="bg-white shadow-sm sticky top-0 z-40"> | |
| <div class="max-w-6xl mx-auto px-4"> | |
| <div class="flex justify-between items-center py-3"> | |
| <a href="index.html" class="flex items-center space-x-2"> | |
| <span class="text-2xl font-bold bg-gradient-to-r from-purple-600 to-pink-500 bg-clip-text text-transparent">SparkMeet</span> | |
| </a> | |
| <div class="flex items-center space-x-4"> | |
| <button class="p-2 text-gray-600 hover:text-purple-600 rounded-full hover:bg-gray-100"> | |
| <i data-feather="filter" class="w-5 h-5"></i> | |
| </button> | |
| <button class="p-2 text-gray-600 hover:text-purple-600 rounded-full hover:bg-gray-100"> | |
| <i data-feather="message-circle" class="w-5 h-5"></i> | |
| </button> | |
| <button class="relative p-2 text-gray-600 hover:text-purple-600 rounded-full hover:bg-gray-100"> | |
| <i data-feather="bell" class="w-5 h-5"></i> | |
| <span class="absolute top-1 right-1 w-2 h-2 bg-red-500 rounded-full"></span> | |
| </button> | |
| <a href="profile-builder.html" class="w-8 h-8 rounded-full bg-gradient-to-r from-purple-400 to-pink-400 flex items-center justify-center text-white font-semibold"> | |
| A | |
| </a> | |
| </div> | |
| </div> | |
| </div> | |
| </nav> | |
| <!-- Main Discovery Area --> | |
| <div class="max-w-md mx-auto px-4 py-6"> | |
| <div class="relative h-[70vh] mb-6"> | |
| <!-- Profile Cards Stack --> | |
| <div id="card-stack" class="relative w-full h-full"> | |
| <!-- Card 1 --> | |
| <div class="profile-card absolute inset-0 bg-white rounded-2xl shadow-lg overflow-hidden" data-user-id="1"> | |
| <div class="relative h-3/4"> | |
| <img src="http://static.photos/people/640x360/123" alt="Sarah" class="w-full h-full object-cover"> | |
| <div class="absolute inset-0 bg-gradient-to-t from-black/60 via-transparent to-transparent"></div> | |
| <div class="absolute bottom-4 left-4 text-white"> | |
| <h3 class="text-2xl font-bold">Sarah, 22</h3> | |
| <p class="text-sm opacity-90">✨ Photography & Coffee</p> | |
| <div class="flex items-center mt-2 space-x-2"> | |
| <span class="px-2 py-1 bg-white/20 backdrop-blur rounded-full text-xs">Creative</span> | |
| <span class="px-2 py-1 bg-white/20 backdrop-blur rounded-full text-xs">Adventurous</span> | |
| </div> | |
| </div> | |
| <button class="info-btn absolute top-4 right-4 w-10 h-10 bg-white/20 backdrop-blur rounded-full flex items-center justify-center text-white hover:bg-white/30"> | |
| <i data-feather="info" class="w-5 h-5"></i> | |
| </button> | |
| </div> | |
| <div class="p-4"> | |
| <p class="text-gray-700 text-sm">"Capturing moments and chasing sunsets. Let's grab coffee and see where the conversation goes!"</p> | |
| </div> | |
| </div> | |
| <!-- Card 2 --> | |
| <div class="profile-card absolute inset-0 bg-white rounded-2xl shadow-lg overflow-hidden" data-user-id="2"> | |
| <div class="relative h-3/4"> | |
| <img src="http://static.photos/people/640x360/456" alt="Alex" class="w-full h-full object-cover"> | |
| <div class="absolute inset-0 bg-gradient-to-t from-black/60 via-transparent to-transparent"></div> | |
| <div class="absolute bottom-4 left-4 text-white"> | |
| <h3 class="text-2xl font-bold">Alex, 24</h3> | |
| <p class="text-sm opacity-90">🎵 Music & Hiking</p> | |
| <div class="flex items-center mt-2 space-x-2"> | |
| <span class="px-2 py-1 bg-white/20 backdrop-blur rounded-full text-xs">Musician</span> | |
| <span class="px-2 py-1 bg-white/20 backdrop-blur rounded-full text-xs">Outdoors</span> | |
| </div> | |
| </div> | |
| <button class="info-btn absolute top-4 right-4 w-10 h-10 bg-white/20 backdrop-blur rounded-full flex items-center justify-center text-white hover:bg-white/30"> | |
| <i data-feather="info" class="w-5 h-5"></i> | |
| </button> | |
| </div> | |
| <div class="p-4"> | |
| <p class="text-gray-700 text-sm">"Guitar, mountains, and good vibes. Looking for someone to share playlists and trail views."</p> | |
| </div> | |
| </div> | |
| <!-- Card 3 --> | |
| <div class="profile-card absolute inset-0 bg-white rounded-2xl shadow-lg overflow-hidden" data-user-id="3"> | |
| <div class="relative h-3/4"> | |
| <img src="http://static.photos/people/640x360/789" alt="Jordan" class="w-full h-full object-cover"> | |
| <div class="absolute inset-0 bg-gradient-to-t from-black/60 via-transparent to-transparent"></div> | |
| <div class="absolute bottom-4 left-4 text-white"> | |
| <h3 class="text-2xl font-bold">Jordan, 21</h3> | |
| <p class="text-sm opacity-90">🎮 Gaming & Tech</p> | |
| <div class="flex items-center mt-2 space-x-2"> | |
| <span class="px-2 py-1 bg-white/20 backdrop-blur rounded-full text-xs">Gamer</span> | |
| <span class="px-2 py-1 bg-white/20 backdrop-blur rounded-full text-xs">Techie</span> | |
| </div> | |
| </div> | |
| <button class="info-btn absolute top-4 right-4 w-10 h-10 bg-white/20 backdrop-blur rounded-full flex items-center justify-center text-white hover:bg-white/30"> | |
| <i data-feather="info" class="w-5 h-5"></i> | |
| </button> | |
| </div> | |
| <div class="p-4"> | |
| <p class="text-gray-700 text-sm">"Coding by day, gaming by night. Let's team up in life and in co-op games!"</p> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Action Buttons --> | |
| <div class="flex justify-center items-center space-x-6"> | |
| <button id="pass-btn" class="action-button w-16 h-16 bg-gray-200 rounded-full flex items-center justify-center text-gray-600 hover:bg-gray-300" aria-label="Pass"> | |
| <i data-feather="x" class="w-8 h-8"></i> | |
| </button> | |
| <button id="like-btn" class="action-button w-16 h-16 bg-red-500 rounded-full flex items-center justify-center text-white hover:bg-red-600" aria-label="Like"> | |
| <i data-feather="heart" class="w-8 h-8"></i> | |
| </button> | |
| <button id="superspark-btn" class="action-button w-16 h-16 bg-purple-500 rounded-full flex items-center justify-center text-white hover:bg-purple-600 relative" aria-label="Super Spark"> | |
| <i data-feather="zap" class="w-8 h-8 spark-animation"></i> | |
| <span class="absolute -top-1 -right-1 w-5 h-5 bg-yellow-400 rounded-full text-xs flex items-center justify-center font-bold">3</span> | |
| </button> | |
| </div> | |
| </div> | |
| <!-- Match Modal --> | |
| <div id="match-modal" class="match-modal fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden"> | |
| <div class="bg-white rounded-2xl max-w-sm w-full p-6 text-center relative overflow-hidden"> | |
| <div class="absolute inset-0 bg-gradient-to-r from-purple-400 to-pink-400 opacity-10"></div> | |
| <div class="relative z-10"> | |
| <div class="mx-auto flex items-center justify-center h-16 w-16 rounded-full bg-gradient-to-r from-purple-400 to-pink-400 mb-4"> | |
| <i data-feather="heart" class="h-8 w-8 text-white"></i> | |
| </div> | |
| <h2 class="text-2xl font-bold mb-2">It's a Match! 🔥</h2> | |
| <p class="text-gray-600 mb-6">You and Sarah both liked each other. Ready to spark a convo?</p> | |
| <div class="flex space-x-3"> | |
| <button id="send-message-btn" class="flex-1 px-6 py-3 bg-purple-600 text-white rounded-lg hover:bg-purple-700 transition-colors"> | |
| Send Message | |
| </button> | |
| <button id="keep-swiping-btn" class="flex-1 px-6 py-3 bg-gray-200 text-gray-700 rounded-lg hover:bg-gray-300 transition-colors"> | |
| Keep Swiping | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Profile Info Modal --> | |
| <div id="info-modal" class="match-modal fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden"> | |
| <div class="bg-white rounded-2xl max-w-sm w-full max-h-[80vh] overflow-y-auto"> | |
| <div class="p-6"> | |
| <div class="flex justify-between items-start mb-4"> | |
| <div> | |
| <h3 id="info-name" class="text-xl font-bold"></h3> | |
| <p id="info-bio" class="text-gray-600 mt-1"></p> | |
| </div> | |
| <button id="close-info-btn" class="text-gray-400 hover:text-gray-600"> | |
| <i data-feather="x" class="w-6 h-6"></i> | |
| </button> | |
| </div> | |
| <div id="info-details" class="space-y-3"> | |
| <!-- Dynamic content will be inserted here --> | |
| </div> | |
| <div class="mt-6 flex space-x-3"> | |
| <button class="flex-1 px-4 py-2 bg-purple-600 text-white rounded-lg hover:bg-purple-700 transition-colors"> | |
| <i data-feather="message-circle" class="w-4 h-4 inline mr-2"></i>Message | |
| </button> | |
| <button class="px-4 py-2 bg-gray-200 text-gray-700 rounded-lg hover:bg-gray-300 transition-colors"> | |
| <i data-feather="share" class="w-4 h-4"></i> | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <script> | |
| // Initialize Feather Icons | |
| feather.replace(); | |
| // Card stack management | |
| let currentCardIndex = 0; | |
| const cards = document.querySelectorAll('.profile-card'); | |
| const totalCards = cards.length; | |
| // Analytics tracking | |
| function trackEvent(eventName, properties = {}) { | |
| console.log('Analytics:', eventName, properties); | |
| // In production, send to Mixpanel/Amplitude | |
| } | |
| // Card interaction functions | |
| function handleSwipe(direction) { | |
| const currentCard = cards[currentCardIndex]; | |
| if (!currentCard) return; | |
| const userId = currentCard.dataset.userId; | |
| // Add swipe animation class | |
| currentCard.classList.add(`swipe-${direction}`); | |
| // Track event | |
| trackEvent(`discovery_${direction}`, { | |
| userId, | |
| method: direction === 'up' ? 'superspark' : direction | |
| }); | |
| // Remove card after animation | |
| setTimeout(() => { | |
| currentCard.style.display = 'none'; | |
| currentCardIndex++; | |
| // Check if we need to load more cards | |
| if (currentCardIndex >= totalCards) { | |
| // In production, load more profiles | |
| console.log('No more profiles to show'); | |
| } | |
| }, 300); | |
| // Check for match (simulated) | |
| if (direction === 'right' || direction === 'up') { | |
| setTimeout(() => { | |
| if (Math.random() > 0.7) { // 30% chance of match | |
| showMatchModal(); | |
| } | |
| }, 500); | |
| } | |
| } | |
| function showMatchModal() { | |
| const modal = document.getElementById('match-modal'); | |
| modal.classList.remove('hidden'); | |
| trackEvent('match_created', { matchId: 'match_123' }); | |
| // Animate match modal | |
| anime({ | |
| targets: '#match-modal > div', | |
| scale: [0.8, 1], | |
| opacity: [0, 1], | |
| duration: 500, | |
| easing: 'easeOutElastic(1, .5)' | |
| }); | |
| } | |
| function showInfoModal(card) { | |
| const modal = document.getElementById('info-modal'); | |
| const name = card.querySelector('h3').textContent; | |
| const bio = card.querySelector('p').textContent; | |
| const tags = Array.from(card.querySelectorAll('span')).map(span => span.textContent); | |
| document.getElementById('info-name').textContent = name; | |
| document.getElementById('info-bio').textContent = bio; | |
| const detailsHtml = ` | |
| <div class="flex flex-wrap gap-2 mb-4"> | |
| ${tags.map(tag => `<span class="px-3 py-1 bg-purple-100 text-purple-800 rounded-full text-sm">${tag}</span>`).join('')} | |
| </div> | |
| <div class="space-y-2 text-sm"> | |
| <div class="flex items-center"> | |
| <i data-feather="map-pin" class="w-4 h-4 mr-2 text-gray-400"></i> | |
| <span>2 miles away</span> | |
| </div> | |
| <div class="flex items-center"> | |
| <i data-feather="briefcase" class="w-4 h-4 mr-2 text-gray-400"></i> | |
| <span>Student at University</span> | |
| </div> | |
| <div class="flex items-center"> | |
| <i data-feather="music" class="w-4 h-4 mr-2 text-gray-400"></i> | |
| <span>Indie, Alternative</span> | |
| </div> | |
| </div> | |
| `; | |
| document.getElementById('info-details').innerHTML = detailsHtml; | |
| modal.classList.remove('hidden'); | |
| trackEvent('discovery_info_open', { userId: card.dataset.userId }); | |
| // Re-render feather icons in modal | |
| feather.replace(); | |
| } | |
| // Button event listeners | |
| document.getElementById('pass-btn').addEventListener('click', () => handleSwipe('left')); | |
| document.getElementById('like-btn').addEventListener('click', () => handleSwipe('right')); | |
| document.getElementById('superspark-btn').addEventListener('click', () => handleSwipe('up')); | |
| // Match modal buttons | |
| document.getElementById('send-message-btn').addEventListener('click', () => { | |
| trackEvent('profile_message_open', { matchId: 'match_123' }); | |
| window.location.href = 'chat.html?matchId=match_123'; | |
| }); | |
| document.getElementById('keep-swiping-btn').addEventListener('click', () => { | |
| document.getElementById('match-modal').classList.add('hidden'); | |
| }); | |
| // Info modal | |
| document.querySelectorAll('.info-btn').forEach(btn => { | |
| btn.addEventListener('click', (e) => { | |
| e.stopPropagation(); | |
| const card = btn.closest('.profile-card'); | |
| show |