Skip to content

ritikch027/ai-chat-web

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gemini Clone (React + Vite)

A simple Gemini-style chat UI built with React + Vite, Firebase Auth/Firestore, and the Google Generative AI SDK.

Features

  • Google sign-in (Firebase Auth)
  • Chat sessions saved per user (Firestore)
  • Markdown rendering + code highlighting
  • “Typing” effect for assistant responses

Tech stack

  • React (Vite)
  • Firebase (Auth + Firestore)
  • @google/generative-ai for Gemini calls

Getting started

  1. Install dependencies
npm install
  1. Create a .env file (Vite reads variables prefixed with VITE_)
VITE_GEMINI_API_KEY=YOUR_GEMINI_API_KEY
  1. Run the app
npm run dev

Firebase

Firebase 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}

Notes / common issues

  • If VITE_GEMINI_API_KEY is missing, Gemini calls will fail (see src/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).

Scripts

  • npm run dev – start dev server
  • npm run build – production build
  • npm run preview – preview build
  • npm run lint – run ESLint

About

Gemini-style chat clone built with React + Vite, Firebase Auth/Firestore for user sessions, and the Google Generative AI (Gemini) API with Markdown + code highlighting.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors