|
| 1 | +import { NextResponse } from "next/server"; |
| 2 | +import { createClient } from "@supabase/supabase-js"; |
| 3 | + |
| 4 | +export const runtime = 'nodejs'; |
| 5 | + |
| 6 | +function getSupabaseClient() { |
| 7 | + return createClient( |
| 8 | + process.env.NEXT_PUBLIC_SUPABASE_URL!, |
| 9 | + process.env.SUPABASE_SERVICE_ROLE_KEY! |
| 10 | + ); |
| 11 | +} |
| 12 | + |
| 13 | +const REAL_MENTORS = [ |
| 14 | + { |
| 15 | + first_name: "Deepak", |
| 16 | + last_name: "Pandey", |
| 17 | + email: "deepak@codeunia.com", |
| 18 | + phone: "", |
| 19 | + location: "India", |
| 20 | + occupation: "Founder & Tech Lead", |
| 21 | + company: "Codeunia", |
| 22 | + experience: "Full-stack engineer turned founder. Built Codeunia's platform from the ground up. Deep experience in scaling ed-tech products and engineering teams.", |
| 23 | + expertise: "Full Stack Development, System Architecture, Startup Engineering, Product Strategy", |
| 24 | + linkedin: "https://www.linkedin.com/in/848deepak/", |
| 25 | + expertise_areas: ["system-design", "web-development", "cloud-computing"], |
| 26 | + mentoring_types: ["career-advice", "project-guidance", "system-design"], |
| 27 | + availability: "flexible", |
| 28 | + commitment: "occasional", |
| 29 | + motivation: "Helping developers bridge the gap between coding tutorials and building production-ready software.", |
| 30 | + previous_mentoring: "Guided 100+ students in their transition to professional software engineering roles.", |
| 31 | + teaching_style: "Focus on first principles and architectural thinking.", |
| 32 | + status: "approved" |
| 33 | + }, |
| 34 | + { |
| 35 | + first_name: "Parisha", |
| 36 | + last_name: "Sharma", |
| 37 | + email: "parisha@codeunia.com", |
| 38 | + phone: "", |
| 39 | + location: "India", |
| 40 | + occupation: "Co-Founder & Operations Lead", |
| 41 | + company: "Codeunia", |
| 42 | + experience: "Specialist in tech operations and team dynamics. Expert in helping developers navigate their career paths, negotiate offers, and build leadership skills.", |
| 43 | + expertise: "Tech Management, Career Strategy, Soft Skills, Agile Methodologies", |
| 44 | + linkedin: "https://www.linkedin.com/in/parishasharma93/", |
| 45 | + expertise_areas: ["ui-ux", "project-management"], // Mapped to closest available or generic |
| 46 | + mentoring_types: ["career-advice", "interview-prep", "one-on-one"], |
| 47 | + availability: "weekends", |
| 48 | + commitment: "regular", |
| 49 | + motivation: "Ensuring developers have the soft skills and strategic mindset needed to succeed in the industry.", |
| 50 | + previous_mentoring: "Career coach for early-stage professionals.", |
| 51 | + teaching_style: "Empathetic, structured, and goal-oriented coaching.", |
| 52 | + status: "approved" |
| 53 | + }, |
| 54 | + { |
| 55 | + first_name: "Akshay", |
| 56 | + last_name: "Kumar", |
| 57 | + email: "akshay.allen26200@gmail.com", |
| 58 | + phone: "", |
| 59 | + location: "India", |
| 60 | + occupation: "Web Development Lead", |
| 61 | + company: "Codeunia", |
| 62 | + experience: "Senior Frontend Engineer with a focus on performance and user experience. Architected the core learning platform using Next.js and React Server Components.", |
| 63 | + expertise: "Advanced React, Next.js, Frontend Architecture, Web Performance", |
| 64 | + linkedin: "https://www.linkedin.com/in/akshaykumar0611/", |
| 65 | + expertise_areas: ["web-development", "ui-ux", "system-design"], |
| 66 | + mentoring_types: ["code-reviews", "project-guidance", "one-on-one"], |
| 67 | + availability: "evenings", |
| 68 | + commitment: "intensive", |
| 69 | + motivation: "Passionate about writing clean, maintainable code and teaching modern web standards.", |
| 70 | + previous_mentoring: "Lead code reviewer and technical mentor for Codeunia interns.", |
| 71 | + teaching_style: "Hands-on pair programming and detailed code reviews.", |
| 72 | + status: "approved" |
| 73 | + } |
| 74 | +]; |
| 75 | + |
| 76 | +export async function GET() { |
| 77 | + const supabase = getSupabaseClient(); |
| 78 | + |
| 79 | + // 1. Delete existing mentors to reset data |
| 80 | + const { error: deleteError } = await supabase |
| 81 | + .from("mentor_applications") |
| 82 | + .delete() |
| 83 | + .neq("id", "00000000-0000-0000-0000-000000000000"); |
| 84 | + |
| 85 | + if (deleteError) { |
| 86 | + return NextResponse.json({ error: deleteError.message }, { status: 500 }); |
| 87 | + } |
| 88 | + |
| 89 | + // 2. Insert refined mentors |
| 90 | + const { data, error } = await supabase |
| 91 | + .from("mentor_applications") |
| 92 | + .insert(REAL_MENTORS) |
| 93 | + .select(); |
| 94 | + |
| 95 | + if (error) { |
| 96 | + return NextResponse.json({ error: error.message }, { status: 500 }); |
| 97 | + } |
| 98 | + |
| 99 | + return NextResponse.json({ success: true, count: data.length, data }); |
| 100 | +} |
0 commit comments