210 lines
12 KiB
JavaScript
210 lines
12 KiB
JavaScript
import prisma from '../src/lib/prisma';
|
||
async function main() {
|
||
console.log('Migrating pages to CMS...');
|
||
// Delete existing to force fresh payload insert
|
||
await prisma.page.deleteMany({
|
||
where: { slug: { in: ['about', 'faq', 'contact'] } }
|
||
});
|
||
// 1. Create About Page
|
||
await prisma.page.upsert({
|
||
where: { slug: 'about' },
|
||
update: {},
|
||
create: {
|
||
slug: 'about',
|
||
title: 'About Us',
|
||
isPublished: true,
|
||
sections: {
|
||
create: [
|
||
{
|
||
type: 'HERO',
|
||
order: 1,
|
||
payload: {
|
||
tagline: 'Our Story',
|
||
title: 'Born from a passion for stillness',
|
||
description: 'HomAroma began in 2019 as a one-person studio in Bangkok, crafting small batches of botanical aroma blends for friends and family. What started as a personal journey toward calm became a philosophy — that our environment shapes how we feel, think, and rest.',
|
||
align: 'center',
|
||
imageUrl: '/images/hero.png',
|
||
overlay: true,
|
||
buttonText: 'Discover More',
|
||
buttonLink: '/shop'
|
||
}
|
||
},
|
||
{
|
||
type: 'TEXT',
|
||
order: 2,
|
||
payload: {
|
||
tagline: 'Stats',
|
||
title: 'Company Stats',
|
||
content: '45+ Unique Scents\n5 Product Lines\nFounded 2019\n100% Natural Extracts',
|
||
align: 'center'
|
||
}
|
||
},
|
||
{
|
||
type: 'EDITORIAL_TILE',
|
||
order: 3,
|
||
payload: {
|
||
tagline: 'Our Mission',
|
||
title: 'Transforming spaces into sanctuaries of peace',
|
||
description: 'We believe that scent is the fastest pathway to emotional transformation. A single breath of the right blend can dissolve anxiety, sharpen focus, or unlock creativity. Our mission is to make that transformation accessible — through products that are as beautiful as they are effective.\n\nEvery HomAroma product is designed with intention: the bottles are reusable, the packaging is recycled, and the formulas are written to be understood by anyone — not hidden behind chemical jargon.',
|
||
imageUrl: '/images/hero.png',
|
||
imageAlt: 'HomAroma Studio, Bangkok',
|
||
reverse: false
|
||
}
|
||
},
|
||
{
|
||
type: 'TEXT',
|
||
order: 4,
|
||
payload: {
|
||
tagline: 'What We Stand For',
|
||
title: 'Three Pillars',
|
||
content: '1. Pure Origins: Every extract is sourced directly from certified organic farms in Northern Thailand, Vietnam, and Southern France. We work exclusively with small-batch artisan growers.\n\n2. Artisan Craft: Each formula is cold-extracted and hand-blended in our Bangkok studio. No heat processing means every aromatic molecule remains intact and therapeutically potent.\n\n3. Zero Compromise: No synthetic fragrance. No parabens. No animal testing. Our commitment to clean formulation is absolute — what touches your senses should honour your wellbeing.',
|
||
align: 'center'
|
||
}
|
||
},
|
||
{
|
||
type: 'BANNER',
|
||
order: 5,
|
||
payload: {
|
||
title: 'Ready to find your scent?',
|
||
description: 'Let our Scent Guide help you discover the perfect blend for your moment.',
|
||
buttonText: 'Take the Scent Guide',
|
||
buttonLink: '/scent-guide',
|
||
imageUrl: '/images/hero.png'
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
});
|
||
// 2. Create FAQ Page
|
||
await prisma.page.upsert({
|
||
where: { slug: 'faq' },
|
||
update: {},
|
||
create: {
|
||
slug: 'faq',
|
||
title: 'Frequently Asked Questions',
|
||
isPublished: true,
|
||
sections: {
|
||
create: [
|
||
{
|
||
type: 'TEXT',
|
||
order: 1,
|
||
payload: {
|
||
tagline: 'Support',
|
||
title: 'Frequently Asked Questions',
|
||
content: 'Everything you need to know about HomAroma products, shipping, and care.',
|
||
align: 'center'
|
||
}
|
||
},
|
||
{
|
||
type: 'ACCORDION',
|
||
order: 2,
|
||
payload: {
|
||
categories: [
|
||
{
|
||
name: 'Products',
|
||
icon: '🌿',
|
||
questions: [
|
||
{ q: 'What are the ingredients in your aroma products?', a: 'All HomAroma products are crafted from 100% natural botanical extracts, pure essential oils, and pharmaceutical-grade carrier bases. We never use synthetic fragrances, parabens, or harmful chemicals. Each product label lists full ingredient transparency.' },
|
||
{ q: 'How long does each product last?', a: 'Our Reed Diffusers last 4–8 weeks depending on room size and airflow. Aroma Oils (30ml) last approximately 3–4 months with normal use. Room Sprays (100ml) provide 60–80 uses. Car Diffusers cartridges last up to 45 days.' },
|
||
{ q: 'Are your products suitable for sensitive skin or allergies?', a: 'We recommend patch testing before topical use. Our Aroma Oils are formulated for diffuser use primarily. If you have known fragrance allergies, consult our scent guide or contact us with your specific concerns — we are happy to help identify suitable options.' },
|
||
{ q: 'What is the difference between Aroma Oil and Oil Ozone?', a: 'Aroma Oils are pure essential oil blends designed for aromatherapy diffusers and therapeutic use. Oil Ozone is our premium line featuring ozone-infused botanical extracts — designed for air purification and deeper space transformation, ideal for large rooms and commercial spaces.' },
|
||
]
|
||
},
|
||
{
|
||
name: 'Usage',
|
||
icon: '💡',
|
||
questions: [
|
||
{ q: 'How do I use a Reed Diffuser?', a: 'Remove the stopper, place the reeds into the bottle, and let them absorb the oil for 1 hour before flipping. For optimal fragrance, flip the reeds every 2–3 days. Keep away from direct sunlight and air conditioning vents for longest lasting performance.' },
|
||
{ q: 'Can I mix different scents?', a: 'Yes! Blending scents is an art form we encourage. A general rule: combine no more than 3 scents at a time, using one dominant (60%), one supporting (30%), and one accent (10%). Our Scent Guide can help you find complementary combinations.' },
|
||
{ q: 'How long should I run my aroma diffuser?', a: 'For best results and to avoid olfactory fatigue, we recommend 30–60 minute sessions with 30-minute breaks in between. This also extends product life and prevents overwhelming fragrance build-up in small spaces.' },
|
||
]
|
||
},
|
||
{
|
||
name: 'Shipping & Orders',
|
||
icon: '📦',
|
||
questions: [
|
||
{ q: 'How long does shipping take?', a: 'Standard delivery within Bangkok takes 1–2 business days. Provincial orders take 2–4 business days. Express same-day delivery is available in Bangkok for orders placed before 12:00 PM.' },
|
||
{ q: 'Do you ship internationally?', a: 'Currently we ship within Thailand only. International shipping is planned for late 2025. Sign up for our newsletter to be notified when we expand to your region.' },
|
||
{ q: 'What is your return policy?', a: 'We accept returns within 14 days of purchase for unopened, undamaged products in original packaging. For defective or damaged products, we offer full replacement at no cost. Contact us at hello@homaroma.shop with your order number.' },
|
||
]
|
||
},
|
||
{
|
||
name: 'Scent Guide',
|
||
icon: '🧪',
|
||
questions: [
|
||
{ q: 'How do I choose the right scent for my space?', a: 'Consider the function of the space first. Bedrooms benefit from calming scents like lavender and chamomile. Living rooms work well with warm, welcoming notes like sandalwood and vanilla. Home offices pair best with focus-enhancing eucalyptus and citrus. Use our interactive Scent Guide for personalized recommendations.' },
|
||
{ q: 'Can I request custom scent blending?', a: 'Yes! Our bespoke blending service is available for orders of 6 units or more. Contact us at least 10 business days before your desired delivery date. Custom blending fees start at ฿500 per unique formula.' },
|
||
]
|
||
}
|
||
]
|
||
}
|
||
},
|
||
{
|
||
type: 'BANNER',
|
||
order: 3,
|
||
payload: {
|
||
title: 'Still have questions?',
|
||
description: 'Our team is here to help — usually responds within 2 hours.',
|
||
buttonText: 'Contact Us',
|
||
buttonLink: '/contact',
|
||
imageUrl: '/images/hero.png'
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
});
|
||
// 3. Create Contact Page
|
||
await prisma.page.upsert({
|
||
where: { slug: 'contact' },
|
||
update: {},
|
||
create: {
|
||
slug: 'contact',
|
||
title: 'Contact Us',
|
||
isPublished: true,
|
||
sections: {
|
||
create: [
|
||
{
|
||
type: 'TEXT',
|
||
order: 1,
|
||
payload: {
|
||
tagline: 'Get in Touch',
|
||
title: 'Contact Us',
|
||
content: 'Have a question, custom request, or partnership idea? We\'d love to hear from you.',
|
||
align: 'center'
|
||
}
|
||
},
|
||
{
|
||
type: 'CONTACT_INFO',
|
||
order: 2,
|
||
payload: {
|
||
address: 'Bangkok, Thailand',
|
||
email: 'hello@homaroma.shop',
|
||
line: '@homaroma',
|
||
hours: 'Mon–Sat, 9:00–18:00 (ICT)'
|
||
}
|
||
},
|
||
{
|
||
type: 'CONTACT_FORM',
|
||
order: 3,
|
||
payload: {
|
||
subjects: ['Product Inquiry', 'Order Support', 'Custom Blending', 'Wholesale', 'Partnership', 'Other'],
|
||
buttonText: 'Send Message'
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
});
|
||
console.log('Pages created successfully.');
|
||
}
|
||
main()
|
||
.catch((e) => {
|
||
console.error(e);
|
||
process.exit(1);
|
||
})
|
||
.finally(async () => {
|
||
await prisma.$disconnect();
|
||
});
|
||
//# sourceMappingURL=migrate-pages.js.map
|