AI-powered real-time stock analysis for NSE/BSE markets with ML predictions, technical indicators, and sentiment analysis.
- ๐ Real-Time Dashboard โ Live stock prices, charts, and market indices (NIFTY 50, SENSEX, Bank NIFTY)
- ๐ค ML Predictions โ Ensemble predictions using LSTM, XGBoost, and Prophet models
- ๐ Technical Indicators โ 25+ indicators including RSI, MACD, Bollinger Bands, ADX, OBV
- ๐ฐ News & Sentiment โ Aggregated news from Economic Times, MoneyControl, Business Standard with NLP sentiment scoring
- ๐ฏ Trading Signals โ AI-generated BUY/SELL/HOLD signals with confidence scores
- โก WebSocket Updates โ Real-time price streaming via Socket.IO
- ๐ฎ๐ณ Indian Market Focus โ Top 20 NSE stocks, market hours aware scheduling
โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ
โ Frontend โโโโโโถโ Backend โโโโโโถโ ML Service โ
โ React/Vite โ โ Express/TS โ โ FastAPI โ
โ :80/443 โ โ :4000 โ โ :8000 โ
โโโโโโโโโโโโโโโโ โโโโโโโโฌโโโโโโโโ โโโโโโโโฌโโโโโโโโ
โ โ
โโโโโโโโดโโโโโโโโ โโโโโโโโดโโโโโโโโ
โ TimescaleDB โ โData Pipeline โ
โ PostgreSQL โ โ Scheduler โ
โ :5432 โ โ (Python) โ
โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโ
โ Redis โ
โ :6379 โ
โโโโโโโโโโโโโโโโ
The fastest way to get running โ everything in one command:
# 1. Clone the repository
git clone https://github.com/adarshvermaa/analyzer.git
cd analyzer
# 2. Configure environment
cp .env.example .env
# Edit .env with your API keys (NEWS_API_KEY is required)
# 3. Start all services
docker compose up -d
# 4. Open the dashboard
open http://localhostNote: Get a free NewsAPI key at newsapi.org for news & sentiment features.
| Layer | Technology |
|---|---|
| Frontend | React 18, TypeScript, Vite, TailwindCSS, Recharts, TradingView Lightweight Charts |
| Backend API | Node.js, Express.js, TypeScript, Socket.IO |
| ML Service | Python, FastAPI, XGBoost, Prophet, scikit-learn |
| Data Pipeline | Python, yfinance, BeautifulSoup, TextBlob, schedule |
| Database | TimescaleDB (PostgreSQL with time-series) |
| Cache | Redis |
| Infrastructure | Docker, Docker Compose, Nginx |
analyzer/
โโโ backend/ # Express.js API server (TypeScript)
โ โโโ src/index.ts # API routes, WebSocket, DB queries
โ โโโ package.json
โ โโโ Dockerfile
โ โโโ tsconfig.json
โโโ frontend/ # React dashboard (TypeScript)
โ โโโ src/
โ โ โโโ components/ # StockChart, PredictionPanel, NewsPanel, etc.
โ โ โโโ hooks/ # Custom React hooks
โ โ โโโ services/ # API client
โ โ โโโ types/ # TypeScript interfaces
โ โโโ Dockerfile
โ โโโ nginx.conf
โโโ ml-service/ # FastAPI ML predictions (Python)
โ โโโ main.py # Prediction endpoints
โ โโโ training/ # Model training scripts
โ โ โโโ train_xgboost.py
โ โ โโโ train_prophet.py
โ โ โโโ train_lstm.py
โ โโโ Dockerfile
โ โโโ requirements.txt
โโโ data-pipeline/ # Market data ingestion (Python)
โ โโโ main.py # Scheduler orchestrator
โ โโโ fetchers/ # NSE, Yahoo Finance, news scrapers
โ โโโ analyzers/ # Sentiment analysis
โ โโโ indicators/ # Technical indicator calculations
โ โโโ database/ # Schema & DB utilities
โ โโโ Dockerfile
โ โโโ requirements.txt
โโโ scripts/ # Utility scripts
โโโ docker-compose.yml # Production deployment
โโโ docker-compose.dev.yml # Development with hot reload
โโโ Makefile # Common operations
โโโ .github/workflows/ # CI/CD pipelines
- Node.js โฅ 18
- Python 3.11 or 3.12
- Docker & Docker Compose
# Start database and cache
docker compose -f docker-compose.dev.yml up -d timescaledb redis
# Backend
cd backend
npm install
npm run dev
# Frontend (new terminal)
cd frontend
npm install
npm run dev
# ML Service (new terminal)
cd ml-service
python -m venv venv
source venv/bin/activate # Windows: .\venv\Scripts\Activate
pip install -r requirements.txt
python main.py
# Data Pipeline (new terminal)
cd data-pipeline
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python main.pymake dev # Start dev environment
make build # Build Docker images
make up # Start production stack
make down # Stop everything
make logs # Tail logs
make db-setup # Initialize database| Method | Endpoint | Description |
|---|---|---|
GET |
/api/stocks |
List all tracked stocks |
GET |
/api/stock/:symbol |
Get stock details & latest price |
GET |
/api/stock/:symbol/history |
Historical price data |
GET |
/api/stock/:symbol/predictions |
ML ensemble predictions |
GET |
/api/stock/:symbol/news |
News articles with sentiment |
GET |
/api/stock/:symbol/sentiment |
Aggregated sentiment score |
GET |
/api/indices |
Market indices (NIFTY, SENSEX) |
GET |
/api/market-mood |
Overall market sentiment |
GET |
/health |
Backend health check |
| Event | Direction | Description |
|---|---|---|
subscribe:stock |
Client โ Server | Subscribe to real-time updates |
unsubscribe:stock |
Client โ Server | Unsubscribe from updates |
stock:update |
Server โ Client | Live price update |
All configuration is via environment variables. See .env.example for all options:
| Variable | Description | Default |
|---|---|---|
DB_HOST |
PostgreSQL host | localhost |
DB_PORT |
PostgreSQL port | 5432 |
REDIS_HOST |
Redis host | localhost |
NEWS_API_KEY |
NewsAPI.org API key | โ |
DEFAULT_STOCKS |
Comma-separated NSE symbols | Top 20 NSE stocks |
FETCH_INTERVAL_MINUTES |
Price fetch frequency | 5 |
# On your server
git clone https://github.com/adarshvermaa/analyzer.git
cd analyzer
cp .env.example .env
# Edit .env with production values
docker compose up -dThe Nginx reverse proxy exposes the app on port 80. All services communicate internally via Docker networking.
docker compose exec ml-service python -m training.train_allContributions are welcome! Please read CONTRIBUTING.md for guidelines.
This project is licensed under the MIT License โ see the LICENSE file for details.
This software is for educational and research purposes only. It does not constitute financial advice. Always do your own research before making investment decisions. The predictions generated by ML models are not guaranteed to be accurate.