A modern AI-powered chatbot UI built with React 19 and integrated with Google's Gemini Generative AI API. This clone simulates the experience of ChatGPT, allowing real-time interaction with an intelligent assistant.
- ⚡ Built with React 19 and Vite for blazing-fast development
- 🧠 Integrates Gemini API (
@google/generative-ai) - 🧩 Clean and modular component structure
- 🎨 Beautiful icons via
react-icons - ✅ ESLint support for code quality
- 💬 Multiple chat sessions with localStorage persistence
- 🎭 Smooth animations and transitions
- 🌙 Dark/Light mode toggle
- 📱 Fully mobile responsive design
- 🖥️ Desktop and mobile sidebar experience
- Frontend: React 19, Vite, React Icons
- AI Integration: Google Gemini API
- Tooling: ESLint, TypeScript (if enabled), Vite Plugin React
git clone https://github.com/your-username/chatgpt_clone.git
cd chatgpt_clonenpm install-
Get your Gemini API key:
- Visit Google AI Studio
- Create a new API key
- Copy the key
-
Create environment file:
cp .env.example .env
-
Add your API key to
.env:VITE_GEMINI_API_KEY=your_actual_api_key_here
npm run devThe app will be available at http://localhost:5173
| Variable | Description | Required |
|---|---|---|
VITE_GEMINI_API_KEY |
Your Google Gemini API key | ✅ Yes |
- ✅ API key is stored in
.envfile (not committed to git) - ✅
.envis included in.gitignore - ✅ Example file (
.env.example) provided for setup
- Sidebar is always visible on the left
- Click the hamburger icon to expand/collapse sidebar text
- Start a new chat or select from recent chats
- Sidebar is hidden by default for a clean interface
- Tap the floating hamburger button to open the sidebar
- Sidebar slides in with overlay; tap outside to close
- "New chat" and "Recent chats" text and icons appear when sidebar is open
- All chat features work seamlessly on mobile
- Start a new chat: Click the "+" icon or "New chat" button
- Send messages: Type in the input box and press Enter or click send
- View recent chats: Click the hamburger menu to see your chat history
- Load previous chats: Click on any recent chat to continue the conversation
- Toggle dark mode: Click the sun icon in the bottom right
src/
├── Components/
│ ├── Chat/ # Chat interface components
│ ├── Sidebar/ # Navigation and chat history
│ ├── darkMode/ # Dark/light mode toggle
│ └── Separation/ # Visual separator
├── geminiAPI/ # Gemini API integration
├── App.jsx # Main app component
└── main.jsx # App entry point
This is a frontend-only application. For production deployment:
-
Build the project:
npm run build
-
Deploy to your preferred platform:
- Vercel
- Netlify
- GitHub Pages
- Any static hosting service
Note: Remember to set up environment variables in your deployment platform.
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request