AI-powered application prototypes with model integration, APIs, databases, and deployable interfaces.
A collection of intelligent bots built with state-of-the-art transformer models and real-time data processing pipelines, ready for production deployment.
- Overview
- Projects
- Tech Stack
- Quick Start
- Project Structure
- Features
- Installation
- Usage
- Deployment
- Development
- Contributing
- License
Bots is a comprehensive repository showcasing multiple AI-powered bot implementations:
- T5 Bot: Advanced text-to-text generation (summarization, translation) using Google's T5 model
- CandleBot: Real-time forex candlestick data collection and persistence with intelligent failover
Each bot demonstrates production-ready patterns including REST APIs, database integration, containerization, and scalable deployment configurations.
A full-stack NLP application that uses Google's T5 (Text-to-Text Transfer Transformer) model to perform advanced text operations.
Capabilities:
- 📝 Text Summarization
- 🌍 Multi-language Translation (English, French, German)
- 🔄 Chained Operations (summarize → translate)
Architecture:
- Backend: FastAPI with async support
- Frontend: React 18 with Vite
- Database: PostgreSQL
- ML Framework: PyTorch + Hugging Face Transformers
Key Files:
T5/T5_Bot/app.py- Flask application with T5 endpointsT5/requirements.txt- Python dependenciesT5/docker-compose.yml- Full stack orchestration
A specialized bot for capturing financial market data in real-time from MetaTrader 5, with built-in resilience for network failures.
Capabilities:
- 📊 Real-time 1-minute candlestick data collection from EURUSD
- 💾 Persistent storage to SQL Server
- 🔄 Automatic offline mode with sync on reconnection
- 📝 Comprehensive logging and error tracking
Key Files:
CandleBot/save_realtime_candles.py- Main data collection script
- Python 3.10+ - Core language
- FastAPI - Modern async web framework
- Flask - Lightweight alternative for T5_Bot
- PyTorch 2.1+ - Deep learning framework
- Transformers 4.30+ - NLP models (Hugging Face)
- SQLAlchemy 2.0+ - ORM for database interactions
- Uvicorn - ASGI server
- PostgreSQL 15 - Primary data store
- SQL Server - CandleBot data persistence
- React 18 - UI library
- Vite - Build tool and dev server
- Axios - HTTP client
- React Router - Client-side routing
- Docker - Containerization
- Docker Compose - Multi-container orchestration
- pytest - Testing framework
- Black - Code formatting
- Flake8 - Linting
- mypy - Type checking
# Clone the repository
git clone https://github.com/Maee127/Bots.git
cd Bots/T5
# Configure environment
cp .env.example .env
# Edit .env with your settings (DB credentials, API host, debug mode, etc.)
# Start all services (Postgres, API, Frontend)
docker-compose up --build
# Services will be available at:
# - API: http://localhost:8000
# - Frontend: http://localhost:5173
# - PostgreSQL: localhost:5432cd Bots/T5
# Create virtual environment
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Configure environment
cp .env.example .env
# Run FastAPI server
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
# In another terminal, start frontend
cd frontend
npm install
npm run devcd Bots/CandleBot
# Install dependencies
pip install MetaTrader5 pyodbc pandas
# Configure SQL Server connection in save_realtime_candles.py
# Update the connection string with your database credentials
# Run the bot
python save_realtime_candles.pyBots/
├── T5/ # T5 Text-to-Text Bot
│ ├── T5_Bot/ # Flask application
│ │ ├── app.py # Main Flask app with ML endpoints
│ │ ├── templates/ # HTML templates
│ │ │ └── index.html # Web interface
│ │ ├── static/ # Frontend assets
│ │ │ ├── style.css # Styling
│ │ │ ├── script.js # Client-side logic
│ │ │ └── assets/ # Images and resources
│ │ └── requirements.txt # Project dependencies
│ ├── frontend/ # React application (Vite)
│ │ ├── src/ # React components
│ │ ├── public/ # Static assets
│ │ ├── vite.config.js # Vite configuration
│ │ └── package.json # NPM dependencies
│ ├── app/ # FastAPI application (planned)
│ │ └── main.py # FastAPI entry point
│ ├── requirements.txt # Python dependencies
│ ├── pyproject.toml # Project configuration
│ ├── setup.py # Python package setup
│ ├── Dockerfile # Multi-stage build
│ ├── docker-compose.yml # Full stack composition
│ ├── .env.example # Environment variables template
│ └── README.md # T5 Bot documentation
│
├── CandleBot/ # Forex Data Collection Bot
│ ├── save_realtime_candles.py # Main data collection script
│ ├── logs/ # Log directory
│ └── EURUSD_candle_logger.log # Log file
│
├── README.md # This file
└── .gitignore # Git ignore rules
- ✅ Text Summarization - Condense long texts while preserving meaning
- ✅ Multi-language Translation - Translate between English, French, and German
- ✅ Chained Operations - Summarize then translate in one workflow
- ✅ REST API - FastAPI endpoints for programmatic access
- ✅ Web UI - React-based user interface
- ✅ Database Integration - Store and retrieve operations
- ✅ Containerized - Docker support for easy deployment
- ✅ Scalable - Async processing with uvicorn
- ✅ Real-time Data - 1-minute candlestick data from MetaTrader 5
- ✅ Persistent Storage - SQL Server integration
- ✅ Offline Resilience - JSON fallback when database is unavailable
- ✅ Auto-sync - Automatic data synchronization on reconnection
- ✅ Comprehensive Logging - Detailed logs for monitoring and debugging
- ✅ Error Handling - Graceful failure recovery
- Python 3.10+ - Core runtime
- Node.js 16+ - Frontend build tools
- Docker & Docker Compose - For containerized deployment
- PostgreSQL - For T5 Bot database (or use Docker image)
- SQL Server - For CandleBot (optional, uses offline fallback if unavailable)
git clone https://github.com/Maee127/Bots.git
cd BotsOption A: Docker Compose (Recommended)
cd T5
cp .env.example .env
docker-compose up --buildOption B: Local Development
cd T5
# Python setup
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
# Frontend setup
cd frontend
npm install
# Back to T5 root
cd ..cd CandleBot
pip install MetaTrader5 pyodbc pandas
# Configure database connection in save_realtime_candles.pyVia REST API:
curl -X POST http://localhost:8000/api/summarize \
-H "Content-Type: application/json" \
-d '{
"text": "Your long text here that you want to summarize..."
}'Via Web UI:
- Navigate to
http://localhost:5173 - Enter text in the input area
- Click "Summarize in Original Language"
- View results in the output box
Via REST API:
curl -X POST http://localhost:8000/api/translate \
-H "Content-Type: application/json" \
-d '{
"text": "Hello, how are you?",
"source_language": "English",
"target_language": "French"
}'Via Web UI:
- Select source and target languages
- Enter text
- Click "Translate Original Text"
- View translated result
- Summarize text
- Translate the summary to another language
- Click "Translate Summary"
cd CandleBot
python save_realtime_candles.pyWhat it does:
- Connects to MetaTrader 5
- Fetches EURUSD 1-minute candles
- Stores in SQL Server
- Falls back to JSON file if database unavailable
- Syncs offline data when connection restored
- Logs all operations to
EURUSD_candle_logger.log
Build Image:
cd T5
docker build -t bots:latest .Run Container:
docker run -p 8000:8000 \
-e DATABASE_URL="postgresql://user:pass@postgres:5432/bots" \
-e DEBUG=false \
bots:latestcd T5
docker-compose up -dEnvironment Configuration (.env):
# Database
DB_USER=bots_user
DB_PASSWORD=secure_password_here
DB_NAME=bots
# API
PYTHON_ENV=production
DEBUG=false
API_HOST=0.0.0.0
API_PORT=8000
# Frontend
VITE_API_URL=https://your-api-domain.comThe repository is structured for easy deployment to:
- AWS (ECS, Lambda, RDS)
- Google Cloud (Cloud Run, Cloud SQL)
- Azure (Container Instances, PostgreSQL)
- Heroku (with Procfile)
- Kubernetes (with Helm charts)
cd T5
# Run all tests
pytest
# Run with coverage
pytest --cov=app
# Run specific test file
pytest tests/test_bot.pycd T5
# Format code with Black
black .
# Lint with Flake8
flake8 .
# Type check with mypy
mypy .
# Frontend linting
cd frontend
npm run lint
npm run formatcd T5
# Terminal 1: Backend
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
# Terminal 2: Frontend
cd frontend
npm run devOnce the FastAPI server is running:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
We welcome contributions! Please follow these steps:
-
Fork the repository
git clone https://github.com/yourusername/Bots.git cd Bots -
Create a feature branch
git checkout -b feature/amazing-feature
-
Make your changes
- Write clean, well-documented code
- Add tests for new functionality
- Follow the existing code style (Black, Flake8)
-
Commit your changes
git commit -m 'Add amazing feature' -
Push to your fork
git push origin feature/amazing-feature
-
Open a Pull Request
- Provide a clear description of changes
- Link any related issues
- Include screenshots for UI changes
- Use Black for Python formatting
- Use Prettier for JavaScript formatting
- Write type hints for Python functions
- Add docstrings to classes and functions
- Keep lines under 88 characters (Black default)
This project is licensed under the MIT License - see the LICENSE file for details.
You are free to use, modify, and distribute this software for any purpose, including commercial use.
Maee127 - GitHub Profile
- Hugging Face Transformers - NLP model library
- FastAPI - Web framework
- React - UI library
- PyTorch - Deep learning framework
- Docker - Containerization platform
- PostgreSQL - Database
- Vite - Frontend build tool
- Report a Bug: Open an Issue
- Request a Feature: Create a Discussion
- Ask a Question: GitHub Discussions
- Language: Python (58%), CSS (16.1%), HTML (10%), JavaScript (9.1%), Dockerfile (6.8%)
- Repository: Maee127/Bots
- License: MIT
- Status: Active Development
- Enhanced FastAPI backend with full OpenAPI documentation
- Advanced model fine-tuning and custom training pipelines
- Real-time WebSocket support for live updates
- Multi-model orchestration (BERT, GPT, T5 variants)
- Production-grade monitoring and observability
- Kubernetes deployment manifests
- CI/CD pipeline with GitHub Actions
- Performance optimization and caching layer
Made by MAedeh Torkian: Maee127
This README includes:
- ✅ Clear project overview
- ✅ Detailed quick start guides for both projects
- ✅ Complete tech stack documentation
- ✅ Installation and setup instructions
- ✅ Usage examples with code snippets
- ✅ Deployment guidelines
- ✅ Development workflow
- ✅ Contributing guidelines
- ✅ Professional structure and formatting
- ✅ Links to resources and support
You can now copy this and create your `README.md` file in the root of your repository!