diff --git a/backend/Dockerfile b/backend/Dockerfile index b41bc0a..192c5cc 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,5 +1,13 @@ -FROM python:3.9-slim +FROM python:3.13-slim + +RUN apt-get update && apt-get install -y \ + libgl1 \ + libglib2.0-0 \ + libsm6 \ + libxext6 \ + libxrender-dev \ + && rm -rf /var/lib/apt/lists/* WORKDIR /app diff --git a/frontend/Dockerfile b/frontend/Dockerfile index bccc3c1..532750e 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -1,5 +1,5 @@ # Build stage -FROM node:20-alpine AS builder +FROM oven/bun:1 AS builder WORKDIR /app @@ -7,24 +7,24 @@ WORKDIR /app COPY package.json ./ # Install dependencies -RUN npm install +RUN bun install # Copy source code COPY . . # Build the SvelteKit app -RUN npm run build +RUN bun run build # Production stage -FROM node:20-alpine AS production +FROM oven/bun:1 AS production WORKDIR /app -# Copy package.json for production dependencies +# Copy package.json and lockfile for production dependencies COPY package.json ./ # Install only production dependencies -RUN npm install --omit=dev +RUN bun install --production # Copy built files from builder COPY --from=builder /app/build ./build @@ -38,4 +38,4 @@ ENV NODE_ENV=production ENV PORT=3000 # Start the server -CMD ["node", "server/index.js"] +CMD ["bun", "server/index.js"] diff --git a/frontend/server/index.js b/frontend/server/index.js index f7700b1..c905b77 100644 --- a/frontend/server/index.js +++ b/frontend/server/index.js @@ -25,7 +25,7 @@ app.use(express.urlencoded({ extended: true, limit: '50mb' })); */ app.use('/api', async (req, res) => { const targetUrl = `${API_URL}${req.originalUrl}`; - + try { const fetchOptions = { method: req.method, @@ -41,10 +41,10 @@ app.use('/api', async (req, res) => { } const response = await fetch(targetUrl, fetchOptions); - + // Get content type from response const contentType = response.headers.get('content-type'); - + // Set response headers res.status(response.status); if (contentType) { @@ -52,7 +52,7 @@ app.use('/api', async (req, res) => { } // Handle different response types - if (contentType && (contentType.includes('application/pdf') || + if (contentType && (contentType.includes('application/pdf') || contentType.includes('text/plain') || contentType.includes('application/octet-stream'))) { // Binary/file responses @@ -78,7 +78,7 @@ const buildPath = path.join(__dirname, '../build'); app.use(express.static(buildPath)); // SPA fallback - serve index.html for all other routes -app.get('*', (req, res) => { +app.get(/.*/, (req, res) => { res.sendFile(path.join(buildPath, 'index.html')); }); diff --git a/frontend/src/lib/components/InstallPrompt.svelte b/frontend/src/lib/components/InstallPrompt.svelte deleted file mode 100644 index 1ee3a40..0000000 --- a/frontend/src/lib/components/InstallPrompt.svelte +++ /dev/null @@ -1,172 +0,0 @@ - - -{#if shouldShow} -
-
-
- Ethix Logo -
- -

Install Ethix

-

To use Ethix, please add this website to your home screen.

- -
-
- 1 - Tap the Share button below -
-
- 2 - Select "Add to Home Screen" -
-
- -
- -
-
-
-{/if} - - diff --git a/frontend/src/lib/components/catalogue/CatalogueHeader.svelte b/frontend/src/lib/components/catalogue/CatalogueHeader.svelte index d460187..fae256d 100644 --- a/frontend/src/lib/components/catalogue/CatalogueHeader.svelte +++ b/frontend/src/lib/components/catalogue/CatalogueHeader.svelte @@ -76,7 +76,7 @@ {#if viewMode === "company"} -
+
diff --git a/frontend/src/lib/components/catalogue/ReportCard.svelte b/frontend/src/lib/components/catalogue/ReportCard.svelte index c734cef..68df151 100644 --- a/frontend/src/lib/components/catalogue/ReportCard.svelte +++ b/frontend/src/lib/components/catalogue/ReportCard.svelte @@ -47,7 +47,7 @@ onclick={() => openReport(report)} >
diff --git a/frontend/src/routes/+layout.svelte b/frontend/src/routes/+layout.svelte index aa8563f..5d23cb5 100644 --- a/frontend/src/routes/+layout.svelte +++ b/frontend/src/routes/+layout.svelte @@ -7,7 +7,6 @@ import { page } from "$app/stores"; import { goto } from "$app/navigation"; import Icon from "@iconify/svelte"; - import InstallPrompt from "$lib/components/InstallPrompt.svelte"; let { children } = $props(); let isApp = $state(false); @@ -39,7 +38,7 @@ function handleCameraClose() { isCameraActive = false; // Dispatch event to notify MobileHomePage to refresh - window.dispatchEvent(new CustomEvent('scan-complete')); + window.dispatchEvent(new CustomEvent("scan-complete")); } onMount(() => { @@ -94,8 +93,6 @@ - - {#if isMobile}