A modern AI-powered chatbot built with React frontend and FastAPI backend, containerized with Docker for easy deployment.
- Frontend: React + TypeScript + Tailwind CSS + shadcn/ui
- Backend: FastAPI + Python
- AI Integration: GROQ API for LLM responses
- Containerization: Docker + Docker Compose
- Production Ready: Nginx reverse proxy, health checks, and optimized builds
- Docker and Docker Compose
- GROQ API Key (free account available)
git clone <your-repo-url>
cd Deploy_Project-sampleOption A: Using the setup script (Windows)
.\setup-env.ps1Option B: Manual setup
# Create .env file
echo "GROQ_API_KEY=your_actual_groq_api_key_here" > .envOption C: Set environment variable directly
# Windows PowerShell
$env:GROQ_API_KEY="your_actual_groq_api_key_here"
# Linux/Mac
export GROQ_API_KEY="your_actual_groq_api_key_here"- Visit https://console.groq.com/
- Sign up for a free account
- Create an API key
- Replace
your_actual_groq_api_key_herewith your real API key
# Build and start all services
docker-compose up --build
# Or run in detached mode
docker-compose up -d --build- Frontend: http://localhost
- Backend API: http://localhost:8004
- Health Check: http://localhost:8004/
# Start services
docker-compose up
# Start in background
docker-compose up -d
# View logs
docker-compose logs
# View specific service logs
docker-compose logs backend
docker-compose logs frontend# Build all services
docker-compose build
# Build specific service
docker-compose build backend
docker-compose build frontend
# Rebuild without cache
docker-compose build --no-cache# Stop services
docker-compose down
# Stop and remove volumes
docker-compose down -v
# Restart services
docker-compose restart
# Check service status
docker-compose psβββ backend/
β βββ Dockerfile # Backend container configuration
β βββ main.py # FastAPI application
β βββ llm.py # GROQ AI integration
β βββ requirements.txt # Python dependencies
βββ frontend/
β βββ Dockerfile # Frontend container configuration
β βββ nginx.conf # Nginx configuration
β βββ src/ # React application source
β βββ package.json # Node.js dependencies
βββ docker-compose.yml # Multi-container orchestration
βββ setup-env.ps1 # Environment setup script (Windows)
βββ README.md # This file
GROQ_API_KEY: Your GROQ API key (required)HOST: Backend host (default: 0.0.0.0)PORT: Backend port (default: 8004)
- Frontend: 80 (Nginx)
- Backend: 8004 (FastAPI)
Port 8004 already in use
# Find and kill process using port 8004
netstat -ano | findstr :8004
taskkill /PID <process_id> /FGROQ API key not working
- Verify your API key is correct
- Check if you have sufficient credits
- Ensure the key is properly set in environment variables
Docker build fails
# Clean Docker cache and rebuild
docker builder prune -f
docker-compose build --no-cacheFrontend not loading
- Check if nginx container is running:
docker-compose ps - View nginx logs:
docker-compose logs frontend
# Test backend health
curl http://localhost:8004/
# Test frontend
curl http://localhost/# Production deployment
docker-compose -f docker-compose.yml up -d --build- Never commit
.envfiles to version control - Use Docker secrets for production deployments
- Set up proper firewall rules
- Use HTTPS in production (configure SSL certificates)
# Backend
cd backend
pip install -r requirements.txt
python main.py
# Frontend
cd frontend
npm install
npm run dev# Backend dependencies
# Edit backend/requirements.txt
docker-compose build backend
# Frontend dependencies
# Edit frontend/package.json
docker-compose build frontend- Fork the repository
- Create a feature branch
- Make your changes
- Test with Docker
- Submit a pull request
This project is licensed under the MIT License.
If you encounter any issues:
- Check the troubleshooting section above
- View the logs:
docker-compose logs - Create an issue in the repository
Happy Chatting! π€π¬