How drag0nop/real-time-stock-prediction works
Project type and purpose
• This is a full‐stack web application for real‐time stock price prediction.
• It uses Flask as a backend REST API, an LSTM neural-network model for time-series forecasting, and a simple HTML/CSS/JavaScript frontend with Chart.js.
File structure
• Top-level files:
• app.py – Flask application and API endpoints
• config.py – API keys and configuration
• requirements.txt – Python dependencies
• Directories:
• models/ – ML model definition (model.py), training script (train.py), saved_models/
• utils/ – data_fetcher.py (Polygon.io integration), preprocessor.py
• static/ – frontend assets: css/style.css, js/main.js
• templates/ – Jinja2 HTML template index.html
README for additional insights
• Flask exposes an endpoint /api/predict that takes a ticker and horizon, returns JSON of forecasted prices.
• Frontend allows user input for ticker and period, calls the API, visualizes results via Chart.js.
• Data pipeline: fetch historical quotes → compute indicators (MA, RSI, MACD, Bollinger) → train or infer with LSTM → output.