A simple Gemini-style chat UI built with React + Vite, Firebase Auth/Firestore, and the Google Generative AI SDK.
- Google sign-in (Firebase Auth)
- Chat sessions saved per user (Firestore)
- Markdown rendering + code highlighting
- “Typing” effect for assistant responses
- React (Vite)
- Firebase (Auth + Firestore)
@google/generative-aifor Gemini calls
- Install dependencies
npm install- Create a
.envfile (Vite reads variables prefixed withVITE_)
VITE_GEMINI_API_KEY=YOUR_GEMINI_API_KEY- Run the app
npm run devFirebase is configured in src/config/firebaseConfig.js.
- For real projects, move Firebase config values to environment variables (and don’t commit secrets).
- Firestore data model used by this app:
users/{uid}/sessions/{sessionId}users/{uid}/sessions/{sessionId}/messages/{messageId}
- If
VITE_GEMINI_API_KEYis missing, Gemini calls will fail (seesrc/hooks/useGemini.js). - Creating a new chat returns the created
chatId, so the first message can be sent immediately. - Chat titles auto-generate from the conversation context (first time only, when the title is still
New Chat).
npm run dev– start dev servernpm run build– production buildnpm run preview– preview buildnpm run lint– run ESLint