A modern chatbot application built with React and FastAPI, featuring a clean and minimal interface. The current implementation uses predefined responses.
- React
- Tailwind CSS
- Heroicons
- Python 3.8+
- FastAPI
- Uvicorn
- CORS middleware
- Node.js (v14.0.0 or higher)
- npm or yarn
- Python 3.8 or higher
- pip (Python package manager)
git clone https://github.com/krish4uu/ai-chatbot.git
cd ai-chatbotNavigate to the frontend directory and install dependencies:
cd frontend
npm install
# Install Tailwind plugins
npm install -D tailwindcss postcss autoprefixerNavigate to the backend directory and set up a Python virtual environment:
cd backend
# Create virtual environment
python3 -m venv venv
# Activate virtual environment:
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activate
# Install dependencies
pip install fastapi uvicorn python-dotenv corsFrom the backend directory with your virtual environment activated:
uvicorn main:app --reloadThe backend server will start at http://localhost:8000
From the frontend directory:
npm startThe application will open in your default browser at http://localhost:3000
The backend server provides the following endpoints:
GET /api/health: Health check endpointPOST /api/chat: Chat endpoint- Request body:
{ "message": "string" } - Response:
{ "response": "string" }
- Request body:
To customize the chatbot responses, edit the responses.py file in the backend directory.