A premium, production-ready AI chatbot assistant built with Next.js 16, React 19, and OpenRouter free-tier models. Features a Claude-like conversational UI with real-time streaming, markdown rendering, multi-model support, and a warm neutral design system with purple accents.
- Real-time AI Streaming — Token-by-token streaming responses with throttled rendering for smooth performance
- Multi-Model Support — Switch between OpenRouter models (GPT-4, Claude, Gemini, and more) via dropdown
- Conversation Management — Create, rename, delete, and switch between chat threads with grouped history (Today, Yesterday, Previous 7 days, etc.)
- Rich Markdown Rendering — Full GFM support with syntax-highlighted code blocks, tables, blockquotes, and inline code
- File Attachments — Attach files (text, code, images) to messages with drag-and-drop support
- Web Search & Reasoning — Toggle web search and extended reasoning modes per message
- Authentication — Email/password, Google OAuth, and GitHub OAuth via NextAuth v4
- Dark/Light Theme — System-persistent theme toggle with smooth transitions
- Responsive Design — Pixel-perfect at 360px, 768px, 1024px+, and beyond
- Smooth Animations — Skeleton loading states, staggered message entrances, typing indicators, and conversation switching transitions
| Layer | Technology |
|---|---|
| Framework | Next.js 16.2.7 (Turbopack) |
| UI | React 19.2.4, Client Components |
| Styling | CSS Modules, CSS Custom Properties |
| Auth | NextAuth v4.24.14 (Credentials + OAuth) |
| Database | MongoDB via Mongoose |
| AI | OpenRouter API (free-tier models) |
| Markdown | react-markdown, remark-gfm |
| Syntax | react-syntax-highlighter |
| Icons | lucide-react |
- Node.js 18+
- MongoDB Atlas cluster (free tier works)
- OpenRouter API key(s) — Sign up free
# Clone the repository
git clone git@github.com:shawon2210/OddAI-Chatbot.git
cd OddAI-Chatbot
# Install dependencies
npm install
# Copy environment variables
cp .env.example .env.local
# Edit .env.local with your values
# Start development server
npm run devOpen http://localhost:3000 in your browser.
| Variable | Required | Description |
|---|---|---|
MONGODB_URI |
Yes | MongoDB Atlas connection string |
NEXTAUTH_SECRET |
Yes | Generate with openssl rand -base64 32 |
NEXTAUTH_URL |
Yes | http://localhost:3000 for dev |
OPENROUTER_API_KEY |
Yes | OpenRouter API key |
OPENROUTER_API_KEY_2..5 |
No | Additional keys for rotation |
GOOGLE_CLIENT_ID |
No | Google OAuth Client ID |
GOOGLE_CLIENT_SECRET |
No | Google OAuth Client Secret |
GITHUB_CLIENT_ID |
No | GitHub OAuth Client ID |
GITHUB_CLIENT_SECRET |
No | GitHub OAuth Client Secret |
See .env.example for full reference.
- Fork or clone this repository
- Go to vercel.com/new and import the repo
- Add the following Environment Variables in Vercel dashboard:
MONGODB_URI— your MongoDB Atlas connection stringNEXTAUTH_SECRET— runopenssl rand -base64 32NEXTAUTH_URL— your Vercel deployment URL (e.g.https://your-app.vercel.app)OPENROUTER_API_KEY— your OpenRouter API keyGOOGLE_CLIENT_ID/GOOGLE_CLIENT_SECRET(optional)GITHUB_CLIENT_ID/GITHUB_CLIENT_SECRET(optional)
- Click Deploy — build takes ~2 minutes
- Go to cloud.mongodb.com and create a free cluster
- Create a database user and get the connection string
- Add
0.0.0.0/0to Network Access (allow all IPs) - Set the connection string as
MONGODB_URIin Vercel env vars
OddAI-Chatbot/
├── app/
│ ├── api/
│ │ ├── auth/
│ │ │ ├── [...nextauth]/route.js # NextAuth config
│ │ │ └── register/route.js # Registration endpoint
│ │ ├── chat/route.js # OpenRouter streaming proxy
│ │ ├── conversations/ # CRUD for chat threads
│ │ └── settings/route.js # User settings
│ ├── components/
│ │ ├── ChatArea.js # Main chat viewport + input
│ │ ├── Message.js # Individual message rendering
│ │ ├── Sidebar.js # Conversation list + profile
│ │ ├── WelcomeScreen.js # Empty state suggestions
│ │ ├── ModelSelector.js # AI model dropdown
│ │ ├── SettingsModal.js # Theme/model settings
│ │ ├── ThemeToggle.js # Dark/light toggle
│ │ └── ClientProviders.js # Session + theme context
│ ├── page.js # Main app shell
│ ├── layout.js # Root layout + fonts
│ ├── globals.css # Design system + animations
│ ├── login/ # Login page
│ ├── register/ # Registration page
│ ├── guide/ # Guide page
│ └── landing/ # Landing page
├── lib/
│ ├── auth.js # NextAuth options + callbacks
│ ├── mongodb.js # Mongoose connection cache
│ ├── models.js # OpenRouter model definitions
│ └── models/
│ ├── User.js # User schema + bcrypt
│ └── Conversation.js # Conversation schema
├── .github/workflows/ci.yml # GitHub Actions CI
├── vercel.json # Vercel deployment config
├── next.config.mjs # Next.js config
└── .env.example # Environment variable reference
| Command | Description |
|---|---|
npm run dev |
Start development server with hot reload |
npm run build |
Create optimized production build |
npm run start |
Start production server |
npm run lint |
Run ESLint |
Developed by: Shawon (shawon2210) GitHub: https://github.com/shawon2210 Email: shawonshanto104141@gmail.com
Private project. All rights reserved. © 2025 Shawon. All rights reserved.