How sushil3710/btpinit works
Project type and purpose
• This is a full-stack stock-forecasting application with three main tiers:
a. A React-based frontend (“client”) for interactive charts and controls.
b. A Node.js/Express backend API (“server”) handling HTTP requests and orchestrating data.
c. A Python data-science/ML layer (“python” folder) that fetches historical stock data, trains/predicts with ARIMA/LSTM/GCN models, and persists results.
• The README confirms use of yfinance/yahoo_fin for data ingestion, Flask/plotly for visualizations in Python (e.g., notebooks), and MongoDB (pymongo) for storage.
File structure
• Top-level:
– client/ (React app with components under src/components)
– server/ (Node.js Express endpoints in index.js, getStock.js, getDate.js)
– python/ (data-fetch and modeling scripts, subfolder gcn for custom Graph Convolutional Network library)
– requirements.txt / package.json for dependency management
– btp2.ipynb for exploratory analysis or reporting
• Patterns:
– MVC-like separation: frontend views → backend controllers → python “model” logic → database
– python/gcn is a standalone library that can be imported by other Python scripts
README for additional insights
• Dependencies including Flask and plotly suggest some Python scripts (or a small Flask app) may expose a secondary API or serve dashboards.
• Instructions for dropping “predicted” collections in MongoDB imply that ML outputs are saved back into the database for retrieval.
a. Main components (containers):
1. Frontend (React SPA)
2. Backend API (Node.js/Express)
3. ML/Processing Services (Python scripts & Flask if used)
4. Data Store (MongoDB)
5. External Services (Yahoo Finance via yfinance/yahoo_fin APIs)
6. Development/Notebook Environment (Jupyter btp2.ipynb)
b. Relationships & data flows:
• React → HTTP(S) calls → Express endpoints (getStock, getDate)
• Express → Queries/updates → MongoDB
• Express → Spawns or forwards to → Python ML services (e.g., via REST/CLI invocation or message queue)
• Python ML → Fetches historical data → External Yahoo API
• Python ML → Trains models (ARIMA, LSTM, GCN) → Persists predictions → MongoDB
• React ← Receives JSON data ← Express ← Reads predictions from MongoDB
• Notebook (btp2.ipynb) ← Directly queries MongoDB or runs Python scripts for ad-hoc analysis
c. Architectural patterns & design principles:
– Separation of concerns: UI vs business logic vs data processing
– Modular ML library (python/gcn) packaged for reuse
– RESTful API between layers
– Asynchronous data pipelines (data pull & model training can be scheduled or triggered)
d. Key technologies & frameworks:
– Frontend: React, React-Router, Tailwind CSS, lightweight-charts
– Backend: Node.js, Express.js, yfinance/yahoo_fin (via Python), pymongo
– ML: pandas, openpyxl (for Excel), numpy, scipy, TensorFlow/PyTorch (as needed), custom GCN library
– Database: MongoDB