#!/usr/bin/env node /** * Sample data population script for Reboot Content * This creates sample pages that can be managed through the admin interface */ const samplePages = [ { slug: 'about', title: 'About RevampIT', content: `
At RevampIT, we believe in giving technology a second life. Founded in 2009, we've been at the forefront of sustainable IT practices in Switzerland.
Every year, we save hundreds of devices from landfill and provide affordable technology solutions to those who need them most.
`, seo_title: 'About Us - RevampIT', seo_description: "Learn about RevampIT's mission to extend the life of IT devices and promote sustainable computing practices.", is_published: true, }, { slug: 'contact', title: 'Contact Us', content: `Ready to give your old computer a second life? We'd love to hear from you!
RevampIT
Sample Address 123
8000 Zurich, Switzerland
Monday - Friday: 9:00 - 18:00
Saturday: 10:00 - 16:00
Sunday: Closed
Email: info@revampit.ch
Phone: +41 XX XXX XX XX
We offer comprehensive IT solutions tailored to your needs.
From hardware diagnostics to component replacement, we fix all types of computer issues.
Installation, configuration, and troubleshooting for all major Linux distributions.
Professional data recovery services for lost or corrupted files.
Expert advice on sustainable IT practices and open-source solutions.
`, seo_title: 'IT Services - RevampIT', seo_description: 'Professional computer repair, Linux support, and IT consulting services in Zurich.', is_published: true, }, ]; async function populateSampleData() { console.log('🚀 Populating sample pages for Reboot Content admin interface...'); for (const page of samplePages) { try { const response = await fetch('http://localhost:3001/api/content/static-pages', { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify(page), }); if (response.ok) { const result = await response.json(); console.log(`✅ Created page: ${page.title} (ID: ${result.data?.id})`); } else { const error = await response.json(); console.log(`❌ Failed to create ${page.title}:`, error.message); } } catch (error) { console.log(`❌ Error creating ${page.title}:`, error.message); } } console.log('✨ Sample data population complete!'); console.log('📝 You can now visit /admin to manage these pages'); } // Only run if called directly if (import.meta.url === `file://${process.argv[1]}`) { populateSampleData().catch(console.error); } export { populateSampleData, samplePages };