import { supabase } from "@/lib/supabase"; import ScrollReveal from "@/components/ScrollReveal"; import Link from "next/link"; export default async function Home() { const recaptchaSiteKey = process.env.RECAPTCHA_SITE_KEY || ""; // Check if Supabase is actually configured const isDummy = (process.env.NEXT_PUBLIC_SUPABASE_URL || 'https://dummy.supabase.co') === 'https://dummy.supabase.co'; let settingsRows = null; let techStackRows = null; let projectRows = null; let certRows = null; let articleRows = null; if (!isDummy) { // Fetch Settings const resSettings = await supabase.from('settings').select('*').eq('id', 1).single(); settingsRows = resSettings.data; // Fetch Tech Stack const resTech = await supabase.from('techstack').select('tech_name').order('id', { ascending: true }); techStackRows = resTech.data; // Fetch Projects (Limit 3) const resProj = await supabase.from('projects').select('*').order('id', { ascending: false }).limit(3); projectRows = resProj.data; // Fetch Certifications (Limit 3) const resCert = await supabase.from('certifications').select('*').order('id', { ascending: false }).limit(3); certRows = resCert.data; // Fetch Articles (Limit 3) const resArt = await supabase.from('articles').select('*').order('id', { ascending: false }).limit(3); articleRows = resArt.data; } const settings = settingsRows || { about_text_1: 'I am a senior IT student majoring in Software Development. I write code to solve real-world problems.', about_text_2: 'My primary stack includes PHP, React, Node.js, and MySQL. I enjoy database design, front-end development, and bug fixing.', years_coding: '3+', projects_count: '10+', certifications_count: '6+', tiktok_url: 'https://www.tiktok.com/@crischarlesgarcia', facebook_url: 'https://facebook.com/kristyarls345', instagram_url: 'https://instagram.com/crischarlesgarcia', linkedin_url: 'https://www.linkedin.com/in/cris-charles-garcia-187415303', github_url: 'https://github.com/ssbg04' }; const techStack = techStackRows ? techStackRows.map(r => r.tech_name) : []; return ( <> {/* ===== HERO ===== */}
Available for work
Hi, I am Cris Charles Garcia.

Software Developer.

I am an IT student majoring in Software Development based in Laguna, Philippines. I focus on building reliable web applications.

My Projects โ†— Contact Me
Cris Charles Garcia Cris Charles Garcia Cris Charles Garcia Cris Charles Garcia
{/* ===== ABOUT ===== */}
About Me

About Me

{settings.about_text_1}

{settings.about_text_2}

Tech Stack

{techStack.length > 0 ? ( techStack.map((tech, index) => ( {tech} )) ) : (

No tech stack found.

)}
{settings.years_coding}
Years Coding
{settings.projects_count}
Projects Built
{settings.certifications_count}
Certifications
{/* ===== PROJECTS ===== */}
Projects

Recent Projects

{projectRows && projectRows.length > 0 ? projectRows.map((project, index) => (
{project.title}

{project.title}

โ†—

{project.des}

{project.techstack ? project.techstack.split(',').map((tag: string) => tag.trim()).map((tag: string, i: number) => ( {tag} )) : null}
)) :

No projects available.

}
All Projects โ†’
{/* ===== CERTIFICATIONS ===== */}
Certifications

My Certifications

{certRows && certRows.length > 0 ? certRows.map((cert, index) => (
{cert.icon || "๐Ÿ†"}

{cert.title}

{cert.issuer}

Issued {cert.date_issued}
)) :

No certifications available.

}
All Certifications โ†’
{/* ===== BLOG ===== */}
Articles

Latest Articles

{articleRows && articleRows.length > 0 ? articleRows.map((article, index) => (
{article.date_published} {article.tag && {article.tag}}

{article.title}

{article.excerpt}

Read Article โ†’
)) :

No articles available.

}
All Articles โ†’
{/* ===== TOAST NOTIFICATION ===== */}
{/* ===== CONTACT ===== */}
Contact

Get in Touch

Feel free to reach out if you have a project idea, a job opportunity, or any questions.

{settings.github_url && ( )} {settings.linkedin_url && ( )} {settings.facebook_url && ( )} {settings.instagram_url && ( )} {settings.tiktok_url && ( )}
{/* Compact reCAPTCHA badge */}
Protected by reCAPTCHA Privacy {" ยท "} Terms
re
CAPTCHA
{/* reCAPTCHA v3 Enterprise โ€” invisible */}