Refactor Docker setup for frontend-only builds by removing server-side API files, creating mock APIs, and updating health check notes. Adjusted Vite configuration for browser compatibility and refined API handling in various components to improve user experience and maintainability.

This commit is contained in:
2025-08-15 22:35:15 +01:00
parent f7dc75d514
commit 7d100e7e0f
16 changed files with 224 additions and 124 deletions

33
src/lib/db/browser.ts Normal file
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 = {};