From 89373c84f8928b7581804c9824326f57b6a66665 Mon Sep 17 00:00:00 2001 From: greg Date: Sun, 27 Apr 2025 21:33:23 +0200 Subject: [PATCH] Debug 2 --- my-favorites-app/next.config.mjs | 23 +++++++++++++++++ my-favorites-app/nixpacks.toml | 16 ++++++++++++ my-favorites-app/package.json | 42 ++++++++++++++++++++----------- my-favorites-app/src/app/page.tsx | 32 +++++++++++++++++++---- 4 files changed, 94 insertions(+), 19 deletions(-) create mode 100644 my-favorites-app/next.config.mjs create mode 100644 my-favorites-app/nixpacks.toml diff --git a/my-favorites-app/next.config.mjs b/my-favorites-app/next.config.mjs new file mode 100644 index 0000000..622315b --- /dev/null +++ b/my-favorites-app/next.config.mjs @@ -0,0 +1,23 @@ +/** @type {import('next').NextConfig} */ +const nextConfig = { + // Disable the standalone output for now to simplify deployment + // output: 'standalone', + images: { + domains: [ + 'm.media-amazon.com', + 'i.scdn.co', + 'www.moma.org' + ], + remotePatterns: [ + { + protocol: 'https', + hostname: '**', + }, + ], + unoptimized: true, // This can help with deployment issues + }, + // Enable strict mode for better development experience + reactStrictMode: true, +}; + +export default nextConfig; diff --git a/my-favorites-app/nixpacks.toml b/my-favorites-app/nixpacks.toml new file mode 100644 index 0000000..d287d34 --- /dev/null +++ b/my-favorites-app/nixpacks.toml @@ -0,0 +1,16 @@ +[phases.setup] +nixPkgs = ["nodejs", "nodejs.pkgs.pnpm"] + +[phases.install] +cmds = ["npm ci"] + +[phases.build] +cmds = ["npm run build"] + +[start] +cmd = "npm start" + +[variables] +NODE_ENV = "production" +PORT = "3000" +HOST = "0.0.0.0" diff --git a/my-favorites-app/package.json b/my-favorites-app/package.json index 92b2e4a..07a5a96 100644 --- a/my-favorites-app/package.json +++ b/my-favorites-app/package.json @@ -3,25 +3,39 @@ "version": "0.1.0", "private": true, "scripts": { - "dev": "next dev --turbopack", + "dev": "next dev", "build": "next build", - "start": "next start", + "start": "NODE_ENV=production node server.js", "lint": "next lint" }, "dependencies": { - "react": "^19.0.0", - "react-dom": "^19.0.0", - "next": "15.3.1" + "@radix-ui/react-dialog": "^1.0.5", + "@radix-ui/react-dropdown-menu": "^2.0.6", + "@radix-ui/react-slot": "^1.0.2", + "@supabase/auth-helpers-nextjs": "^0.9.0", + "@supabase/supabase-js": "^2.39.7", + "class-variance-authority": "^0.7.0", + "clsx": "^2.1.0", + "date-fns": "^3.3.1", + "lucide-react": "^0.358.0", + "next": "14.1.0", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "tailwind-merge": "^2.2.1" }, "devDependencies": { - "typescript": "^5", - "@types/node": "^20", - "@types/react": "^19", - "@types/react-dom": "^19", - "@tailwindcss/postcss": "^4", - "tailwindcss": "^4", - "eslint": "^9", - "eslint-config-next": "15.3.1", - "@eslint/eslintrc": "^3" + "@eslint/eslintrc": "^3.0.2", + "@types/node": "^20.11.25", + "@types/react": "^18.2.64", + "@types/react-dom": "^18.2.21", + "autoprefixer": "^10.4.18", + "eslint": "^8.57.0", + "eslint-config-next": "14.1.0", + "postcss": "^8.4.35", + "tailwindcss": "^3.4.1", + "typescript": "^5.4.2" + }, + "engines": { + "node": ">=18.0.0" } } diff --git a/my-favorites-app/src/app/page.tsx b/my-favorites-app/src/app/page.tsx index fea99b7..773426a 100644 --- a/my-favorites-app/src/app/page.tsx +++ b/my-favorites-app/src/app/page.tsx @@ -1,9 +1,31 @@ import { FavoritesGrid } from '@/components/FavoritesGrid'; -import { getFavorites } from '@/lib/supabase'; +import { type Favorite } from '@/lib/supabase'; -export default async function Home() { - const favorites = await getFavorites(); - +// Mock data for initial deployment testing +const mockFavorites: Favorite[] = [ + { + id: '1', + title: 'The Lord of the Rings', + author: 'J.R.R. Tolkien', + consumption_date: '2025-03-15', + type: 'book', + cover_image: 'https://m.media-amazon.com/images/I/71jLBXtWJWL._AC_UF1000,1000_QL80_.jpg', + created_at: '2025-03-20T12:00:00Z', + updated_at: '2025-03-20T12:00:00Z' + }, + { + id: '2', + title: 'Inception', + author: 'Christopher Nolan', + consumption_date: '2025-02-10', + type: 'movie', + cover_image: 'https://m.media-amazon.com/images/M/MV5BMjAxMzY3NjcxNF5BMl5BanBnXkFtZTcwNTI5OTM0Mw@@._V1_.jpg', + created_at: '2025-02-15T12:00:00Z', + updated_at: '2025-02-15T12:00:00Z' + } +]; + +export default function Home() { return (
@@ -12,7 +34,7 @@ export default async function Home() { A collection of books, movies, series, and more that have made an impression on me.

- +
); }