How osamarazzak/cryptocurrency-decision-support-system works
Project type and purpose
• This is a data-driven, single-page web application built with Streamlit.
• Purpose: provide investors with an interactive dashboard for fetching, preprocessing, clustering, correlation analysis, and forecasting of cryptocurrency price data.
File structure
• Top level:
• app.py → Streamlit entry point, ties UI widgets to backend logic
• requirements.txt/.gitignore/README.md
• src/ subfolders:
• src/data → data_fetcher.py (API calls), data_preprocessing.py, correlation.py, pca_kmean.py
• src/models → forecasting_models.py (ARIMA, Prophet, LSTM, XGBoost)
• src/utils → helper.py (common functions), visualization.py (chart building)
README for additional insights
• Confirms the data pipeline: fetch historical data → clean/transform → PCA+KMeans clustering → correlation heatmap → forecasting via multiple ML models → Streamlit visualization.
Main components and relationships
a. Components
1. User Interface (UI)
– Streamlit front end defined in app.py
2. Data Layer
– DataFetcher (external API)
– Preprocessor (clean, fill missing, feature engineering)
3. Analytics Layer
– Clustering (PCA + KMeans)
– Correlation analysis
4. Forecasting Layer
– ARIMA, Prophet, LSTM, XGBoost implementations
5. Visualization Layer
– Streamlit charts (time-series plots, heatmaps, cluster scatter)
6. Utilities
– Helper functions (caching, logging)
b. Relationships & Data flow
– User interacts with UI → UI triggers backend functions in app.py
– app.py → calls DataFetcher → returns raw price series
– raw data → DataPreprocessor → returns cleaned DataFrame
– cleaned data → split into two parallel flows:
(i) → PCA/KMeans (clustering) → cluster results
(ii) → correlation.py → correlation matrix
– cleaned data + user timeframe → forecasting_models.py → predictions
– All results → visualization.py → chart objects → Streamlit UI
c. Architectural patterns
– “Separation of concerns”: UI, data access, analytics, forecasting, and visualization each in its own module.
– Pipeline pattern: sequential data transformations feeding into analytics/forecasting.
– Modular design: swap in/out forecasting algorithms with minimal UI changes.
d. Key technologies & libraries
– Python 3.x, Streamlit
– Data science: pandas, numpy, scikit-learn (PCA, KMeans), pmdarima/ARIMA, fbprophet, tensorflow/keras (LSTM), xgboost
– Visualization: matplotlib, seaborn, Plotly (via Streamlit)
Essential elements
• Clear labels for each module/component
• Data modules (green)
• Analytics/Forecasting (orange)
• Utils & external services (gray)