Skip to content

12StoneDesigns/Chatbot_Builder

Repository files navigation

Client Chatbot

A comprehensive chatbot system with real-time chat capabilities, lead generation, and admin dashboard.

System Components

  1. API Server (Flask): Handles chat interactions and real-time messaging
  2. Chat Engine: Processes messages and generates responses
  3. Admin Dashboard: Manages leads and bot configuration
  4. Client Widget: Embeddable chat interface

Prerequisites

  • Python 3.9+
  • Docker and Docker Compose
  • PostgreSQL
  • Redis

Local Development Setup

  1. Clone the repository:
git clone <repository-url>
cd chatbot_app
  1. Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt
  1. 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

  1. Start the development services:
docker-compose up -d
  1. Run the Flask development server:
flask run

The API will be available at http://localhost:5000

API Endpoints

Chat API

  • POST /api/chat/message: Send a chat message
  • PUT /api/chat/context: Update chat context
  • POST /api/chat/lead: Submit lead information

Authentication

  • POST /api/auth/login: User login
  • POST /api/auth/refresh: Refresh access token
  • GET /api/auth/verify: Verify token validity

Docker Development

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

Testing

Run the test suite:

pytest

Project Structure

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

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

License

MIT License

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published