WebChat AI Assistant is an intelligent chatbot that can analyze and discuss the content of any website. Simply enter a URL, and start a conversation about the webpage's content.
This application allows users to:
- Chat with an AI about any website's content
- Copy and share AI responses
- Toggle between light and dark themes
- Engage in natural, context-aware conversations
- Frontend Framework: Next.js 14 (App Router)
- Styling: Tailwind CSS
- UI Components: Custom components with shadcn/ui inspiration
- Database: Upstash Redis
- AI Integration: Anthropic's Claude API
- State Management: React Hooks
- Theme Management: next-themes
ai
- For handling AI chat functionalityreact-markdown
- Rendering markdown responseslucide-react
- Beautiful iconsreact-textarea-autosize
- Auto-expanding input field
- Node.js 18 or higher
- npm or yarn
- An Upstash Redis database
- Anthropic API key
- Clone the repository
git clone https://github.com/yourusername/webchat-ai-assistant.git
cd webchat-ai-assistant
- Install dependencies
npm install
# or
yarn install
- Set up environment variables
Create a
.env.local
file in the root directory:
ANTHROPIC_API_KEY=your_api_key_here
UPSTASH_REDIS_REST_URL=your_upstash_redis_url
UPSTASH_REDIS_REST_TOKEN=your_upstash_redis_token
- Run the development server
npm run dev
# or
yarn dev
Open http://localhost:3000 in your browser to see the application.
webchat-ai-assistant/
├── app/
│ ├── [...url]/
│ │ └── page.tsx # Dynamic route for chat pages
│ ├── api/
│ │ └── chat-stream/
│ │ └── route.ts # API route for chat
│ ├── layout.tsx
│ └── page.tsx # Home page
├── components/
│ ├── ChatNavbar.tsx
│ ├── ChatHeader.tsx
│ ├── ChatInput.tsx
│ ├── ChatWrapper.tsx
│ ├── Gradient.tsx
│ ├── Messages.tsx
│ ├── MessageSkeleton.tsx
│ ├── Providers.tsx
│ ├── SplashScreen.tsx
│ └── ThemeToggle.tsx
├── lib/
│ ├── rag-chat.ts # RAG implementation
│ ├── redis.ts # Redis client
│ └── utils.ts # Utility functions
└── public/
└── ...
- Website Content Analysis: Instantly chat about any website's content
- Responsive Design: Works seamlessly on desktop and mobile
- Dark Mode: Toggle between light and dark themes
- Copy Functionality: Easily copy AI responses
- Loading States: Visual feedback during API calls
- Auto-expanding Input: Comfortable text input experience
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.