Skip to content

This platform provides comprehensive time series analysis and forecasting for financial markets. It combines statistical modeling (ARIMA), interactive visualizations, and a modern web interface into a containerized application ready for cloud deployment.

License

Notifications You must be signed in to change notification settings

cogentdom/architecture-fullstack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

50 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“ˆ Financial Time Series Analytics Platform

A full-stack financial analytics dashboard featuring real-time stock market data analysis, ARIMA forecasting models, and interactive visualizationsβ€”containerized with Docker and deployable to AWS EC2 with custom domain support.

Watch the video

Python Streamlit Docker License

🌟 Overview

This platform provides comprehensive time series analysis and forecasting for financial markets. It combines statistical modeling (ARIMA), interactive visualizations, and a modern web interface into a containerized application ready for cloud deployment.

Key Achievement: Solved complex Docker volume mounting and composition challenges for seamless data persistence across environmentsβ€”from development to production on AWS EC2.

✨ Features

πŸ“Š Analytics & Modeling

  • Real-time Stock Data: Live market data fetching via Yahoo Finance API
  • ARIMA Forecasting: Time series prediction with configurable parameters (p, d, q)
  • Statistical Analysis:
    • Moving averages and volatility metrics
    • Returns analysis and distribution modeling
    • Autocorrelation and partial autocorrelation functions
    • Seasonal decomposition (trend, seasonal, residual)
  • Normality Testing: Shapiro-Wilk and visual Q-Q plots

πŸ“ˆ Interactive Visualizations

  • Multi-panel Dashboard: Candlestick charts, volume analysis, price movements
  • Technical Indicators: Rolling means, Bollinger bands, volatility measures
  • Forecast Visualization: Model predictions with confidence intervals
  • Diagnostic Plots: Residual analysis, ACF/PACF plots, decomposition charts

🎨 User Interface

  • Modern Streamlit Dashboard: Responsive layout with intuitive controls
  • Ticker Selection: Quick-select popular stocks or enter custom symbols
  • Date Range Filtering: Analyze specific time periods
  • Customizable Visualizations: Adjustable parameters and color schemes
  • Real-time Updates: Dynamic data refresh on selection changes

πŸ—οΈ Architecture & Deployment

  • Dockerized Application: Containerized setup for easy deployment
  • AWS EC2 Deployment: Production-ready cloud infrastructure
  • Custom Domain: Cloudflare DNS integration for professional access
  • Data Persistence: Volume mounting for environment consistency
  • CI/CD Ready: Makefile automation for builds and deployments

πŸš€ Quick Start

Prerequisites

# System Requirements
- Python 3.8+
- Docker & Docker Compose
- Git

Local Development

  1. Clone the repository
git clone https://github.com/yourusername/architecture-fullstack.git
cd architecture-fullstack
  1. Set up Python environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -r requirements.txt
  1. Run the dashboard locally
streamlit run main.py

The dashboard will open at http://localhost:8501

Docker Deployment

  1. Build and run with Docker Compose
docker-compose up --build
  1. Access the application
  • Dashboard: http://localhost:8501

Using the Makefile

# Build new image
make build_new

# Build and publish to Docker Hub
make drhub

# Build and publish to GitHub Container Registry
make git

πŸ“ Project Structure

architecture-fullstack/
β”œβ”€β”€ main.py                 # Main Streamlit application
β”œβ”€β”€ datamover.py           # Data fetching and preprocessing utilities
β”œβ”€β”€ requirements.txt       # Python dependencies
β”œβ”€β”€ Dockerfile            # Container image definition
β”œβ”€β”€ docker-compose.yaml   # Container orchestration
β”œβ”€β”€ Makefile             # Build and deployment automation
β”œβ”€β”€ dev_folder/          # Development notebooks and data
β”‚   β”œβ”€β”€ dev_notebook.ipynb
β”‚   └── timeseries_analysis.ipynb
└── .streamlit/          # Streamlit configuration
    └── config.toml

πŸ› οΈ Technology Stack

Core Technologies

  • Python 3.8+: Primary programming language
  • Streamlit: Interactive web application framework
  • Pandas & NumPy: Data manipulation and numerical computing
  • yfinance: Yahoo Finance API wrapper for real-time market data

Analytics & Modeling

  • statsmodels: ARIMA time series forecasting
  • SciPy: Statistical analysis and testing
  • scikit-learn: Additional ML utilities

Visualization

  • Plotly: Interactive charts and graphs
  • Matplotlib & Seaborn: Statistical visualizations
  • mplfinance: Financial-specific chart types (candlesticks, volume)

DevOps & Infrastructure

  • Docker: Containerization platform
  • Docker Compose: Container orchestration
  • AWS EC2: Cloud compute instance
  • Cloudflare: DNS and CDN services

πŸ“Š Usage Examples

Analyzing a Stock

  1. Select a ticker from the sidebar (AAPL, GOOG, MSFT, TSLA) or enter a custom symbol
  2. Choose your date range using the date pickers
  3. Explore the visualizations:
    • Historical price data and volume
    • Statistical metrics and distributions
    • ARIMA forecast predictions
    • Decomposition analysis

ARIMA Model Configuration

The dashboard allows you to adjust ARIMA parameters:

  • p (AR order): Number of lag observations
  • d (Differencing): Degree of differencing
  • q (MA order): Size of moving average window

Forecast Horizon

Set the number of days to forecast into the future (1-90 days).

πŸ›οΈ Architecture

Application Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   User Browser  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚
    β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚  Streamlit  β”‚ (Port 8501)
    β”‚  Dashboard  β”‚
    β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚
    β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚  yfinance   β”‚
    β”‚     API     β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Data Flow

  1. Data Ingestion: Real-time stock data fetched via Yahoo Finance API
  2. Processing: Data cleaning, transformation, and feature engineering
  3. Analysis: Statistical analysis and ARIMA model training
  4. Visualization: Interactive charts rendered in Streamlit
  5. Deployment: Containerized application ready for cloud deployment

🌐 Deployment to AWS

EC2 Setup

  1. Launch EC2 Instance

    • AMI: Ubuntu 20.04 LTS
    • Instance Type: t2.micro or larger
    • Security Group: Open port 8501
  2. Install Docker

sudo apt-get update
sudo apt-get install docker.io docker-compose
sudo usermod -aG docker ubuntu
  1. Deploy Application
git clone <your-repo>
cd architecture-fullstack
docker-compose up -d
  1. Configure Domain (Optional)
    • Point your domain to the EC2 instance IP in Cloudflare DNS

πŸ§ͺ Development

Running Jupyter Notebooks

The dev_folder/ contains Jupyter notebooks for experimentation:

cd dev_folder
jupyter notebook

Adding New Features

  1. Create a new branch
  2. Implement your feature in main.py or create new modules
  3. Test locally with streamlit run main.py
  4. Update tests and documentation
  5. Submit a pull request

πŸ› Troubleshooting

Common Issues

Port already in use

# Kill process on port 8501
lsof -ti:8501 | xargs kill -9

Docker volume issues

# Remove all containers and volumes
docker-compose down -v
docker system prune -a

yfinance data not loading

  • Check your internet connection
  • Verify ticker symbol is valid
  • Yahoo Finance may temporarily rate-limit requests

πŸ“ Configuration

Streamlit Configuration

Edit .streamlit/config.toml to customize:

  • Theme colors
  • Server settings
  • Browser behavior

Docker Configuration

Modify docker-compose.yaml to adjust:

  • Port mappings
  • Volume mounts
  • Resource limits

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes:

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

πŸ“§ Contact

Dominik Huffield
Twitter - @cogentdom
My Work - portfolio
Business - ohmic data

Project Link: architecture-fullstack


⭐ If you found this project helpful, please consider giving it a star!

About

This platform provides comprehensive time series analysis and forecasting for financial markets. It combines statistical modeling (ARIMA), interactive visualizations, and a modern web interface into a containerized application ready for cloud deployment.

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors