import React, { useMemo, useState } from "react"; import { createRoot } from "react-dom/client"; import { motion } from "framer-motion"; import { Activity, Award, BarChart3, Bell, CalendarDays, CheckCircle2, ChevronRight, CircleUserRound, CloudUpload, Download, ExternalLink, FileBadge, FileCheck2, FileDown, GraduationCap, LayoutDashboard, Lock, Mail, Menu, Moon, PenLine, Phone, QrCode, Search, Settings, ShieldCheck, Sparkles, Sun, Trash2, UserPlus, Users, XCircle } from "lucide-react"; import "./styles.css"; const students = [ { id: 1, studentName: "Gadela Haarshithamai", email: "haarshithamai@college.edu", mobile: "+91 98765 43210", collegeName: "Aurora Institute of Technology", course: "B.Tech CSE", photo: "https://images.unsplash.com/photo-1500648767791-00dcc994a43e?auto=format&fit=crop&w=320&q=80", internshipDomain: "AI & Animation", projectName: "AI Animated Short Film", startDate: "2024-02-01", endDate: "2024-06-30", duration: "5 Months", mentorName: "Picmkr Academy Team", attendance: 92, status: "Verified", mode: "Online", internshipId: "PICINT24058", certificateId: "PIC-INT-2024-058", issueDate: "2024-07-01" }, { id: 2, studentName: "Likhith R", email: "likhith.r@college.edu", mobile: "+91 90000 11223", collegeName: "Sree Vidyanikethan Engineering College", course: "B.Des Animation", photo: "https://images.unsplash.com/photo-1507591064344-4c6ce005b128?auto=format&fit=crop&w=320&q=80", internshipDomain: "Generative AI Design", projectName: "AI Product Poster Generator", startDate: "2024-03-10", endDate: "2024-06-10", duration: "3 Months", mentorName: "A. Sharma", attendance: 88, status: "Verified", mode: "Offline", internshipId: "PICINT24057", certificateId: "PIC-INT-2024-057", issueDate: "2024-06-15" }, { id: 3, studentName: "Ananya S", email: "ananya.s@college.edu", mobile: "+91 94444 22110", collegeName: "Vignan University", course: "B.Sc Visual Effects", photo: "https://images.unsplash.com/photo-1494790108377-be9c29b29330?auto=format&fit=crop&w=320&q=80", internshipDomain: "3D Animation", projectName: "Character Rigging Studio", startDate: "2024-01-15", endDate: "2024-05-15", duration: "4 Months", mentorName: "K. Reddy", attendance: 95, status: "Verified", mode: "Online", internshipId: "PICINT24056", certificateId: "PIC-INT-2024-056", issueDate: "2024-05-20" }, { id: 4, studentName: "Karthik M", email: "karthik.m@college.edu", mobile: "+91 81234 55667", collegeName: "Narayana College", course: "BCA", photo: "https://images.unsplash.com/photo-1506794778202-cad84cf45f1d?auto=format&fit=crop&w=320&q=80", internshipDomain: "Motion Graphics", projectName: "Brand Motion Identity", startDate: "2023-08-01", endDate: "2023-10-30", duration: "3 Months", mentorName: "Picmkr Academy Team", attendance: 61, status: "Invalid", mode: "Online", internshipId: "PICINT24055", certificateId: "PIC-INT-2024-055", issueDate: "2023-11-02" } ]; const certificates = [ "Internship Certificate", "Completion Certificate", "Recommendation Letter" ]; const PHP_API_BASE = "/api"; const PHP_ADMIN_TOKEN = "picmkr-admin-token-change-this"; function cn(...classes) { return classes.filter(Boolean).join(" "); } function phpRecordToStudent(record) { if (!record?.student || !record?.certificate) { return null; } const { student, certificate } = record; return { id: student.id, studentName: student.student_name, email: student.email, mobile: student.mobile, collegeName: student.college_name, course: student.course, photo: student.photo || "https://images.unsplash.com/photo-1500648767791-00dcc994a43e?auto=format&fit=crop&w=320&q=80", internshipDomain: student.internship_domain, projectName: student.project_name, startDate: student.start_date, endDate: student.end_date, duration: calculateDuration(student.start_date, student.end_date), mentorName: student.mentor_name, attendance: Number(student.attendance || 0), status: certificate.verification_status || "Verified", mode: student.mode || "Online", internshipId: certificate.internship_id, certificateId: certificate.certificate_id, issueDate: certificate.issue_date }; } function studentToPhpPayload(record) { return { student_name: record.studentName, photo: record.photo, email: record.email, mobile: record.mobile, college_name: record.collegeName, course: record.course, internship_domain: record.internshipDomain, project_name: record.projectName, start_date: record.startDate, end_date: record.endDate, mentor_name: record.mentorName, attendance: record.attendance, status: "completed", mode: record.mode, certificate_id: record.certificateId, internship_id: record.internshipId, issue_date: record.issueDate, verification_status: record.status }; } function Logo({ compact = false, light = false }) { return (
{!compact && (
PICMKR
AI & ANIMATION
ACADEMY
)}
); } function CircuitField() { return (
{Array.from({ length: 22 }).map((_, i) => ( ))} {Array.from({ length: 28 }).map((_, i) => ( ))}
); } function ShieldVisual() { return (
); } function Nav({ page, setPage, dark, setDark }) { const [open, setOpen] = useState(false); const items = [ ["home", "Home"], ["verify", "Verify Certificate"], ["student", "Student Login"], ["admin", "Admin"], ["college", "For Colleges"], ["support", "Contact Us"] ]; return (
{open && (
{items.map(([key, label]) => ( ))}
)}
); } function FeatureStrip() { const features = [ [ShieldCheck, "100% Verified", "Authentic & Secure"], [Activity, "Instant Verification", "Quick & Reliable"], [QrCode, "QR Code Enabled", "Scan & Verify"], [Lock, "Trusted by Colleges", "Reliable & Transparent"] ]; return (
{features.map(([Icon, title, text]) => (
{title}
{text}
))}
); } function Home({ setPage }) { return (

Verify Internship Certificates Instantly

Authentic internship records issued by Picmkr AI & Animation Academy.

{[ ["Email Verification", "Students and colleges can confirm records through verified email trails."], ["QR Tamper Protection", "Certificate IDs resolve to locked verification URLs with audit tracking."], ["College Access", "Placement cells can validate batches, exports, and internship outcomes."] ].map(([title, text]) => (

{title}

{text}

))}
); } function Field({ label, placeholder, icon: Icon, value, onChange, type = "text" }) { return ( ); } function StatusBadge({ status }) { const map = { Verified: "bg-green-100 text-green-700 dark:bg-green-500/15 dark:text-green-300", Invalid: "bg-red-100 text-red-700 dark:bg-red-500/15 dark:text-red-300", Expired: "bg-amber-100 text-amber-700 dark:bg-amber-500/15 dark:text-amber-300" }; return {status === "Verified" ? : status === "Invalid" ? : }{status}; } function QrArt() { const active = [0, 1, 3, 5, 7, 8, 10, 13, 15, 16, 18, 19, 21, 24, 26, 27, 29, 31, 33, 34, 36, 39, 41, 43, 45, 48, 49, 52, 53, 55, 57, 59, 61, 62, 63, 65, 68, 70, 72, 74, 76, 78, 80]; return (
{Array.from({ length: 81 }).map((_, index) => (
))}
); } function Verification({ initialResult = false, records = students }) { const [internshipId, setInternshipId] = useState("PICINT24058"); const [certificateId, setCertificateId] = useState("PIC-INT-2024-058"); const [email, setEmail] = useState(""); const [result, setResult] = useState(initialResult ? records[0] : null); const verify = async () => { const match = records.find((student) => { const idsMatch = student.internshipId.toLowerCase() === internshipId.toLowerCase().trim() || student.certificateId.toLowerCase() === certificateId.toLowerCase().trim(); const emailMatch = !email || student.email.toLowerCase() === email.toLowerCase().trim(); return idsMatch && emailMatch; }); if (match) { setResult(match); return; } try { const response = await fetch(`${PHP_API_BASE}/verify-certificate.php`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ internshipId, certificateId, email }) }); const data = await response.json(); const phpMatch = phpRecordToStudent(data); setResult(phpMatch || { ...students[0], studentName: "Certificate Not Found", status: "Invalid" }); } catch { setResult({ ...students[0], studentName: "Certificate Not Found", status: "Invalid" }); } }; return (

Verify Certificate

Enter certificate details to verify authenticity.

Why Verify?

Ensure authenticity Prevent fraud Trusted and secure
); } function ResultCard({ student, muted = false }) { const statusText = student.status === "Verified" ? "This certificate is valid and issued by Picmkr AI & Animation Academy." : "This certificate could not be validated by the Picmkr records system."; return (

Certificate Verification Result

Your certificate has been checked against official records.

{student.status === "Verified" ? "VERIFIED" : student.status.toUpperCase()}

{statusText}

{student.studentName}

{student.studentName}

Internship in {student.internshipDomain}

Picmkr AI & Animation Academy {formatDate(student.startDate)} to {formatDate(student.endDate)} ({student.duration}) {student.projectName}
{student.mode}
Scan to Verify
{student.certificateId}
); } function Info({ label, value, strong }) { return (
{label} : {value}
); } function formatDate(value) { return new Intl.DateTimeFormat("en-IN", { day: "2-digit", month: "short", year: "numeric" }).format(new Date(value)); } function Sidebar({ active, setActive, dark = false, admin = false }) { const items = admin ? [ [LayoutDashboard, "Dashboard"], [Users, "Students"], [Award, "Certificates"], [FileCheck2, "Verification Records"], [FileDown, "Reports"], [BarChart3, "Analytics"], [Settings, "Settings"] ] : [ [LayoutDashboard, "Dashboard"], [CircleUserRound, "Profile"], [GraduationCap, "My Internship"], [Award, "Certificates"], [Activity, "Attendance"], [Mail, "Messages"], [Settings, "Settings"] ]; return ( ); } function Ring({ value, label, color = "#FF7A00" }) { const angle = `${value * 3.6}deg`; return (
{value}%
{label}
); } function StudentDashboard() { const [active, setActive] = useState("Dashboard"); const student = students[0]; return (

Welcome Back, {student.studentName}

Your internship records and certificates are ready.

{student.studentName}

{student.duration} Internship

Great Performance

Contact the Picmkr support team for certificate or login assistance.

{certificates.map((name) => (

{name}

Issued on {formatDate(student.issueDate)}

))}
); } function DashboardCard({ title, children, className }) { return (

{title}

{children}
); } function InfoLine({ label, value }) { return (
{label}
{value}
); } function AdminInput({ label, value, onChange, type = "text", placeholder, required = false }) { return ( ); } function AdminSelect({ label, value, onChange, options }) { return ( ); } function calculateDuration(startDate, endDate) { if (!startDate || !endDate) { return "Internship"; } const start = new Date(startDate); const end = new Date(endDate); const months = Math.max(1, Math.round((end - start) / (1000 * 60 * 60 * 24 * 30))); return `${months} Month${months > 1 ? "s" : ""}`; } const emptyCertificateForm = { studentName: "", email: "", mobile: "", collegeName: "", course: "", photo: "", internshipDomain: "", projectName: "", startDate: "", endDate: "", duration: "", mentorName: "", attendance: "90", status: "Verified", mode: "Online", internshipId: "", certificateId: "", issueDate: "" }; function AdminDashboard({ records = students, onAddCertificate }) { const [active, setActive] = useState("Dashboard"); const [query, setQuery] = useState(""); const [form, setForm] = useState(emptyCertificateForm); const [savedMessage, setSavedMessage] = useState(""); const filtered = useMemo(() => records.filter((student) => `${student.studentName} ${student.certificateId} ${student.internshipDomain}`.toLowerCase().includes(query.toLowerCase())), [records, query]); const statCards = [ ["Total Certificates", String(records.length), "Live records"], ["Verified Today", "86", "+8% this month"], ["Active Interns", String(records.filter((record) => record.status !== "Expired").length), "Currently valid"], ["Completed Interns", String(records.filter((record) => record.status === "Verified").length), "Verified records"] ]; const updateForm = (key, value) => { setForm((current) => ({ ...current, [key]: value })); }; const submitCertificate = async (event) => { event.preventDefault(); const record = { id: Date.now(), ...form, photo: form.photo || "https://images.unsplash.com/photo-1500648767791-00dcc994a43e?auto=format&fit=crop&w=320&q=80", attendance: Number(form.attendance || 0), duration: form.duration || calculateDuration(form.startDate, form.endDate) }; try { const response = await fetch(`${PHP_API_BASE}/add-certificate.php`, { method: "POST", headers: { "Content-Type": "application/json", Authorization: `Bearer ${PHP_ADMIN_TOKEN}` }, body: JSON.stringify(studentToPhpPayload(record)) }); const data = await response.json(); if (!response.ok) { throw new Error(data.message || "Unable to save certificate"); } const savedRecord = phpRecordToStudent(data) || record; onAddCertificate(savedRecord); setForm(emptyCertificateForm); setSavedMessage(`${savedRecord.studentName} can now verify using ${savedRecord.certificateId}.`); return; } catch { setSavedMessage("Saved locally. Upload to PHP hosting to save in MySQL."); } onAddCertificate(record); setForm(emptyCertificateForm); }; return (

Admin Dashboard

Secure certificate operations, analytics, and audit records.

Admin
Super Admin
Admin
{statCards.map(([label, value, trend]) => (

{label}

{value}

{trend}

))}

Verification Overview

{[0, 1, 2, 3, 4].map((line) => ( ))}

Recent Verifications

{records.slice(0, 4).map((student, index) => (
{student.studentName}
{student.studentName}
{student.certificateId}
{index ? `${index * 15} mins ago` : "2 mins ago"}
))}

Add Certificate Record

Create the student and certificate details used by the public verification form.

{savedMessage && {savedMessage}}
updateForm("studentName", value)} required /> updateForm("email", value)} type="email" required /> updateForm("mobile", value)} /> updateForm("collegeName", value)} required /> updateForm("course", value)} /> updateForm("photo", value)} /> updateForm("internshipDomain", value)} required /> updateForm("projectName", value)} required /> updateForm("mentorName", value)} required /> updateForm("startDate", value)} type="date" required /> updateForm("endDate", value)} type="date" required /> updateForm("issueDate", value)} type="date" required /> updateForm("internshipId", value)} required /> updateForm("certificateId", value)} required /> updateForm("duration", value)} placeholder="Auto, or e.g. 3 Months" /> updateForm("attendance", value)} type="number" required /> updateForm("mode", value)} options={["Online", "Offline"]} /> updateForm("status", value)} options={["Verified", "Invalid", "Expired"]} />

Student Management

{filtered.map((student) => ( ))}
Student Internship ID Certificate ID Domain Status Actions
{student.studentName} {student.internshipId} {student.certificateId} {student.internshipDomain}

Quick Actions

{[ [UserPlus, "Add Student"], [FileBadge, "Generate Certificate"], [CloudUpload, "Upload Certificate"], [FileDown, "Export Reports"] ].map(([Icon, label]) => ( ))}
); } function SimplePage({ title, text, icon: Icon, children }) { return (

{title}

{text}

{children}
); } function LoginPage({ admin = false }) { return (

{admin ? "Secure Admin Login" : "Student Login"}

{admin ? "Manage records, certificate IDs, QR codes, reports, and audit logs." : "Access profile, internship details, attendance, and downloadable certificates."}

{}} type="email" /> {}} type="password" />

JWT authentication, encrypted student data, admin role management, and audit logs are planned for backend integration.

); } function App() { const [page, setPage] = useState("home"); const [dark, setDark] = useState(false); const [records, setRecords] = useState(() => { try { const saved = localStorage.getItem("picmkrCertificateRecords"); return saved ? JSON.parse(saved) : students; } catch { return students; } }); const addCertificateRecord = (record) => { setRecords((currentRecords) => { const withoutDuplicate = currentRecords.filter( (item) => item.certificateId.toLowerCase() !== record.certificateId.toLowerCase() && item.internshipId.toLowerCase() !== record.internshipId.toLowerCase() ); const nextRecords = [record, ...withoutDuplicate]; localStorage.setItem("picmkrCertificateRecords", JSON.stringify(nextRecords)); return nextRecords; }); }; const content = { home: , verify: , result: , student: , admin: , college: (
{["Batch Verification", "CSV/PDF Reports", "Email Verification"].map((item) => (
{item}
))}
), support: (
) }; return (
); } createRoot(document.getElementById("root")).render();