A beautiful, responsive AI-powered chatbot built with React, TypeScript, and Node.js. Features a sleek ChatGPT-like interface with real-time messaging, typing indicators, and smart AI responses.
- ChatGPT-inspired design with gradient backgrounds and smooth animations
- Responsive layout that works on desktop, tablet, and mobile
- Dark/Light theme support with beautiful color schemes
- Smooth animations and micro-interactions for better UX
- Real-time messaging with instant responses
- Typing indicators with animated dots
- Message history with conversation persistence
- Copy to clipboard functionality for bot responses
- Auto-scroll to latest messages
- Error handling with user-friendly error messages
- TypeScript for type safety and better development experience
- Modular architecture with reusable components
- RESTful API with proper error handling
- Form validation with react-hook-form
- Responsive design with Tailwind CSS
- Modern React patterns with hooks and functional components
- Bun (recommended) or Node.js 18+
- Git
-
Clone the repository
git clone https://github.com/yourusername/ai-chatbot.git cd ai-chatbot -
Install dependencies
bun install
-
Set up environment variables
cd packages/server cp .env.example .env # Edit .env with your configuration
-
Start the development servers
# Start both client and server bun run dev # Or start individually cd packages/server && bun run dev # Backend on :5000 cd packages/client && bun run dev # Frontend on :5173
-
Open your browser Navigate to
http://localhost:5173and start chatting!
Full-stack-project/
βββ packages/
β βββ client/ # React frontend
β β βββ src/
β β β βββ components/ # Reusable UI components
β β β β βββ ChatBot.tsx # Main chat container
β β β β βββ ChatMessages.tsx # Messages display
β β β β βββ ChatMessage.tsx # Individual message
β β β β βββ ChatInput.tsx # Message input form
β β β β βββ TypingIndicator.tsx # Typing animation
β β β β βββ ui/ # Base UI components
β β β βββ lib/ # Utilities and helpers
β β β βββ App.tsx # Main application
β β βββ package.json
β β βββ vite.config.ts
β βββ server/ # Node.js backend
β βββ controllers/ # Request handlers
β βββ services/ # Business logic
β βββ repositories/ # Data access layer
β βββ routes.ts # API routes
β βββ index.ts # Server entry point
βββ README.md
βββ package.json
- React 18 - Modern React with hooks and functional components
- TypeScript - Type-safe JavaScript for better development
- Vite - Fast build tool and development server
- Tailwind CSS - Utility-first CSS framework
- React Hook Form - Performant forms with easy validation
- Lucide React - Beautiful SVG icons
- React Markdown - Render markdown in messages
- Node.js - JavaScript runtime
- Express.js - Web application framework
- TypeScript - Type-safe server-side development
- Zod - Schema validation for API requests
- Bun - Fast JavaScript runtime and package manager
POST /api/chat
Content-Type: application/json
{
"prompt": "Hello, how are you?",
"conversationId": "uuid-string"
}
Response:
{
"message": "Hello! I'm doing great, thank you for asking. How can I help you today?"
}Create a .env file in packages/server/:
PORT=5000
HUGGING_FACE_API_KEY=your_api_key_here # Optional for AI integration- Styling: Modify Tailwind classes in components
- AI Responses: Update
chat.service.tsfor different AI providers - Validation: Adjust schemas in
chat.controller.ts - UI Components: Customize components in
src/components/
cd packages/client
bun run build
# Deploy dist/ foldercd packages/server
bun run build
# Deploy with start script: "bun run start"- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Inspired by ChatGPT's clean and intuitive interface
- Built with modern web technologies and best practices
- Designed for scalability and maintainability
If you have any questions or need help, please:
- Open an issue on GitHub
- Check the documentation
- Contact the maintainers
Made with β€οΈ and modern web technologies