An automated, AI-powered system designed for Wildberries marketplace sellers to manage, analyze, and reply to customer reviews and questions. Leveraging OpenAI GPT-4 and customizable rule engines, reAnswer automates customer support, maintains high ratings, and saves hours of manual work. It also provides messenger bot notifications (Telegram/MAX) and Yookassa payment integration.
- AI-Powered Answers: Generates polite, brand-aligned, and context-aware responses to reviews and questions using OpenAI's GPT models.
- Custom Reply Rules: Setup granular rules based on product rating, keywords, specific products, and auto-reply templates.
- Real-time Notifications: Telegram and MAX bot integrations send instant updates and support interactive callback quick-actions.
- Admin Dashboard: Manage database entities, audit logs, and users easily through an integrated SQLAdmin interface.
- Monetization: Built-in Yookassa payment gateway support for user subscriptions and packages.
- Bilingual Interface: Seamless translation switcher supporting both Russian and English locales.
- Framework: Next.js 16 (App Router) & React 19
- Styling: Tailwind CSS v4, Framer Motion (for smooth micro-animations)
- State Management: Zustand
- Icons & FX: Lucide React, Canvas Confetti
- API Framework: FastAPI (Python 3.11)
- Database & ORM: PostgreSQL 15, SQLAlchemy 2.0
- Database Admin: SQLAdmin 0.26 (WTForms-based admin panel)
- AI Engine: OpenAI Python Client (GPT-4 / GPT-5 reasoning models support)
- HTTP Clients: httpx, urllib3
- Authentication: JWT (JSON Web Tokens), bcrypt hashing
- Web Server: Nginx (handling reverse proxy routing to frontend and backend)
- Containerization: Docker & Docker Compose
├── src/ # Next.js frontend source code
│ ├── app/ # Frontend pages & layouts (landing, dashboard, settings, etc.)
│ ├── components/ # Reusable UI components
│ ├── hooks/ # Custom React hooks
│ ├── lib/ # Utility libraries & API client helpers
│ ├── locales/ # Translation dictionaries (ru.ts, en.ts)
│ └── store/ # Zustand global state stores
├── backend/ # FastAPI backend source code
│ ├── processor/ # Core business logic processors (controller, GPT integration)
│ │ ├── controller.py # Main loops to fetch and process reviews & questions
│ │ └── gpt.py # Async wrapper for OpenAI chat completions
│ ├── routers/ # API router endpoints (auth, rules, reviews, settings, etc.)
│ ├── services/ # Core service integrations (Yookassa, notifications, products)
│ ├── database.py # DB connection setup
│ ├── models.py # SQLAlchemy DB schemas
│ ├── controller_runner.py # Script to launch the background processing task
│ └── bot.py # Telegram & MAX bot runner and webhooks handler
├── nginx/ # Reverse proxy configurations
│ └── default.conf # Nginx routing rules mapping /api and /admin to backend
├── Dockerfile # Frontend Docker build
├── docker-compose.yml # Multi-container service orchestrator
└── backend/Dockerfile # Backend Docker build
Create a .env file in the root directory. Example configuration:
# Domain & API URL
DOMAIN=reanswer.ru
NEXT_PUBLIC_API_URL=https://reanswer.ru/api
# OpenAI API Key
OPENAI_API_KEY=your-openai-api-key
# Database Settings
DB_USER=user
DB_PASSWORD=your-secure-password
DB_NAME=autoreviews
DB_URL=postgresql://user:your-secure-password@db:5432/autoreviews
# Telegram & Messenger Bots
TG_BOT_TOKEN=your-telegram-bot-token
TG_BOT_NAME=your_telegram_bot_username
MAX_BOT_TOKEN=your-max-bot-token
MAX_BOT_NAME=your_max_bot_username
BOT_WEBHOOK_BASE_URL=https://reanswer.ru
BOT_WEBHOOK_SECRET=your-webhook-secret-token
# Admin panel
SQLADMIN_USERNAME=admin
SQLADMIN_PASSWORD=secure-admin-password
SQLADMIN_SECRET_KEY=some-random-secret-key
# YooKassa (Payments)
YOOKASSA_SHOP_ID=your-shop-id
YOOKASSA_SECRET_KEY=your-yookassa-secret-keyTo launch the entire application stack (Frontend, Backend, Database, Controller, Bots, and Nginx proxy) in production or local simulation mode:
- Clone the repository and navigate into it.
- Fill in the
.envfile. - Run the docker containers:
docker compose up --build
- Access the application in your browser:
- Web App:
http://localhost:8082(or the configuredDOMAIN) - Admin Panel:
http://localhost:8082/admin(usingSQLADMIN_USERNAMEandSQLADMIN_PASSWORD)
- Web App:
If you prefer to run services individually for debugging:
Ensure PostgreSQL is running and create a database matching your .env configuration.
Create a virtual environment, install requirements, and run the FastAPI server:
cd backend
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
# Start API server
uvicorn backend.main:app --host 127.0.0.1 --port 8000 --reloadIn separate terminals, run the controller and the messenger bot client:
# Start background worker/controller (fetches and replies to reviews)
python -m backend.controller_runner
# Start Telegram & MAX bot runner
python backend/bot.pyInstall npm dependencies and launch the Next.js development server:
# From the root directory
npm install
npm run devOpen http://localhost:3000 to access the frontend development build.
When the FastAPI server starts, it registers webhooks automatically with Telegram/MAX platforms if BOT_WEBHOOK_BASE_URL and BOT_WEBHOOK_SECRET are configured.
- Ensure your server is accessible via public HTTPS (e.g. through Nginx with SSL, Cloudflare, or Ngrok during local development).
- Bot callback queries are forwarded to the
/api/bot/webhook/{bot_type}/{secret}endpoint. - Interaction events will trigger immediate system replies or notify target admins.
This project is proprietary. All rights reserved.