A comprehensive chatbot system with real-time chat capabilities, lead generation, and admin dashboard.
- API Server (Flask): Handles chat interactions and real-time messaging
- Chat Engine: Processes messages and generates responses
- Admin Dashboard: Manages leads and bot configuration
- Client Widget: Embeddable chat interface
- Python 3.9+
- Docker and Docker Compose
- PostgreSQL
- Redis
- Clone the repository:
git clone <repository-url>
cd chatbot_app
- Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Generate API keys and set up environment variables:
# Generate secure keys and create .env file
python scripts/generate_keys.py
# Review the generated .env file
cat .env
For more details about API keys and configuration, see API Keys Documentation
- Start the development services:
docker-compose up -d
- Run the Flask development server:
flask run
The API will be available at http://localhost:5000
POST /api/chat/message
: Send a chat messagePUT /api/chat/context
: Update chat contextPOST /api/chat/lead
: Submit lead information
POST /api/auth/login
: User loginPOST /api/auth/refresh
: Refresh access tokenGET /api/auth/verify
: Verify token validity
To run the entire stack in Docker:
# Build and start all services
docker-compose up --build
# View logs
docker-compose logs -f
# Stop services
docker-compose down
Run the test suite:
pytest
chatbot_app/
├── api/ # Flask API server
│ ├── routes/ # API endpoints
│ ├── models/ # Data models
│ ├── services/ # Business logic
│ └── app.py # Application entry point
├── docker/ # Docker configuration
│ └── api/ # API service Dockerfile
├── tests/ # Test suite
├── .env # Environment variables
├── .gitignore # Git ignore rules
├── docker-compose.yml # Docker services configuration
├── requirements.txt # Python dependencies
└── README.md # Project documentation
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request