deckhearth/pages
Randall Stillwell a7ee884d02 🖼️ Complete Avatar Upload System with Vercel Blob
📤 Avatar Upload API (/api/user/avatar):
- File upload with multipart form data parsing
- Comprehensive validation (file type, size limits)
- Support for JPEG, PNG, GIF, WebP images up to 5MB
- Automatic cleanup of old avatars before new uploads
- Vercel Blob integration with public access
- Database tracking in user_avatars table
- Error handling for upload failures

🎨 Avatar Generation API (/api/user/avatar/generate):
- Custom avatar generation using DiceBear API
- Fire-themed color scheme (matching app branding)
- Personalized based on user initials/username/email
- SVG format for crisp display at any size
- Automatic fallback if generation fails
- Same cleanup and storage workflow as uploads

🗑️ Account Deletion API (/api/user/delete):
- Complete user data cleanup including Vercel Blob files
- Cascading deletion respecting foreign key constraints
- Admin account protection (prevents self-deletion)
- Comprehensive cleanup order:
  * User avatars from Vercel Blob storage
  * Deck cards, decks, collection cards, collections
  * User cards, avatar records, settings
  * Finally the user account itself
- Detailed logging for audit trail
- Graceful error handling with specific error messages

🔧 Technical Features:
- Custom multipart form data parser for file uploads
- Vercel Blob put/del operations with error handling
- Unique filename generation with timestamps
- Database transaction-like cleanup for deletions
- File type validation and size limits
- Proper CORS headers for all endpoints

🎯 Integration Ready:
- Works seamlessly with existing profile page UI
- Supports both upload and generate avatar buttons
- Returns avatar URLs for immediate display
- Database consistency with user profile system
- Production-ready error handling and validation

The avatar system is now fully functional with Vercel Blob! 📸
2025-07-26 21:39:42 -05:00
..
admin Fixed SSR and null user issues for production deployment 2025-07-24 17:04:06 -05:00
api 🖼️ Complete Avatar Upload System with Vercel Blob 2025-07-26 21:39:42 -05:00
card 🔐 Fix Card Detail Page Authentication Issues 2025-07-26 00:32:58 -05:00
collection 🔧 Fixed Cards Page API Response Format 2025-07-25 23:16:35 -05:00
invite 🎉 COMPLETED: Full Collaborative Collections System 2025-07-25 08:34:28 -05:00
_app.js Major redesign: Enhanced card display with particle effects, improved filters, and search functionality 2025-07-23 21:26:54 -05:00
analytics.js Major redesign: Enhanced card display with particle effects, improved filters, and search functionality 2025-07-23 21:26:54 -05:00
cards.js Massive Performance Boost - Remove Heavy Hover Panels 2025-07-26 08:45:38 -05:00
collections.js 🔄 Simplified Permission Model & UX Improvements 2025-07-25 10:29:45 -05:00
community.js Major redesign: Enhanced card display with particle effects, improved filters, and search functionality 2025-07-23 21:26:54 -05:00
dashboard.js 🎨 Restructured Layout System 2025-07-25 11:28:04 -05:00
decks.js Major redesign: Enhanced card display with particle effects, improved filters, and search functionality 2025-07-23 21:26:54 -05:00
index.js Major redesign: Enhanced card display with particle effects, improved filters, and search functionality 2025-07-23 21:26:54 -05:00
login.js 🎨 Restructured Layout System 2025-07-25 11:28:04 -05:00
logout.js 🎨 Restructured Layout System 2025-07-25 11:28:04 -05:00
profile.js 🎯 Build Comprehensive User Profile & Settings System 2025-07-26 18:05:55 -05:00
settings.js 🎯 Build Comprehensive User Profile & Settings System 2025-07-26 18:05:55 -05:00