How pipaliyameet/stockwise-insights works
StockWise is a stock-market analysis and prediction application. Users explore stock data and analytical views or request a next-day forecast; the prediction workflow fetches historical prices, prepares features, trains price and direction models, and returns results with history and evaluation metrics. The repository contains both a Python ML service behind an Express API and a frontend-side API handler with a JavaScript prediction engine. The README documents dashboard capabilities, but unsampled route and service code limits which frontend-to-API connections can be verified.
Main entry points: prediction_service.py Prediction orchestration · predictionController.js Prediction controller · api-handler.ts Frontend API handler · ml-engine.ts JavaScript ML engine
Components 19
Frontend experience
- Analysis pages
frontEnd/src/routes - Route setup
frontEnd/src/router.tsx - Frontend API handler
frontEnd/src/lib/api-handler.ts - JavaScript ML engine
frontEnd/src/lib/ml-engine.ts - Frontend server
frontEnd/src/server.ts
API and persistence
- Express server
backEnd/server.js - Prediction routes
backEnd/routes/predictionRoutes.js - Prediction controller
backEnd/controllers/predictionController.js - Database connection
backEnd/config/db.js - Prediction records
backEnd/models/predictionModel.js
Prediction pipeline
- Python ML server
ml-service/ml_server.py - Prediction orchestration
ml-service/prediction_service.py - Market data loading
ml-service/data_loader.py - Data preprocessing
ml-service/preprocessing.py - Linear regression
ml-service/linear_regression.py - KNN classification
ml-service/knn_classifier.py
Other components
- StockWise user
- Yahoo market data
- MongoDB
Connections 17
- Route setup → Analysis pages: loads routes
frontEnd/src/router.tsx - StockWise user → Analysis pages: explores
- Frontend server → Frontend API handler: dispatches API
frontEnd/src/server.ts - Frontend API handler → JavaScript ML engine: runs fallback
frontEnd/src/lib/api-handler.ts - JavaScript ML engine → Yahoo market data: fetches prices
frontEnd/src/lib/ml-engine.ts - Express server → Prediction routes: mounts routes
backEnd/server.js - Prediction routes → Prediction controller: routes requests
backEnd/routes/predictionRoutes.js - Prediction controller → Python ML server: requests predictions
backEnd/controllers/predictionController.js - Prediction controller → Database connection: connects database
backEnd/controllers/predictionController.js - Prediction controller → Prediction records: saves and queries
backEnd/controllers/predictionController.js - Database connection → MongoDB: connects
backEnd/config/db.js - Python ML server → Prediction orchestration: runs pipeline
ml-service/ml_server.py - Prediction orchestration → Market data loading: loads history
ml-service/prediction_service.py - Prediction orchestration → Data preprocessing: prepares features
ml-service/prediction_service.py - Prediction orchestration → Linear regression: trains and predicts
ml-service/prediction_service.py - Prediction orchestration → KNN classification: classifies direction
ml-service/prediction_service.py - Market data loading → Yahoo market data: fetches prices