Debate Server is the backend for the AI-Based Debate System, providing secure APIs, real-time debate handling, AI-driven argument segmentation, and evaluation modules.
It powers the Debate Client and manages all authentication, debate logic, and AI integrations.
- 🔐 User Authentication & Role Management — Register, login, logout, change/reset passwords, and manage roles (admin, participant, moderator).
- 💬 Real-Time Debate Chat — WebSocket-based debate communication with live message streaming.
- 🧩 Text Preprocessing & Argument Segmentation — Tokenization, stop-word removal, lemmatization, and AI-driven segmentation.
- 🧮 Argument Evaluation & Scoring — Intelligent argument quality assessment using transformer models.
- 📧 Email Service (Celery + Redis) — Handles password reset, email verification, and background tasks.
- ⚙️ Modular Architecture — Each feature isolated into independent modules for scalability and clarity.
| Layer | Technology |
|---|---|
| Framework | FastAPI |
| Task Queue | Celery |
| Message Broker | Redis |
| Database | PostgreSQL / SQLAlchemy |
| Migrations | Alembic |
| Auth | JWT / OAuth2 |
| FastAPI-Mail | |
| AI Modules | Transformers, spaCy, NLTK |
-
Clone the repository
git clone https://github.com/samiali12/debate-client.git cd debate-server -
Create and activate virtual environment
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt -
Configure environment variables
DATABASE_URL=mysql+pymysql://mysql:password@localhost:5432/debate_ai SECRET_KEY=your_secret_key ACCESS_TOKEN_EXPIRE_MINUTES=30 REDIS_URL=redis://localhost:6379/0 MAIL_USERNAME=youremail@example.com MAIL_PASSWORD=yourpassword MAIL_FROM=youremail@example.com MAIL_PORT=587 MAIL_SERVER=smtp.gmail.com -
Run database migrations
alembic upgrade head -
Start Celery worker
celery -A app.tasks.celery_worker.celery worker --loglevel=info -
Start the FastAPI server
uvicorn app.main:app --reload
This project is licensed under the MIT License — you are free to use and modify it.
Pull requests are welcome. For major changes, please open an issue first to discuss what you'd like to improve.