Files
w-make-portfolio/services/updates-api/migrations/001-add-links.sql
T
Jan Wagner 97944875ca feat: Phase 1 - Admin CMS with Links Management
Backend (updates-api):
- Add links table schema with categories, visibility, sorting
- Implement full CRUD API for links (/v1/links, /v1/admin/links)
- Create admin UI for links management (/admin/links)
- Add navigation between Updates and Links admin pages
- Add comprehensive tests for links API (7/7 passing)

Frontend (Next.js):
- Create API client for fetching links from updates-api
- Add LinksSection component with category icons
- Integrate links into homepage (between Notes and CTA)
- Add i18n entries for links section (DE/EN)
- ISR caching: 60s for links, 5min for updates

Features:
- Links organized by category (external/internal/resource/tool)
- Visibility toggle (show/hide on homepage)
- Sort order support
- Optional icons and descriptions
- Responsive grid layout (1/2/3 columns)

Testing:
- All existing tests pass
- New links API tests cover CRUD + validation
- Production build successful

Phase 1 Complete: Links management ready for deployment
Next: Phase 2 (Markdown editor + media upload)
2026-08-22 16:56:00 +02:00

19 lines
663 B
SQL

-- Migration: Add links table for link management
-- Created: 2026-08-22
CREATE TABLE IF NOT EXISTS links (
id INTEGER PRIMARY KEY AUTOINCREMENT,
title TEXT NOT NULL,
url TEXT NOT NULL,
category TEXT NOT NULL DEFAULT 'external' CHECK (category IN ('external', 'internal', 'resource', 'tool')),
description TEXT,
icon TEXT,
sort_order INTEGER NOT NULL DEFAULT 0,
visible INTEGER NOT NULL DEFAULT 1 CHECK (visible IN (0, 1)),
created_at TEXT NOT NULL,
updated_at TEXT NOT NULL
);
CREATE INDEX IF NOT EXISTS idx_links_visible ON links(visible, sort_order);
CREATE INDEX IF NOT EXISTS idx_links_category ON links(category, visible, sort_order);