Commit graph

126 commits

Author SHA1 Message Date
Randall Stillwell
53423509f0 Integrated real database authentication with JWT tokens
- Updated auth verification to use Neon database instead of mock data
- Implemented proper JWT token authentication with localStorage storage
- Created beautiful login page with admin quick-login for development
- Updated all admin auth hooks to use JWT tokens from localStorage
- Added automatic token cleanup on authentication failures
- Enhanced AdminProtected component with proper token validation
- Created logout functionality that clears tokens and redirects
- Maintained fallback admin access for development (no token = admin)
- Real admin credentials: admin@tcgvault.com / admin123
- Seamless integration with existing admin card editor workflow
2025-07-24 16:36:10 -05:00
Randall Stillwell
0d6c6f1957 Implemented admin authentication and seamless card editing
- Created admin authentication system with useIsAdmin hook
- Added AdminProtected component for route protection
- Added prominent 'Edit Card (Admin)' button on card detail pages
- Protected all admin routes (/admin/*) with authentication
- Added admin navigation item to main layout sidebar
- Updated auth verification API to return mock admin user
- Integrated admin edit button that redirects to card editor with card ID
- Added proper access denied page for non-admin users
- Admin-only features now show/hide based on user role
- Seamless workflow: spot incorrect card → click edit → fix immediately
2025-07-24 16:31:29 -05:00
Randall Stillwell
f27a7333db Created comprehensive admin card editor
- Built complete admin interface for editing all card properties
- Added card search functionality with live results
- Created comprehensive form with sections for:
  * Basic information (name, game, set, rarity, etc.)
  * Game mechanics (type, mana cost, power/toughness, colors)
  * Card text and oracle text
  * Image URLs (primary and stock images)
  * Pricing information (current and market prices)
- Added real-time card preview that updates as you edit
- Implemented PUT API endpoint for updating cards
- Added proper validation and error handling
- Added database schema updates (updated_at column)
- Integrated admin navigation between card editor and import tools
- Full responsive design with modern UI components
- Live search with card thumbnails and metadata
- Proper form state management and data persistence
2025-07-24 15:16:57 -05:00
Randall Stillwell
bb60b4f6b0 Enhanced card detail page with real data and functionality
- Updated card detail page to fetch real data from API
- Added ownership tracking with quantity management
- Added favorite system for cards
- Added collection and deck management functionality
- Created API endpoints for ownership, favorites, collections, and decks
- Added database columns for quantity and favorited status
- Shows current collections and decks the card belongs to
- Added proper error handling and loading states
- Integrated with real card data from database
- Added purchase links to TCGPlayer and eBay
2025-07-24 15:03:09 -05:00
Randall Stillwell
73a0c652b2 Fix card sizing consistency across all TCGs
- Added wrapper div with max-width constraint to ensure consistent card sizes
- Updated image rendering to use object-cover with proper positioning
- Removed maxWidth from Card3D component since it's now handled by wrapper
- Ensures all cards (MTG, Pokemon, Lorcana) have identical dimensions
- Fixed responsive grid layout to maintain consistent card sizes
2025-07-24 14:54:12 -05:00
Randall Stillwell
e046515a38 Add real Lorcana import using Lorcast API
- Replaced mock Lorcana import with real API integration
- Uses Lorcast API (https://api.lorcast.com/v0/cards/search) for comprehensive card data
- Added proper set code mapping (tfc->1, rotf->2, ink->3)
- Includes card images, prices, stats, and detailed metadata
- Created dedicated Lorcana import scripts for standalone use
- Maintains duplicate checking and proper error handling
- Supports all 3 Lorcana sets: The First Chapter, Rise of the Floodborn, Into the Inklands
2025-07-24 12:27:10 -05:00
Randall Stillwell
b6f76297bc Fix import issues: Add retry logic and better error handling
- Added retry logic with exponential backoff for Pokemon API calls
- Created Lorcana import endpoint with placeholder data
- Improved error handling for 504 timeouts and 404 not found errors
- Added longer delays for Pokemon imports to avoid rate limiting
- Enhanced logging for better debugging of import issues
- Fixed response parsing to handle different API response formats
2025-07-24 10:30:21 -05:00
Randall Stillwell
e75a4a6649 Major redesign: Enhanced card display with particle effects, improved filters, and search functionality
- Redesigned card display with 2.5:3.5 aspect ratio and image-only view
- Added infinite scroll to replace pagination
- Implemented authentic card back placeholders for MTG, Pokemon, and Lorcana
- Added rarity-based particle effects with tiered intensity (mythic/enchanted/rare/uncommon)
- Enhanced hover details panel with structured card information
- Fixed search functionality with debouncing and Enter key support
- Improved filter system with working TCG, rarity, set, and price filters
- Added favorite system for cards in both hover and detail views
- Updated card detail page with comprehensive metadata and actions
- Fixed API filtering with proper Vercel Postgres implementation
- Added particle animations and rarity glow effects
- Improved overall UX with better visual hierarchy and interactions
2025-07-23 21:26:54 -05:00
Randall Stillwell
c218dd53ac Add simple API test without dependencies 2025-07-23 09:42:30 -05:00
Randall Stillwell
dc419f681b Add database connection test API 2025-07-23 09:41:38 -05:00
Randall Stillwell
373f103810 Fix bcryptjs imports to use dynamic imports 2025-07-23 09:40:50 -05:00
Randall Stillwell
20c2439ff4 Add database setup API to create tables 2025-07-23 09:39:22 -05:00
Randall Stillwell
83776bc6be Add authentication system and admin API endpoints 2025-07-23 09:38:16 -05:00
Randall Stillwell
7be41b4490 Clean slate: Remove React traces and create pure Next.js setup 2025-07-23 09:32:31 -05:00
Randall Stillwell
b4e011e8fa Add minimal health check API 2025-07-23 09:21:29 -05:00
Randall Stillwell
b5e547df7b Force fresh deployment to resolve configuration mismatch 2025-07-23 09:19:11 -05:00
Randall Stillwell
a528676f37 Add require() postgres test and update Vercel config 2025-07-23 08:53:08 -05:00
Randall Stillwell
dda057c1d6 Add basic test API without external dependencies 2025-07-23 08:51:59 -05:00
Randall Stillwell
07f8e49924 Add dynamic postgres import test and clean npm install 2025-07-23 08:50:51 -05:00
Randall Stillwell
339fb6f910 Update @vercel/postgres to latest version and add test APIs 2025-07-23 08:49:05 -05:00
Randall Stillwell
41a7eeef12 Fix API import paths and convert to Next.js Pages API format 2025-07-23 08:40:30 -05:00
Randall Stillwell
df48fd784d Add simple Next.js API route 2025-07-23 08:32:03 -05:00
Randall Stillwell
5737c6e1f0 Add simple test API 2025-07-23 08:29:09 -05:00
Randall Stillwell
e49ada09ba Convert admin API to Next.js Pages API format 2025-07-23 08:28:42 -05:00
Randall Stillwell
2cc332e0a0 Move API routes to pages/api/ for proper Next.js structure 2025-07-23 08:27:14 -05:00
Randall Stillwell
873f4592c2 Convert from React to Next.js for proper API route support 2025-07-23 08:25:58 -05:00