diff --git a/README.md b/README.md index 739504c..7e84c63 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,61 @@ --- +## Быстрый старт (локальный Docker) + +```bash +# 1. Клонировать репозиторий +git clone https://git.itoservice.ru/dosnav/support-bot-saas.git +cd support-bot-saas + +# 2. Создать backend/.env из шаблона +cp backend/.env.example backend/.env +# отредактировать backend/.env — указать OPENROUTER_API_KEY и JWT_SECRET + +# 3. Запустить +docker compose up --build -d +``` + +После запуска веб-интерфейс доступен по адресу: **http://localhost:8080** + +### Первый вход + +1. Открой **http://localhost:8080** в браузере +2. Зарегистрируйся (Email + пароль, тариф free) +3. После регистрации автоматически войдёшь в систему +4. Создай коллекцию (например «OFRS») +5. Загрузи JSON-файл с тикетами через кнопку «Выбрать JSON/CSV файл» + +Формат JSON: +```json +[ + { + "ticket_id": "12345", + "category": "Сбой работы", + "description": "Описание проблемы", + "client": "Имя клиента", + "messages": [ + {"role": "client", "text": "У меня проблема"}, + {"role": "support", "text": "Решение проблемы"} + ] + } +] +``` + +6. После загрузки тикетов введи вопрос в поле поиска и нажми «Найти» + +Система найдёт похожие тикеты, а LLM сформирует ответ на их основе. + +### Остановка + +```bash +docker compose down +# С данными: +docker compose down -v +``` + +--- + ## Архитектура ``` @@ -296,6 +351,8 @@ support-bot-saas/ │ ├── 00-namespace.yaml │ ├── 01-postgres.yaml ... 06-ingress.yaml │ └── traefik/ # Traefik CRDs + Deployment +├── docker-compose.yml # локальный запуск (Docker) ├── tickets*.json # тестовые данные -└── README.md +├── README.md +└── backend/.env.example # шаблон .env для бэкенда ``` diff --git a/docker-compose.yml b/docker-compose.yml index da0dba1..ff45743 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,55 +1,58 @@ services: postgres: - image: postgres:16-alpine + image: postgres:16 environment: - POSTGRES_DB: support_bot POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres - ports: - - "5432:5432" + POSTGRES_DB: support_bot volumes: - pgdata:/var/lib/postgresql/data + healthcheck: + test: ["CMD-SHELL", "pg_isready -U postgres"] + interval: 5s + timeout: 3s + retries: 10 redis: image: redis:7-alpine - ports: - - "6379:6379" + healthcheck: + test: ["CMD", "redis-cli", "ping"] + interval: 5s + timeout: 3s + retries: 10 qdrant: - image: qdrant/qdrant:latest - ports: - - "6333:6333" - - "6334:6334" + image: qdrant/qdrant volumes: - - qdrant_data:/qdrant/storage + - qdrant_storage:/qdrant/storage + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:6333/healthz"] + interval: 5s + timeout: 3s + retries: 10 backend: build: ./backend - ports: - - "8000:8000" - env_file: .env + env_file: ./backend/.env environment: - - DATABASE_URL=postgresql+asyncpg://postgres:postgres@postgres:5432/support_bot - - REDIS_URL=redis://redis:6379/0 - - QDRANT_URL=http://qdrant:6333 + DATABASE_URL: postgresql+asyncpg://postgres:postgres@postgres:5432/support_bot + REDIS_URL: redis://redis:6379/0 + QDRANT_URL: http://qdrant:6333 depends_on: - - postgres - - redis - - qdrant + postgres: + condition: service_healthy + redis: + condition: service_healthy + qdrant: + condition: service_healthy - worker: - build: ./backend - command: celery -A app.workers.process_file worker --loglevel=info - env_file: .env - environment: - - DATABASE_URL=postgresql+asyncpg://postgres:postgres@postgres:5432/support_bot - - REDIS_URL=redis://redis:6379/0 - - QDRANT_URL=http://qdrant:6333 + frontend: + build: ./frontend + ports: + - "8080:80" depends_on: - - postgres - - redis - - qdrant + - backend volumes: pgdata: - qdrant_data: + qdrant_storage: