#!/usr/bin/env node /** * Add Test Portfolio Projects * This script adds sample portfolio projects to the database */ const { query } = require("./config/database"); async function addTestPortfolioProjects() { console.log("šŸŽØ Adding test portfolio projects...\n"); const testProjects = [ { title: "Sunset Landscape Series", description: `

A Beautiful Collection of Sunset Landscapes

This series captures the breathtaking beauty of sunsets across different landscapes. Each piece showcases unique color palettes ranging from warm oranges and reds to cool purples and blues.

Key Features:

Medium: Digital Art
Year: 2024
Collection: Nature Series

`, category: "Digital Art", imageurl: "/uploads/images/8ba675b9-c4e6-41e6-8f14-382b9ee1d019.jpg", isactive: true, }, { title: "Abstract Geometric Patterns", description: `

Modern Abstract Compositions

A collection of abstract artworks featuring bold geometric patterns and contemporary design elements. These pieces explore the relationship between shape, color, and space.

Artistic Approach:

  1. Started with basic geometric shapes
  2. Layered multiple patterns and textures
  3. Applied vibrant color combinations
  4. Refined composition for visual balance

These works are inspired by modernist movements and contemporary design trends.

`, category: "Abstract", imageurl: "/uploads/images/8ba675b9-c4e6-41e6-8f14-382b9ee1d019.jpg", isactive: true, }, { title: "Portrait Photography Collection", description: `

Capturing Human Emotion

This portrait series explores the depth of human emotion through carefully composed photographs. Each subject tells a unique story through their expression and body language.

Technical Details:

Shot in various locations including urban settings, nature, and professional studios.

`, category: "Photography", imageurl: "/uploads/images/8ba675b9-c4e6-41e6-8f14-382b9ee1d019.jpg", isactive: true, }, { title: "Watercolor Botanical Illustrations", description: `

Delicate Flora Studies

A series of hand-painted watercolor illustrations featuring various botanical subjects. These pieces celebrate the intricate beauty of plants and flowers.

Collection Includes:

"Nature always wears the colors of the spirit." - Ralph Waldo Emerson

Each illustration is created using professional-grade watercolors on cold-press paper.

`, category: "Illustration", imageurl: "/uploads/images/8ba675b9-c4e6-41e6-8f14-382b9ee1d019.jpg", isactive: true, }, { title: "Urban Architecture Study", description: `

Modern Cityscapes and Structures

An exploration of contemporary urban architecture through the lens of artistic photography and digital manipulation.

Focus Areas:

This project was completed over 6 months, documenting various cities and their unique architectural personalities.

Featured Cities: New York, Tokyo, Dubai, London

`, category: "Photography", imageurl: "/uploads/images/8ba675b9-c4e6-41e6-8f14-382b9ee1d019.jpg", isactive: false, }, ]; try { // Get next ID - portfolioprojects.id appears to be text/varchar type const maxIdResult = await query( "SELECT MAX(CAST(id AS INTEGER)) as max_id FROM portfolioprojects WHERE id ~ '^[0-9]+$'" ); let nextId = (maxIdResult.rows[0].max_id || 0) + 1; for (const project of testProjects) { const result = await query( `INSERT INTO portfolioprojects (id, title, description, category, imageurl, isactive, createdat, updatedat) VALUES ($1, $2, $3, $4, $5, $6, NOW(), NOW()) RETURNING id, title`, [ nextId.toString(), project.title, project.description, project.category, project.imageurl, project.isactive, ] ); console.log( `āœ“ Created: "${result.rows[0].title}" (ID: ${result.rows[0].id})` ); nextId++; } console.log( `\nšŸŽ‰ Successfully added ${testProjects.length} test portfolio projects!` ); console.log("\nšŸ“ Note: All projects use a placeholder image. You can:"); console.log(" 1. Go to /admin/portfolio.html"); console.log(" 2. Edit each project"); console.log(" 3. Select real images from your media library"); console.log("\nāœ… Portfolio management is now ready to use!\n"); process.exit(0); } catch (error) { console.error("āŒ Error adding test projects:", error.message); process.exit(1); } } // Run the function addTestPortfolioProjects();