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 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 ---
- name: Build React Application
env:

View File

@@ -5,18 +5,15 @@ import type { FlyerItem, MasterGroceryItem, UnitPrice, Store } from '../types';
import { CATEGORIES } from '../types';
import { parsePriceToCents } from '../utils/priceParser';
/*
NOTE ON THE GOOGLE AI API KEY:
This project uses a Google AI (Gemini) API key. In this environment, you do not need to manually create one.
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.
*/
// In a Vite project, environment variables are exposed on the `import.meta.env` object.
// For security, only variables prefixed with `VITE_` are exposed to the client-side code.
const apiKey = import.meta.env.VITE_API_KEY;
if (!process.env.API_KEY) {
if (!apiKey) {
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.

View File

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

View File

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