Files
denshooter 9e6ae866d0
CI / CD / test-build (push) Successful in 11m13s
CI / CD / deploy-dev (push) Successful in 2m25s
CI / CD / deploy-production (push) Has been skipped
feat: plakat redesign phase 4 (chat window, contact, footer, cleanup) (#77)
- AI chat moves into a window/sheet, opened from a new speech-bubble card on
  the desk; it now respects the chatbot consent and asks before sending
  anything to n8n (previously it ignored the consent)
- Contact as red poster section with big mail address and the form on a paper
  card; validation errors are finally shown inline (aria-invalid, role=alert)
- Footer as ink strip with dk0 wordmark, legal links and a button to reopen
  the privacy settings
- "About me" in the header opens the about window on the home page
- Remove the old About section and its parts (BentoChat, ActivityFeed,
  CurrentlyReading, ReadBooks), the unused ChatWidget, Projects and BentoGrid,
  their tests, wrappers, loaders, types and texts
- scripts/directus-cleanup-redesign.mjs: dry run by default, --apply archives
  hobbies, tech stack categories and old content pages and deletes four
  unused message overrides after a full JSON backup; run only after the
  redesign is live on production

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 23:49:56 +02:00
..
2026-02-15 22:04:26 +01:00
2026-01-22 20:56:35 +01:00
2025-09-08 08:36:16 +02:00
2025-09-06 08:57:31 +00:00
2025-09-08 08:36:16 +02:00
2025-09-06 08:57:31 +00:00
2025-09-05 21:35:54 +00:00
2026-01-08 16:27:40 +01:00
2026-01-08 11:31:57 +01:00

Directus Setup & Migration Scripts

Automatische Scripts zum Erstellen und Befüllen aller Collections in Directus.

📦 Verfügbare Scripts

1. Tech Stack (✅ Bereits ausgeführt)

# Collections erstellen
node scripts/setup-directus-collections.js

# Daten migrieren
node scripts/migrate-tech-stack-to-directus.js

Was erstellt wird:

  • tech_stack_categories (4 Kategorien: Frontend, Backend, Tools, Security)
  • tech_stack_items (~16 Items)
  • Translations (DE + EN)

2. Projects (🔥 Neu)

# Collections erstellen
node scripts/setup-directus-projects.js

# Daten aus PostgreSQL migrieren
node scripts/migrate-projects-to-directus.js

Was erstellt wird:

  • projects Collection mit 30+ Feldern:
    • Basics: slug, title, description, content
    • Meta: category, difficulty, tags, technologies
    • Links: github, live, image_url, demo_video
    • Details: challenges, lessons_learned, future_improvements
    • Performance: lighthouse scores, bundle sizes
  • projects_translations für mehrsprachige Inhalte
  • Migriert ALLE Projekte aus PostgreSQL

Hinweis: Läuft nur wenn Projects Collection noch nicht existiert!


3. Hobbies (🎮 Neu)

# Collections erstellen
node scripts/setup-directus-hobbies.js

# Daten migrieren
node scripts/migrate-hobbies-to-directus.js

Was erstellt wird:

  • hobbies Collection (4 Hobbies: Self-Hosting, Gaming, Game Servers, Jogging)
  • Translations (DE + EN)

🚀 Komplette Migration (alles auf einmal)

# 1. Tech Stack
node scripts/setup-directus-collections.js
node scripts/migrate-tech-stack-to-directus.js

# 2. Projects
node scripts/setup-directus-projects.js
node scripts/migrate-projects-to-directus.js

# 3. Hobbies
node scripts/setup-directus-hobbies.js
node scripts/migrate-hobbies-to-directus.js

Oder als One-Liner:

node scripts/setup-directus-collections.js && \
node scripts/migrate-tech-stack-to-directus.js && \
node scripts/setup-directus-projects.js && \
node scripts/migrate-projects-to-directus.js && \
node scripts/setup-directus-hobbies.js && \
node scripts/migrate-hobbies-to-directus.js

⚙️ Voraussetzungen

# Dependencies installieren
npm install node-fetch@2 dotenv @prisma/client

In .env:

DIRECTUS_URL=https://cms.dk0.dev
DIRECTUS_STATIC_TOKEN=your_token_here
DATABASE_URL=postgresql://...

📊 Nach der Migration

Directus Admin Panel:

API Endpoints (automatisch verfügbar):

# Tech Stack
GET https://cms.dk0.dev/items/tech_stack_categories?fields=*,translations.*,items.*

# Projects
GET https://cms.dk0.dev/items/projects?fields=*,translations.*

# Hobbies
GET https://cms.dk0.dev/items/hobbies?fields=*,translations.*

🔄 Code-Updates nach Migration

1. lib/directus.ts erweitern

// Bereits implementiert:
export async function getTechStack(locale: string)

// TODO:
export async function getProjects(locale: string)
export async function getHobbies(locale: string)

2. Components anpassen

  • About.tsx - ✅ Bereits updated für Tech Stack
  • About.tsx - TODO: Hobbies aus Directus laden
  • Projects.tsx - TODO: Projects aus Directus laden

🐛 Troubleshooting

Error: "Collection already exists"

→ Normal! Script überspringt bereits existierende Collections automatisch.

Error: "DIRECTUS_STATIC_TOKEN not found"

→ Stelle sicher dass .env vorhanden ist und require('dotenv').config() funktioniert.

Error: "Unauthorized" oder HTTP 403

→ Überprüfe Token-Rechte in Directus Admin → Settings → Access Tokens

Migration findet keine Projekte

→ Stelle sicher dass PostgreSQL läuft und DATABASE_URL korrekt ist.


📝 Nächste Schritte

  1. ✅ Alle Scripts ausführen (siehe oben)
  2. ✅ Verifizieren in Directus Admin Panel
  3. ⏭️ Code updaten (lib/directus.ts + Components)
  4. ⏭️ Testen auf localhost
  5. ⏭️ Deployen auf Production

💡 Pro-Tipps

  • Backups: Exportiere Schema regelmäßig via Directus UI
  • Version Control: Committe Schema-Files ins Git
  • Incremental: Scripts können mehrfach ausgeführt werden (idempotent)
  • Rollback: Lösche Collections in Directus UI falls nötig