post-deploy fixins
All checks were successful
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Successful in 44s

This commit is contained in:
2025-11-10 11:28:46 -08:00
parent e5035a7b0d
commit bdddca1417
4 changed files with 24 additions and 28 deletions

View File

@@ -62,6 +62,11 @@ jobs:
npm exec -- supabase functions deploy delete-user --project-ref ${{ env.SUPABASE_PROJECT_ID }} npm exec -- supabase functions deploy delete-user --project-ref ${{ env.SUPABASE_PROJECT_ID }}
npm exec -- supabase functions deploy seed-database --project-ref ${{ env.SUPABASE_PROJECT_ID }} npm exec -- supabase functions deploy seed-database --project-ref ${{ env.SUPABASE_PROJECT_ID }}
# Debug step: Verify environment variables are present before build
- name: Debug Environment Variables
run: |
echo "VITE_API_KEY is set: ${{ env.VITE_API_KEY != '' }}"
# --- Frontend Deployment --- # --- Frontend Deployment ---
- name: Build React Application - name: Build React Application
env: env:

View File

@@ -5,18 +5,15 @@ import type { FlyerItem, MasterGroceryItem, UnitPrice, Store } from '../types';
import { CATEGORIES } from '../types'; import { CATEGORIES } from '../types';
import { parsePriceToCents } from '../utils/priceParser'; import { parsePriceToCents } from '../utils/priceParser';
/* // In a Vite project, environment variables are exposed on the `import.meta.env` object.
NOTE ON THE GOOGLE AI API KEY: // For security, only variables prefixed with `VITE_` are exposed to the client-side code.
This project uses a Google AI (Gemini) API key. In this environment, you do not need to manually create one. const apiKey = import.meta.env.VITE_API_KEY;
You may see a "Choose a key" dialog. If it mentions a "free tier", you can simply close or ignore that dialog.
The environment will automatically provide a free-tier API key as `process.env.API_KEY` for the AI to work.
*/
if (!process.env.API_KEY) { if (!apiKey) {
throw new Error("API_KEY environment variable not set"); throw new Error("API_KEY environment variable not set");
} }
const ai = new GoogleGenAI({ apiKey: process.env.API_KEY }); const ai = new GoogleGenAI({ apiKey });
/** /**
* Parses a JSON string from a Gemini response, robustly handling markdown fences. * Parses a JSON string from a Gemini response, robustly handling markdown fences.

View File

@@ -11,7 +11,8 @@
], ],
"skipLibCheck": true, "skipLibCheck": true,
"types": [ "types": [
"node" "node",
"vite/client" // Add this line to include Vite's client-side types
], ],
"moduleResolution": "bundler", "moduleResolution": "bundler",
"isolatedModules": true, "isolatedModules": true,

View File

@@ -1,23 +1,16 @@
import path from 'path'; import path from 'path';
import { defineConfig, loadEnv } from 'vite'; import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react'; import react from '@vitejs/plugin-react';
export default defineConfig(({ mode }) => { export default defineConfig({
const env = loadEnv(mode, '.', ''); server: {
return { port: 3000,
server: { host: '0.0.0.0',
port: 3000, },
host: '0.0.0.0', plugins: [react()],
}, resolve: {
plugins: [react()], alias: {
define: { '@': path.resolve(__dirname, '.'),
'process.env.API_KEY': JSON.stringify(env.GEMINI_API_KEY), }
'process.env.GEMINI_API_KEY': JSON.stringify(env.GEMINI_API_KEY) }
},
resolve: {
alias: {
'@': path.resolve(__dirname, '.'),
}
}
};
}); });