diff --git a/app/data/site.config.json b/app/data/site.config.json index 71d0743..2317776 100644 --- a/app/data/site.config.json +++ b/app/data/site.config.json @@ -23,122 +23,10 @@ { "id": "page_home", "slug": "/", - "title": "Startseite (Hauptseite)", + "title": "Startseite", "is_published": true, - "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" - } - } - ] + "sections": [] } ], - "updated_at": "2026-08-09T22:23:20.633Z" + "updated_at": "2026-08-09T22:25:49.609Z" } \ No newline at end of file diff --git a/app/data/waas.db b/app/data/waas.db index 7e75246..632e4de 100644 Binary files a/app/data/waas.db and b/app/data/waas.db differ diff --git a/src/db/index.ts b/src/db/index.ts index 09255c6..f35cc23 100644 --- a/src/db/index.ts +++ b/src/db/index.ts @@ -96,37 +96,14 @@ function seedInitialData(db: DatabaseSync) { 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( 'page_home', '/', - 'Startseite (Hauptseite)', + 'Startseite', 'published', 'page_home', 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({})); } diff --git a/src/db/resetDb.ts b/src/db/resetDb.ts new file mode 100644 index 0000000..39249ac --- /dev/null +++ b/src/db/resetDb.ts @@ -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(); +}