{"id":31931064,"url":"https://github.com/debapriya-source/opentrend","last_synced_at":"2025-10-14T04:17:10.799Z","repository":{"id":312589976,"uuid":"1047623836","full_name":"Debapriya-source/opentrend","owner":"Debapriya-source","description":null,"archived":false,"fork":false,"pushed_at":"2025-09-09T19:44:06.000Z","size":385,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-09T20:06:06.770Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Debapriya-source.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-30T20:48:53.000Z","updated_at":"2025-09-09T19:44:10.000Z","dependencies_parsed_at":"2025-08-31T19:32:46.952Z","dependency_job_id":null,"html_url":"https://github.com/Debapriya-source/opentrend","commit_stats":null,"previous_names":["debapriya-source/opentrend"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Debapriya-source/opentrend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Debapriya-source%2Fopentrend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Debapriya-source%2Fopentrend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Debapriya-source%2Fopentrend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Debapriya-source%2Fopentrend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Debapriya-source","download_url":"https://codeload.github.com/Debapriya-source/opentrend/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Debapriya-source%2Fopentrend/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279017985,"owners_count":26086213,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-14T04:17:07.613Z","updated_at":"2025-10-14T04:17:10.794Z","avatar_url":"https://github.com/Debapriya-source.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenTrend AI: Market Trend Analysis and Prediction Platform\n\nAn AI-powered platform to automatically identify, analyze, and predict market trends using various data sources.\n\n## 🚀 Features\n\n- **Automatic Trend Discovery**: Proactively identify emerging and declining market trends\n- **Multi-Source Analysis**: Combine financial data, news sentiment, and social media\n- **Real-time Processing**: Continuously monitor and update trend analysis\n- **AI/ML Analysis**: Time series forecasting, sentiment analysis, and trend identification\n- **Interactive Dashboard**: Streamlit-based dashboard for data visualization\n- **RESTful API**: Comprehensive API for data access and analysis\n\n## 🛠️ Tech Stack\n\n### Backend\n\n- **FastAPI**: High-performance web framework with automatic API documentation\n- **SQLModel**: Modern SQL database library with Pydantic integration\n- **PostgreSQL**: Primary relational database\n- **Redis**: Caching and session management\n- **InfluxDB**: Time-series database for market data\n- **MinIO**: Object storage for large datasets\n\n### AI/ML\n\n- **Pandas \u0026 NumPy**: Data processing and analysis\n- **Scikit-learn**: Traditional machine learning models\n- **Prophet**: Time series forecasting\n- **TensorFlow/PyTorch**: Deep learning models\n- **NLTK \u0026 spaCy**: Natural language processing\n- **Hugging Face Transformers**: Advanced NLP and sentiment analysis\n- **VADER**: Lexicon-based sentiment analysis\n\n### Frontend (MVP)\n\n- **Streamlit**: Rapid dashboard development\n- **Plotly**: Interactive visualizations\n- **Matplotlib \u0026 Seaborn**: Statistical graphics\n\n### Tooling\n\n- **ruff**: Linting/formatting\n\n## 📋 Prerequisites\n\n- Python 3.13+\n- SQLite by default (no setup required)\n- Optional services: PostgreSQL, Redis, InfluxDB\n- Docker (optional)\n\n## 🚀 Quick Start\n\n### 1. Clone the Repository\n\n```bash\ngit clone \u003crepository-url\u003e\ncd opentrend\n```\n\n### 2. Install Dependencies\n\n```bash\n# Install uv if not already installed\npip install uv\n\n# Install project dependencies\nuv sync\n```\n\n### 3. Environment Setup\n\n```bash\n# (Optional) Create a .env file to override defaults\n# Common keys:\n# SECRET_KEY=change-me\n# DATABASE_URL=sqlite:///./opentrend.db   # or a PostgreSQL URL\n# REDIS_URL=redis://localhost:6379        # optional\n# INFLUXDB_URL=http://localhost:8086      # optional\n# INFLUXDB_TOKEN=dev-token                # optional\n```\n\n### 4. Database Setup\n\n```bash\n# Create PostgreSQL database\ncreatedb opentrend\n\n# Start Redis (if not running)\nredis-server\n```\n\n### 5. Run the Application\n\n```bash\n# Start the FastAPI backend\npython main.py\n\n# Or using uvicorn directly\nuvicorn app.main:app --reload --host 0.0.0.0 --port 8000\n```\n\n### 6. Access the Application\n\n- **API Documentation**: http://localhost:8000/docs\n- **ReDoc Documentation**: http://localhost:8000/redoc\n- **Health Check**: http://localhost:8000/health\n\n## 📚 API Endpoints\n\n### Authentication\n\n- `POST /api/v1/auth/register` - Register new user\n- `POST /api/v1/auth/login` - User login\n- `GET /api/v1/auth/me` - Get current user info\n\n### Data Management\n\n- `POST /api/v1/data/ingest/market-data` - Ingest market data\n- `POST /api/v1/data/ingest/news` - Ingest news articles\n- `GET /api/v1/data/market-data/{symbol}` - Get market data\n- `GET /api/v1/data/news` - Get news articles\n\n### Analysis\n\n- `POST /api/v1/analysis/trends/analyze` - Analyze trends\n- `POST /api/v1/analysis/predictions/generate` - Generate predictions\n- `GET /api/v1/analysis/trends` - Get trend analyses\n- `GET /api/v1/analysis/predictions` - Get predictions\n- `GET /api/v1/analysis/sentiment/current` - Get current sentiment\n- `POST /api/v1/analysis/models/train` - Train models\n\n### Forecasting\n\n- `POST /api/v1/forecasting/prophet/{symbol}` - Prophet forecast\n- `POST /api/v1/forecasting/lstm/{symbol}` - LSTM forecast\n- `POST /api/v1/forecasting/ensemble/{symbol}` - Ensemble forecast\n- `GET /api/v1/forecasting/compare/{symbol}` - Compare Prophet/LSTM/Ensemble\n- `GET /api/v1/forecasting/batch` - Batch forecasting\n- `GET /api/v1/forecasting/models/status` - Model capabilities\n\n### LLM Insights\n\n- `POST /api/v1/llm/analyze/sentiment` - Analyze news sentiment\n- `GET /api/v1/llm/insights/{symbol}` - AI-powered market insights\n- `POST /api/v1/llm/analyze/enhanced-trend` - Enhanced trend analysis\n- `GET /api/v1/llm/insights/market-summary` - Multi-symbol summary\n- `GET /api/v1/llm/model-status` - LLM model status\n\n### Visualization\n\n- `GET /api/v1/visualization/price-chart/{symbol}` - Price charts\n- `GET /api/v1/visualization/technical-analysis/{symbol}` - TA chart\n- `POST /api/v1/visualization/forecast-chart` - Forecast visualization\n- `POST /api/v1/visualization/sentiment-chart` - Sentiment visualization\n- `GET /api/v1/visualization/correlation-matrix` - Correlation heatmap\n- `POST /api/v1/visualization/portfolio-performance` - Portfolio chart\n- `GET /api/v1/visualization/dashboard/{symbol}` - Combined dashboard\n- `GET /api/v1/visualization/chart-types` - Available charts\n\n### Time-series (optional InfluxDB)\n\n- `GET /api/v1/timeseries/market-data/{symbol}`\n- `GET /api/v1/timeseries/market-data/{symbol}/latest`\n- `GET /api/v1/timeseries/market-data/{symbol}/ohlcv`\n- `GET /api/v1/timeseries/market-data/multiple`\n- `GET /api/v1/timeseries/market-data/compare`\n- `GET /api/v1/timeseries/health`\n\n## 🏗️ Project Structure\n\n```\nopentrend/\n├── app/\n│   ├── api/\n│   │   ├── v1/\n│   │   │   ├── endpoints/\n│   │   │   │   ├── auth.py\n│   │   │   │   ├── data.py\n│   │   │   │   ├── analysis.py\n│   │   │   │   ├── forecasting.py\n│   │   │   │   ├── timeseries.py\n│   │   │   │   ├── llm_insights.py\n│   │   │   │   └── visualization.py\n│   │   │   └── api.py\n│   │   └── deps.py\n│   ├── core/\n│   │   ├── config.py\n│   │   ├── security.py\n│   │   └── logging.py\n│   ├── database/\n│   │   ├── connection.py\n│   │   └── models.py\n│   ├── services/\n│   │   ├── analysis_service.py\n│   │   ├── forecasting_service.py\n│   │   ├── llm_service.py\n│   │   ├── visualization_service.py\n│   │   ├── data_collector.py\n│   │   ├── influxdb_client.py\n│   │   └── scheduler.py\n│   └── main.py\n├── frontend/\n│   ├── advanced_streamlit_app.py\n│   └── README.md\n├── main.py\n├── pyproject.toml\n└── README.md\n```\n\n## 🔧 Configuration\n\nThe application uses environment variables for configuration. Key settings include:\n\n### Required\n\n- `SECRET_KEY`: Secret key for JWT tokens\n- `DATABASE_URL`: PostgreSQL connection string\n- `REDIS_URL`: Redis connection string\n\n### Optional\n\n- `DEBUG`: Enable debug mode\n- `LOG_LEVEL`: Logging level (INFO, DEBUG, WARNING, ERROR)\n- `ALPHA_VANTAGE_API_KEY`: Alpha Vantage API key for market data\n- `NEWS_API_KEY`: News API key for news articles\n- `TWITTER_BEARER_TOKEN`: Twitter API bearer token\n\n## 🧪 Development\n\n### Running Tests\n\n```bash\n# Install development dependencies\nuv sync --group dev\n\n# Run tests\npytest\n\n# Run with coverage\npytest --cov=app\n```\n\n### Code Quality\n\n```bash\n# Format code\nblack app/\n\n# Sort imports\nisort app/\n\n# Type checking\nmypy app/\n\n# Linting\nflake8 app/\n```\n\n### Pre-commit Hooks\n\n```bash\n# Install pre-commit hooks\npre-commit install\n```\n\n## 🐳 Docker Deployment\n\n### Using Docker Compose\n\n```bash\n# Build and start services\ndocker-compose up -d\n\n# View logs\ndocker-compose logs -f\n\n# Stop services\ndocker-compose down\n```\n\n### Start Advanced Frontend (after containers are up)\n\n```bash\n# Option A: Launch via helper script (uses port 8501)\npython run_advanced_frontend.py\n\n# Option B: Launch directly with Streamlit\nstreamlit run frontend/advanced_streamlit_app.py --server.port 8501\n```\n\nThe frontend connects to the backend at `http://localhost:8000` by default (exposed by Compose). See `frontend/README.md` for details and configuration options.\n\n### Manual Docker Build\n\n```bash\n# Build image\ndocker build -t opentrend .\n\n# Run container\ndocker run -p 8000:8000 --env-file .env opentrend\n```\n\n## 📊 Data Sources\n\n### Market Data\n\n- **Yahoo Finance**: Primary source via yfinance library\n- **Alpha Vantage**: Alternative source (requires API key)\n\n### News Sources\n\n- **Reuters**: Business news RSS feeds\n- **Bloomberg**: Market news RSS feeds\n- **Financial Times**: Financial news RSS feeds\n\n### Social Media\n\n- **Twitter**: Sentiment analysis (requires API key)\n- **Reddit**: Community sentiment (planned)\n\n## 🤝 Contributing\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## 🆘 Support\n\nFor support and questions:\n\n- Create an issue in the GitHub repository\n- Check the API documentation at `/docs`\n- Review the project outline in `project_outline.md`\n\n## 🔮 Roadmap\n\n### Phase 1: MVP (Current)\n\n- ✅ Basic FastAPI backend\n- ✅ Authentication system\n- ✅ Data ingestion endpoints\n- ✅ Basic analysis services\n- 🔄 Streamlit dashboard\n\n### Phase 2: Enhanced Features\n\n- 🔄 Advanced ML models\n- 🔄 Real-time data streaming\n- 🔄 Social media integration\n- 🔄 Advanced visualizations\n\n### Phase 3: Production Ready\n\n- 🔄 Kubernetes deployment\n- 🔄 Advanced monitoring\n- 🔄 Custom alerts\n- 🔄 Backtesting engine\n\n---\n\n**OpenTrend AI** - Empowering market insights through AI-driven analysis.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdebapriya-source%2Fopentrend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdebapriya-source%2Fopentrend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdebapriya-source%2Fopentrend/lists"}