
Building an AI-Powered UPSC Platform with Next.js 15, Supabase & Gemini 3 Flash
Why We Built Vaidra Over a million students attempt India's UPSC Civil Services Exam every year. Most lack access to quality coaching. We built Vaidra — a free, AI-powered platform to democratize UPSC preparation. ## Tech Stack Frontend: Next.js 15 + React 19 (App Router, Server Components) Styling: Tailwind CSS + Framer Motion (spring physics animations) Backend: Self-hosted Supabase (PostgreSQL 15.8) on VPS AI: Google Gemini 3 Flash with native structured output ( responseSchema ) Payments: Razorpay Maps: Mapbox GL Hosting: Vercel + VPS (PM2 cluster, 8 instances) ## Architecture Decisions That Matter ### Event-First Data Architecture Every user action is logged as an immutable event in user_events . This is our single source of truth. We never UPDATE or DELETE events — append only. typescript // Step 1: Log event FIRST (must succeed) const { data: event } = await supabase .from('user_events') .insert({ user_id: userId, event_type: 'test_completed', event_data: { score, time_taken } }
Continue reading on Dev.to React
Opens in a new tab


