A modern, AI-powered car enthusiast chatbot built with Next.js and Gemini 2.0 Flash. Get expert advice on cars, specifications, comparisons, and more!
- Gemini 2.0 Flash - Powered by Google's latest AI model
- Google Search - Real-time web search for up-to-date information
- Modern UI - Beautiful, responsive dark-mode interface
- Real-time Streaming - Watch responses appear word by word
- Car Expertise - Deep knowledge of vehicles, specs, and recommendations
- Next.js 16 - React framework with App Router
- TypeScript - Type-safe development
- Tailwind CSS 4 - Utility-first styling
- AI SDK - Vercel's AI SDK for streaming chat
- Lucide React - Beautiful icons
- Go - High-performance backend
- Gemini AI - Google's generative AI
- Gorilla Mux - HTTP router
- CORS - Cross-origin resource sharing
- Node.js 18+
- Google AI API Key (get one at https://aistudio.google.com/app/apikey)
- Navigate to the frontend directory:
cd frontend- Install dependencies:
npm install- Create a
.env.localfile:
cp .env.example .env.local- Add your Google AI API key to
.env.local:
GOOGLE_GENERATIVE_AI_API_KEY=your_api_key_here
- Run the development server:
npm run dev- Open http://localhost:3000 in your browser.
The Go backend is an alternative implementation. The frontend already includes an API route using the AI SDK.
- Navigate to the backend directory:
cd backend- Set your API key:
export GOOGLE_API_KEY=your_api_key_here- Run the server:
go run main.go- Push your code to GitHub
- Connect your repository to Vercel
- Add the environment variable
GOOGLE_GENERATIVE_AI_API_KEYin Vercel project settings - Deploy!
Or use the Vercel CLI:
cd frontend
npx vercel --prod| Variable | Description |
|---|---|
GOOGLE_GENERATIVE_AI_API_KEY |
Your Google AI API key for Gemini |
CarBot/
├── frontend/ # Next.js frontend application
│ ├── src/
│ │ ├── app/ # App router pages and API routes
│ │ └── components/# React components
│ ├── public/ # Static assets
│ └── package.json
├── backend/ # Go backend (optional)
│ ├── main.go
│ └── go.mod
└── README.md
Send a message and receive a streaming response.
Request Body:
{
"messages": [
{ "role": "user", "content": "What's the best sports car under $50k?" }
]
}Response: Server-sent events stream with text chunks.
MIT