refactor: clear sample pages and sections to provide a clean slate for custom editing

This commit is contained in:
Daniel S
2026-08-10 00:26:02 +02:00
parent 488e024451
commit 698716c34e
4 changed files with 38 additions and 140 deletions

View File

@@ -23,122 +23,10 @@
{ {
"id": "page_home", "id": "page_home",
"slug": "/", "slug": "/",
"title": "Startseite (Hauptseite)", "title": "Startseite",
"is_published": true, "is_published": true,
"sections": [ "sections": []
{
"id": "sec_hero_1",
"type": "HeroSection",
"settings": {
"title": "Maßgeschneiderte Webseiten. Digital im Griff.",
"subtitle": "Wir entwickeln blitzschnelle, DSGVO-konforme High-End Webseiten für Ihr Unternehmen.",
"ctaPrimaryText": "Projekt anfragen",
"ctaPrimaryLink": "#contact",
"bg_color": "#0b0f19"
}
},
{
"id": "sec_bento_1",
"type": "BentoGrid",
"settings": {
"sectionTitle": "High-End Features & Leistung",
"sectionSubtitle": "Modernste Technologie & Höchster Datenschutz vereint."
}
},
{
"id": "sec_contact_1",
"type": "ContactSection",
"settings": {
"title": "Bereit für Ihr Projekt?",
"subtitle": "Schreiben Sie uns direkt. Wir antworten innerhalb von 24 Stunden persönlich."
}
},
{
"id": "sec_bentogrid_1786313652833",
"type": "BentoGrid",
"settings": {
"sectionTitle": "Unsere Highlights",
"sectionSubtitle": "Modernste Features im Überblick"
}
},
{
"id": "sec_herosection_1786313653735",
"type": "HeroSection",
"settings": {
"title": "Neue Überschrift",
"subtitle": "Beschreibungstext hier eingeben.",
"ctaPrimaryText": "Jetzt anfragen",
"ctaPrimaryLink": "#contact"
}
},
{
"id": "sec_contactsection_1786313654351",
"type": "ContactSection",
"settings": {
"title": "Kontaktieren Sie uns",
"subtitle": "Wir antworten innerhalb von 24 Stunden."
}
},
{
"id": "sec_bentogrid_1786313698683",
"type": "BentoGrid",
"settings": {
"sectionTitle": "Unsere Highlights",
"sectionSubtitle": "Modernste Features im Überblick"
}
},
{
"id": "sec_contactsection_1786313966524",
"type": "ContactSection",
"settings": {
"title": "Kontaktieren Sie uns",
"subtitle": "Wir antworten innerhalb von 24 Stunden."
}
},
{
"id": "sec_bentogrid_1786313967196",
"type": "BentoGrid",
"settings": {
"sectionTitle": "Unsere Highlights",
"sectionSubtitle": "Modernste Features im Überblick"
}
},
{
"id": "sec_bentogrid_1786313968059",
"type": "BentoGrid",
"settings": {
"sectionTitle": "Unsere Highlights",
"sectionSubtitle": "Modernste Features im Überblick"
}
},
{
"id": "sec_contactsection_1786313968892",
"type": "ContactSection",
"settings": {
"title": "Kontaktieren Sie uns",
"subtitle": "Wir antworten innerhalb von 24 Stunden."
}
},
{
"id": "sec_bentogrid_1786313969624",
"type": "BentoGrid",
"settings": {
"sectionTitle": "Unsere Highlights",
"sectionSubtitle": "Modernste Features im Überblick"
}
},
{
"id": "sec_herosection_1786313970384",
"type": "HeroSection",
"settings": {
"title": "Neue Überschrift",
"subtitle": "Beschreibungstext hier eingeben.",
"ctaPrimaryText": "Jetzt anfragen",
"ctaPrimaryLink": "#contact"
}
}
]
} }
], ],
"updated_at": "2026-08-09T22:23:20.633Z" "updated_at": "2026-08-09T22:25:49.609Z"
} }

Binary file not shown.

View File

@@ -96,37 +96,14 @@ function seedInitialData(db: DatabaseSync) {
now now
); );
// Seed default pages & sections // Seed default page only (no prefilled sections/demo content)
db.prepare('INSERT INTO pages (id, slug, title, status, homepage_id, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?)').run( db.prepare('INSERT INTO pages (id, slug, title, status, homepage_id, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?)').run(
'page_home', 'page_home',
'/', '/',
'Startseite (Hauptseite)', 'Startseite',
'published', 'published',
'page_home', 'page_home',
now, now,
now now
); );
const heroDraft = JSON.stringify({
title: 'Maßgeschneiderte Webseiten. Digital im Griff.',
subtitle: 'Wir entwickeln blitzschnelle, DSGVO-konforme High-End Webseiten für Ihr Unternehmen.',
ctaPrimaryText: 'Projekt anfragen',
ctaPrimaryLink: '#contact'
});
const bentoDraft = JSON.stringify({
sectionTitle: 'High-End Features & Leistung',
sectionSubtitle: 'Modernste Technologie & Höchster Datenschutz vereint.'
});
const contactDraft = JSON.stringify({
title: 'Bereit für Ihr Projekt?',
subtitle: 'Schreiben Sie uns direkt. Wir antworten innerhalb von 24 Stunden persönlich.'
});
const stmt = db.prepare('INSERT INTO page_sections (id, page_id, section_type, order_index, content_draft_json, content_published_json, styles_json) VALUES (?, ?, ?, ?, ?, ?, ?)');
stmt.run('sec_hero_1', 'page_home', 'HeroSection', 0, heroDraft, heroDraft, JSON.stringify({ bg_color: '#0b0f19' }));
stmt.run('sec_bento_1', 'page_home', 'BentoGrid', 1, bentoDraft, bentoDraft, JSON.stringify({}));
stmt.run('sec_contact_1', 'page_home', 'ContactSection', 2, contactDraft, contactDraft, JSON.stringify({}));
} }

33
src/db/resetDb.ts Normal file
View File

@@ -0,0 +1,33 @@
import { DatabaseSync } from 'node:sqlite';
import path from 'node:path';
import fs from 'node:fs';
const DATA_DIR = process.env.DATA_DIR || path.join(process.cwd(), 'app', 'data');
const DB_PATH = path.join(DATA_DIR, 'waas.db');
export function resetDatabaseToBlankSlate(): void {
const db = new DatabaseSync(DB_PATH);
// Lösche bestehende Seiten & Sektionen
db.exec('DELETE FROM page_sections');
db.exec('DELETE FROM pages');
const now = new Date().toISOString();
// Leere Startseite anlegen (ohne vordefinierte Sektionen/Inhalte)
db.prepare('INSERT INTO pages (id, slug, title, status, homepage_id, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?)').run(
'page_home',
'/',
'Startseite',
'published',
'page_home',
now,
now
);
console.log('[WaaS DB] Datenbank auf leeren Stand (Blank Slate) zurückgesetzt.');
}
if (import.meta.url === `file://${process.argv[1]}` || process.argv[1]?.endsWith('resetDb.ts')) {
resetDatabaseToBlankSlate();
}