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

View File

@ -0,0 +1,33 @@
// Browser-compatible database interface
// This provides mock implementations for browser builds
export const db = {
query: {
users: {
findFirst: () => Promise.resolve(null),
findMany: () => Promise.resolve([]),
},
scripts: {
findFirst: () => Promise.resolve(null),
findMany: () => Promise.resolve([]),
},
},
select: () => ({ from: () => ({ where: () => Promise.resolve([]) }) }),
insert: () => ({ values: () => Promise.resolve() }),
update: () => ({ set: () => ({ where: () => Promise.resolve() }) }),
delete: () => ({ where: () => Promise.resolve() }),
};
// Export schema as empty objects for browser compatibility
export const users = {};
export const scripts = {};
export const ratings = {};
export const scriptVersions = {};
export const scriptAnalytics = {};
export const scriptCollections = {};
export const collectionScripts = {};
// Export empty relations
export const usersRelations = {};
export const scriptsRelations = {};
export const ratingsRelations = {};