# Project Memory: cryptocurrency2 ## Project Overview **Name**: Crypto Intelligence Hub (cryptocurrency2) **Type**: Cryptocurrency data collection and analysis platform **Language**: Python **Framework**: Gradio (UI) + FastAPI (Backend) **Deployment**: Hugging Face Spaces (Docker) ## Key Features - 📊 Comprehensive dashboard for crypto data sources and AI models - 📚 Access to 200+ free cryptocurrency data sources - 🤖 Integration with Hugging Face AI models for sentiment analysis - 💭 Sentiment analysis using specialized financial and crypto models - 🔌 FastAPI backend for advanced services - 📡 WebSocket support for real-time data broadcasting ## Project Structure ### Main Entry Points - `app.py` - Main Gradio application (Hugging Face Space) - `api_server_extended.py` - FastAPI backend server - `hf_unified_server.py` - Unified Hugging Face server - `ai_models.py` - Hugging Face model management ### Key Directories - `api/` - API modules (auth, endpoints, websocket, data services) - `backend/` - Backend services and routers - `collectors/` - Data collectors (market data, news, sentiment, on-chain, whale tracking) - `database/` - Database management modules - `api-resources/` - JSON files containing API resources and configurations - `docs/` - Project documentation - `archive/` - Old/archived files ### Configuration Files - `config.py` - Application settings and Hugging Face model configurations - `requirements.txt` - General Python dependencies - `requirements_hf.txt` - Dependencies for Hugging Face Spaces - `Dockerfile` - Docker configuration for Hugging Face Spaces - `docker-compose.yml` - Docker Compose configuration ## AI Models Used - **FinBERT** (`ProsusAI/finbert`) - Financial sentiment analysis - **CryptoBERT** (`ElKulako/cryptobert`) - Cryptocurrency sentiment analysis - **Twitter-RoBERTa** (`cardiffnlp/twitter-roberta-base-sentiment-latest`) - Social media sentiment - **BART** (`facebook/bart-large-cnn`) - Text summarization ## Data Sources Supported ### Market Data - CoinGecko (free) - CoinMarketCap - Binance Public API - CoinCap - And more... ### Blockchain Explorers - Etherscan - BscScan - TronScan - Blockchair - And more... ### RPC Nodes - Infura - Alchemy - Ankr - PublicNode - And more... ## Key Data Files - `api-resources/crypto_resources_unified_2025-11-11.json` - Unified crypto resources - `all_apis_merged_2025.json` - Merged API configurations - `data/crypto_monitor.db` - SQLite database - `data/feature_flags.json` - Feature flags configuration ## Environment Variables - `HF_TOKEN` or `HUGGINGFACE_TOKEN` - Hugging Face authentication token - `USE_FASTAPI_HTML` - Toggle FastAPI+HTML mode (default: true in Docker) - `USE_GRADIO` - Toggle Gradio UI mode (default: false in Docker) - `DOCKER_CONTAINER` - Docker environment detection ## Deployment - **Primary**: Hugging Face Spaces (Docker) - **Port**: 7860 (default) - **SDK**: Docker - **License**: MIT ## Technology Stack - Python 3.x - Gradio (UI framework) - FastAPI (Backend API) - SQLite (Database) - Docker (Containerization) - Hugging Face Transformers (AI models) - Plotly (Visualization) - Pandas (Data processing) - WebSocket (Real-time communication) ## Key Components ### Collectors - Market data collectors - News collectors - Sentiment analyzers - On-chain data collectors - Whale tracking - RPC node managers - Blockchain explorers ### API Services - Authentication - Data endpoints - Pool endpoints - WebSocket services - Data broadcasting - Monitoring services - Integration services ### Database - SQLite database (`crypto_monitor.db`) - Database migrations - Data access layer - Models definitions ## Documentation Files - `README.md` - Main project documentation (Persian/English) - `PROJECT_STRUCTURE.md` - Project structure documentation - `DEPLOYMENT_CHECKLIST.md` - Deployment guide - `HF_DEPLOYMENT_QUICKSTART.md` - Hugging Face deployment quick start - Various component-specific READMEs in `docs/` directory ## Notes - Project supports both Persian and English languages - Uses free API sources primarily - Designed for Hugging Face Spaces deployment - Supports both Gradio UI and FastAPI+HTML modes - Real-time data updates via WebSocket - Comprehensive sentiment analysis capabilities