diff --git a/cankaoyangshi/.env.example b/cankaoyangshi/.env.example new file mode 100644 index 00000000..7a550fe7 --- /dev/null +++ b/cankaoyangshi/.env.example @@ -0,0 +1,9 @@ +# GEMINI_API_KEY: Required for Gemini AI API calls. +# AI Studio automatically injects this at runtime from user secrets. +# Users configure this via the Secrets panel in the AI Studio UI. +GEMINI_API_KEY="MY_GEMINI_API_KEY" + +# APP_URL: The URL where this applet is hosted. +# AI Studio automatically injects this at runtime with the Cloud Run service URL. +# Used for self-referential links, OAuth callbacks, and API endpoints. +APP_URL="MY_APP_URL" diff --git a/cankaoyangshi/README.md b/cankaoyangshi/README.md new file mode 100644 index 00000000..34585da4 --- /dev/null +++ b/cankaoyangshi/README.md @@ -0,0 +1,20 @@ +
+GHBanner +
+ +# Run and deploy your AI Studio app + +This contains everything you need to run your app locally. + +View your app in AI Studio: https://ai.studio/apps/75261c35-a558-4ef8-9501-e8b7f9c98bfb + +## Run Locally + +**Prerequisites:** Node.js + + +1. Install dependencies: + `npm install` +2. Set the `GEMINI_API_KEY` in [.env.local](.env.local) to your Gemini API key +3. Run the app: + `npm run dev` diff --git a/cankaoyangshi/index.html b/cankaoyangshi/index.html new file mode 100644 index 00000000..21dfe690 --- /dev/null +++ b/cankaoyangshi/index.html @@ -0,0 +1,13 @@ + + + + + + My Google AI Studio App + + +
+ + + + diff --git a/cankaoyangshi/metadata.json b/cankaoyangshi/metadata.json new file mode 100644 index 00000000..19d0a11c --- /dev/null +++ b/cankaoyangshi/metadata.json @@ -0,0 +1,6 @@ +{ + "name": "Gemini Style Assistant", + "description": "A clean, modern AI assistant interface inspired by Google Gemini with centered search, suggestion pills, and a minimalist sidebar.", + "requestFramePermissions": [], + "majorCapabilities": ["MAJOR_CAPABILITY_SERVER_SIDE_GEMINI_API"] +} diff --git a/cankaoyangshi/package.json b/cankaoyangshi/package.json new file mode 100644 index 00000000..9748aee3 --- /dev/null +++ b/cankaoyangshi/package.json @@ -0,0 +1,35 @@ +{ + "name": "react-example", + "private": true, + "version": "0.0.0", + "type": "module", + "scripts": { + "dev": "vite --port=3000 --host=0.0.0.0", + "build": "vite build", + "preview": "vite preview", + "clean": "rm -rf dist server.js", + "lint": "tsc --noEmit" + }, + "dependencies": { + "@google/genai": "^1.29.0", + "@tailwindcss/vite": "^4.1.14", + "@vitejs/plugin-react": "^5.0.4", + "lucide-react": "^0.546.0", + "react": "^19.0.1", + "react-dom": "^19.0.1", + "vite": "^6.2.3", + "express": "^4.21.2", + "dotenv": "^17.2.3", + "motion": "^12.23.24" + }, + "devDependencies": { + "@types/node": "^22.14.0", + "autoprefixer": "^10.4.21", + "esbuild": "^0.25.0", + "tailwindcss": "^4.1.14", + "tsx": "^4.21.0", + "typescript": "~5.8.2", + "vite": "^6.2.3", + "@types/express": "^4.17.21" + } +} diff --git a/cankaoyangshi/src/App.tsx b/cankaoyangshi/src/App.tsx new file mode 100644 index 00000000..1cd7026f --- /dev/null +++ b/cankaoyangshi/src/App.tsx @@ -0,0 +1,238 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ + +import { useState } from 'react'; +import { motion, AnimatePresence } from 'motion/react'; +import { + MessageSquare, + Bot, + Wrench, + Brain, + ListChecks, + Settings, + Menu, + Mic, + Plus, + Sparkles, + ArrowRight, + User, + History, + LayoutGrid, + Languages, + Code2, + Music, + Database, + Search +} from 'lucide-react'; + +export default function App() { + const [sidebarOpen, setSidebarOpen] = useState(true); + + const navItems = [ + { icon: MessageSquare, label: '对话', active: true }, + { icon: Bot, label: '智能体' }, + { icon: Wrench, label: '技能' }, + { icon: Brain, label: '记忆' }, + { icon: ListChecks, label: '任务管理' }, + ]; + + const recentChats = [ + 'CM助手初次问候交谈', + 'Untitled', + 'Untitled', + 'Untitled', + '帮我写一个500字的文案', + '帮我生成一个写论文的实例', + ]; + + const suggestions = [ + { icon: Code2, label: 'Build an Android app', color: 'text-green-600', bg: 'bg-green-50' }, + { icon: Languages, label: 'Convert text to speech', color: 'text-blue-600', bg: 'bg-blue-50' }, + { icon: Music, label: 'Generate music', color: 'text-purple-600', bg: 'bg-purple-50' }, + { icon: Database, label: 'Add database and auth', color: 'text-cyan-600', bg: 'bg-cyan-50' }, + ]; + + return ( +
+ {/* Sidebar */} + +
+
+ + 新对话 +
+
+ + + +
+
+ + 设置和更多 +
+
+
+ + {/* Main Content */} +
+ {/* Top bar */} +
+ + +
+ +
+ +
+
+
+ + {/* Center Canvas */} +
+ +
+ +
+

+ Build your ideas with Gemini +

+ +
+ + {/* Search/Input Area */} + +
+
+