A full-featured AI chatbot app built with Next.js and React — supporting multiple AI models, context management, and responsive UI.
Frontend
A powerful Next.js-based AI chatbot application with support for multiple AI models and contextual conversations.
First, run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
Open http://localhost:3000 with your browser to see the application.
This project requires some environment variables to be set up for proper functionality, particularly for API connectivity.
Create a .env.local file in your project root with the following variables:
# Base URL for backend API (just put anything for now)
NEXT_PUBLIC_BASE_URL="your-backend-url"
# OpenRouter API Key for AI model access
# Get your API key from https://openrouter.ai/
NEXT_PUBLIC_OPENROUTER_API_KEY="your-openrouter-api-key"
The available AI models in the application are provided through OpenRouter's API. Different models may have different usage tiers and costs. Refer to the OpenRouter documentation for current model availability and pricing.
The project follows a standard Next.js App Router architecture:
src/
├── app/ # Next.js app router pages
├── components/ # React components
│ ├── chat/ # Chat-related components
│ ├── context/ # Context management components
│ ├── layout/ # Layout components (sidebar, navigation)
│ ├── providers/ # React providers
│ └── ui/ # UI components
├── redux/ # Redux store and slices
│ └── features/ # Redux slices for different features
├── types/ # TypeScript type definitions
└── utils/ # Utility functions
The easiest way to deploy this Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out the Next.js deployment documentation for more details.
Contributions are welcome! Please feel free to submit a Pull Request.