$ show babaohuang/GeminiProChat
GeminiProChat is a minimal web UI for interacting with Google's Gemini Pro API. It is built as a server-side rendered application using Astro with SolidJS for interactive components. The application provides a chat interface where users can send messages and receive streaming responses from the Gemini model. It supports features like system role settings, temperature control, message history persistence, password protection, and PWA capabilities. The architecture consists of Astro pages (index, password), API endpoints (auth, generate), and SolidJS components for the chat generator, message rendering with markdown and code highlighting, and a theme toggle with view transitions. External dependencies include the Google Generative AI SDK (patched to use v1beta API), markdown-it for rendering, and Zag.js for slider components. The application can be deployed on Vercel, Netlify, Railway, Zeabur, or via Docker, with environment variables for API key, base URL, password, and model name.
The LLM identified 2 files worth highlighting for reuse:
A self-contained utility for generating and verifying HMAC-like signatures using SHA-256. It provides two functions: generateSignature and verifySignature, which use the Web Crypto API (crypto.subtle.digest) with a fallback to js-sha256 for environments without native crypto. The signature is computed as SHA-256(timestamp:lastMessage:secretKey). This module is isolated, has no internal dependencies beyond js-sha256, and can be extracted into any project requiring API request signing.
An Astro component that implements a dark/light theme toggle with smooth view transitions. It uses inline SVG with CSS animations for the sun/moon icon, listens for system color scheme changes, and applies the View Transition API for a circular reveal animation when toggling. The component is self-contained with its own styles and script, and can be extracted into any Astro project needing a polished theme switcher.