feat: Refactor Gemini integration and build process

This commit centralizes Gemini API interaction into a new `server.ts` file and removes it from the client-side `geminiService.ts`.
It also updates the build process in `package.json` to use `esbuild` for bundling the server code, enabling a more robust build pipeline.
The `index.html` has been cleaned up by removing unnecessary OneSignal SDK initialization.
Additionally, dev dependencies have been updated, including `esbuild` to version `0.28.0`.
A new `test2.ts` file is added for testing Gemini API connectivity.
This commit is contained in:
desartstudio95
2026-05-18 10:00:07 -07:00
parent bb1ef9336f
commit ab0b842fca
6 changed files with 862 additions and 292 deletions
+4 -2
View File
@@ -4,8 +4,9 @@
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite --port=3000 --host=0.0.0.0",
"build": "vite build",
"dev": "tsx server.ts",
"build": "vite build && esbuild server.ts --bundle --platform=node --format=cjs --packages=external --sourcemap --outfile=dist/server.cjs",
"start": "node dist/server.cjs",
"preview": "vite preview",
"clean": "rm -rf dist",
"lint": "tsc --noEmit"
@@ -39,6 +40,7 @@
"@types/express": "^4.17.21",
"@types/node": "^22.14.0",
"autoprefixer": "^10.4.21",
"esbuild": "^0.28.0",
"eslint": "^10.2.1",
"tailwindcss": "^4.1.14",
"ts-node": "^10.9.2",