How jatin-mehra119/crypto-intelligence-pro works
Project Type & Purpose
• Crypto Intelligence Pro is a single‐page, data‐driven market analysis tool built with Python and Streamlit. It exposes a web UI (“frontend”) that ties into a service layer (“backend”) for real‐time data fetching, sentiment analysis, technical indicator computation, and AI forecasting.
Main Components
a. Frontend (Streamlit App)
• app/main.py – Streamlit entry point and UI layout
• app/models.py – Pydantic models for request/response schemas
b. Service Layer (Business Logic)
• app/services/data_fetcher.py – Retrieves/caches OHLC data from the CoinGecko API
• app/services/crypto_analyzer.py –
– Scrapes or fetches news articles (via Playwright under the hood)
– Submits text to Groq AI for sentiment and market‐forecasting
c. Utility Layer
• app/utils/visualization.py – Generates Plotly charts (line, candlestick, pie)
d. Configuration
• app/config.py – Reads environment variables (GROQ_API_KEY, etc.)
e. Infrastructure
• Dockerfile / Dockerfile_GCP – Container build for local/GCP Cloud Run
• .github/workflows/push_to_hf.yaml – CI/CD workflow deploying code & docs to Hugging Face Spaces (and optionally triggering GCP builds)
• Google Cloud Run – Hosts the containerized Streamlit service
f. External Services
• CoinGecko REST API
• Groq AI inference endpoint
• News sources (web pages via Playwright)
Relationships & Data Flow
1) User’s Browser ⇨ Streamlit UI (app/main.py)
2) UI events invoke Service Layer methods
3) DataFetcher calls CoinGecko ⇨ returns price data
4) CryptoAnalyzer scrapes/fetches articles ⇨ calls Groq API for sentiment & forecasting
5) Business logic returns raw & processed data to the UI
6) Visualization utils render charts and dashboards
7) Results displayed in the browser
Architectural Patterns & Principles
• Layered Architecture: clear separation of presentation, business logic, and utilities
• Single‐container microservice: all Python code in one Docker image
• External integration points abstracted behind service interfaces
• CI/CD via GitHub Actions pushing to Hugging Face Spaces and triggers GCP deployment
Must‐Have Elements
• Visual separation of internal vs external vs infra
• Notation of environment/configuration injection point