Refactor API files to provide mock implementations for analytics, auth, collections, ratings, scripts, and users, streamlining the codebase for frontend-only functionality. Remove legacy database schema and browser compatibility files to enhance clarity and maintainability.

This commit is contained in:
2025-08-16 00:22:56 +01:00
parent a96df855f5
commit d6f5901fe2
23 changed files with 2349 additions and 1845 deletions

29
restore-apis.cjs Normal file
View File

@ -0,0 +1,29 @@
#!/usr/bin/env node
const fs = require('fs');
const path = require('path');
console.log('🔄 Restoring real APIs...');
// Remove mock APIs
if (fs.existsSync('src/lib/api')) {
fs.rmSync('src/lib/api', { recursive: true });
}
if (fs.existsSync('src/lib/db')) {
fs.rmSync('src/lib/db', { recursive: true });
}
// Restore real APIs from backup
if (fs.existsSync('temp_api_backup')) {
if (fs.existsSync('temp_api_backup/api')) {
fs.cpSync('temp_api_backup/api', 'src/lib/api', { recursive: true });
}
if (fs.existsSync('temp_api_backup/db')) {
fs.cpSync('temp_api_backup/db', 'src/lib/db', { recursive: true });
}
console.log('✅ Restored real APIs! You can now use the full database functionality');
console.log('📝 To switch back to mocks for building, run: node switch-to-mocks.cjs');
} else {
console.log('❌ No backup found! Cannot restore real APIs');
}