deckhearth/pages/api
Randall Stillwell 50a3156b92 🔗 Implement Collection Slug URLs
🎯 Vanity URLs for Collections:
- Added slug-based URLs like /collection/modern-masters-2021
- Backwards compatible with numeric IDs
- SEO-friendly and memorable URLs

🛠️ Slug System:
- Created lib/slug-utils.js with slug generation and validation
- generateSlug() converts names to URL-friendly format
- generateUniqueSlug() handles duplicates with numeric suffixes
- isValidSlug() validates format (lowercase, hyphens, no special chars)

📊 Database Schema:
- Added slug column to collections table with unique constraint
- Migration script adds slugs to existing collections
- Database constraints ensure slug format and uniqueness
- Performance index on slug column

🔌 API Updates:
- Updated collections API to generate slugs for new collections
- New [identifier].js endpoint handles both slugs and IDs
- Thumbnails API supports both slug and ID lookups
- Smart identifier detection (slug vs numeric ID)

🎨 Frontend Integration:
- Collections page uses slugs for navigation
- Fallback to ID if slug not available (backwards compatibility)
- Updated all collection links to use slugs
- Sample collections created with proper slugs

 URL Examples:
- /collection/modern-masters-2021 (new slug format)
- /collection/123 (old ID format still works)
- Automatic redirect potential for future

The collection URLs are now beautiful and shareable! 🚀
2025-07-26 22:06:52 -05:00
..
admin Major redesign: Enhanced card display with particle effects, improved filters, and search functionality 2025-07-23 21:26:54 -05:00
auth Fixed authentication API endpoints and login functionality 2025-07-24 19:57:19 -05:00
cards 🔧 Fix Database Schema Mismatch in Cards API 2025-07-26 10:27:45 -05:00
collections 🔗 Implement Collection Slug URLs 2025-07-26 22:06:52 -05:00
invite 🎉 COMPLETED: Full Collaborative Collections System 2025-07-25 08:34:28 -05:00
user 🖼️ Complete Avatar Upload System with Vercel Blob 2025-07-26 21:39:42 -05:00
users 🚀 Implemented Complete Collection Functionality 2025-07-25 22:28:52 -05:00
auth-utils.js Major redesign: Enhanced card display with particle effects, improved filters, and search functionality 2025-07-23 21:26:54 -05:00
collections.js 🔗 Implement Collection Slug URLs 2025-07-26 22:06:52 -05:00
decks.js 🔒 CRITICAL SECURITY FIX: Implement Proper User Data Isolation 2025-07-26 00:29:51 -05:00
favorites.js 🔧 Fixed SQL Syntax Errors in Favorites API 2025-07-25 23:06:16 -05:00
health.js Clean slate: Remove React traces and create pure Next.js setup 2025-07-23 09:32:31 -05:00
setup-database.js Fix bcryptjs imports to use dynamic imports 2025-07-23 09:40:50 -05:00
simple.js Add simple API test without dependencies 2025-07-23 09:42:30 -05:00
test-auth.js Major redesign: Enhanced card display with particle effects, improved filters, and search functionality 2025-07-23 21:26:54 -05:00
test-db.js Major redesign: Enhanced card display with particle effects, improved filters, and search functionality 2025-07-23 21:26:54 -05:00