Skip to content

iamadarsha/Codex-Screener

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

95 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

BreakoutScan

India's Real-Time NSE/BSE Stock Screener & AI Intelligence Platform

Scan NIFTY 500 in seconds Β· AI trade briefs Β· Live options analytics Β· Production-grade security

Railway Vercel Python FastAPI Next.js React Supabase


Live Demo Β· API Docs Β· Report Bug


What is BreakoutScan?

BreakoutScan is a full-stack, production-grade stock intelligence platform built for Indian equity markets. It eliminates the morning grind of manually scanning hundreds of stocks across multiple tabs by surfacing breakout setups, volume anomalies, and AI-generated trade ideas β€” all in a single Bloomberg-dark interface.

The platform covers the full NIFTY 500 universe across NSE and BSE, runs technical scans in under two seconds, and layers a dual-model AI pipeline on top to give traders context, not just numbers.

Built solo. Deployed in production. Trusted by traders.


Screenshots

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  ● MARKET OPEN    NIFTY 50 24891 +0.81%   NIFTY BANK 56266 +0.32%  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Dashboard                                                           β”‚
β”‚                                                                      β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚ ACTIVE       β”‚ β”‚ TRIGGERED    β”‚ β”‚ VOLUME       β”‚ β”‚ MARKET     β”‚ β”‚
β”‚  β”‚ BREAKOUTS    β”‚ β”‚ ALERTS       β”‚ β”‚ SURGES       β”‚ β”‚ BREADTH    β”‚ β”‚
β”‚  β”‚     24       β”‚ β”‚     8        β”‚ β”‚     12       β”‚ β”‚   84%      β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚                                                                      β”‚
β”‚  ⚑ Live Breakout Feed          ● 24 signals                        β”‚
β”‚  DIXON    ↑ 3.2%   Bullish EMA Crossover Β· RSI 58                   β”‚
β”‚  HDFCBANK ↑ 1.1%   Price Above SMA(200)  Β· Vol 2.3x avg             β”‚
β”‚  INFY     ↑ 2.4%   MACD Bullish Cross    Β· Near 52W High            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Core Features

⚑ Real-Time NIFTY 500 Screener

Scan all 500 stocks in under 2 seconds against 13 prebuilt technical setups:

Category Scan Trigger Condition
Momentum RSI Oversold RSI(14) < 30
Momentum RSI Overbought RSI(14) > 70
Moving Average Bullish EMA Crossover EMA(9) crosses above EMA(21)
Moving Average Bearish EMA Crossover EMA(9) crosses below EMA(21)
Moving Average Price Above SMA(200) Close > SMA(200) β€” uptrend confirmation
Moving Average Price Below SMA(200) Close < SMA(200) β€” downtrend confirmation
Volume Volume Spike 2x Volume > 2Γ— 20-day average
Volatility Bollinger Squeeze Band width < 5% of midline β€” pre-breakout
Trend MACD Bullish Cross MACD line crosses above signal line
Trend MACD Bearish Cross MACD line crosses below signal line
Breakout Near 52-Week High Close > 95% of 52-week high
Intraday ORB Breakout Price breaks above Opening Range High
Pattern Bullish Engulfing Candlestick reversal pattern

πŸ€– AI Trade Brief (Dual-Model Pipeline)

Every morning the system reads 40+ financial news articles β€” earnings, macro events, FII/DII flows, RBI/SEBI updates β€” and runs them through:

  • Gemini 3.1 Pro β†’ macro context, sector reasoning, fundamental signals
  • Llama 4 β†’ pattern recognition across historical technical setups

Output: plain-language trade ideas with conviction scores. Not just what is moving β€” but why, what the setup looks like, and whether the risk/reward makes sense.

πŸ“Š Options Intelligence Module

  • Live PCR (Put-Call Ratio) by strike
  • IV Percentile β€” know if options are cheap or expensive
  • OI Buildup β€” track where large positions are being built
  • Max Pain β€” the price at which maximum options expire worthless
  • All updated every 30 seconds during market hours

πŸ“ˆ Interactive Charts

One-click from any screener result to a full interactive chart:

  • 1D / 1W / 1M / 6M / 1Y timeframes
  • EMA(9), EMA(21), SMA(50), SMA(200) overlays
  • Volume bars with 20-day average baseline
  • Bollinger Bands, MACD, RSI panels

πŸ›‘ Watchlist & Alerts

  • Build personal watchlists across NIFTY 50 / NIFTY 500
  • Set price, RSI, and volume alerts
  • Alerts fire in real-time via WebSocket push

Data Architecture β€” 5-Layer API Cascade

BreakoutScan uses a 5-layer broker API waterfall β€” each layer takes over automatically if the one above fails or rate-limits:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Layer 1 β€” Groww API          Primary real-time feed         β”‚
β”‚  Layer 2 β€” Upstox API         Secondary price data           β”‚
β”‚  Layer 3 β€” Dhan API           Options & derivatives layer    β”‚
β”‚  Layer 4 β€” Fyers API          Technical data redundancy      β”‚
β”‚  Layer 5 β€” Paytm Money API    Final fallback + portfolio ctx  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         ↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  5 System Support APIs                                       β”‚
β”‚  β€’ Health Monitor    watches all 5 data layers              β”‚
β”‚  β€’ Circuit Breaker   auto-switches on failure               β”‚
β”‚  β€’ Cache Manager     eliminates redundant calls             β”‚
β”‚  β€’ Session State     keeps results stable mid-switch        β”‚
β”‚  β€’ Alert System      notifies before users notice           β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

This means scan results update faster than Chartink's free-tier 5-minute delay β€” with zero manual intervention when any individual layer degrades.


Tech Stack

Frontend

Layer Technology
Framework Next.js 15 (App Router)
UI Runtime React 19
Styling Tailwind CSS v4
Components shadcn/ui
Charts Lightweight Charts (TradingView)
State TanStack Query v5
Real-time WebSockets (native)
Animations Framer Motion

Backend

Layer Technology
Framework FastAPI (Python 3.12)
Technical Analysis pandas-ta 0.4.x
Data Science pandas 2.x + numpy 2.x
Task Queue asyncio background tasks
Rate Limiting slowapi
Caching Redis (Upstash)
WebSocket python-socketio

AI Pipeline

Model Role
Gemini 3.1 Pro Macro reasoning, news synthesis, sector context
Llama 4 Pattern recognition, historical setup matching
Google Generative AI SDK Gemini API integration
Groq SDK Llama inference (sub-100ms)

Infrastructure

Service Purpose
Railway Pro FastAPI backend + auto-deploy
Vercel Next.js frontend + Edge CDN
Supabase PostgreSQL + Auth + Row Level Security
Redis (Upstash) Live price cache + indicator store
Docker Containerised API builds

Use Cases

🏒 Retail Trading Desks & Prop Firms

Problem: Analysts spend 60–90 minutes each morning manually screening stocks before the 9:15 AM open.

Solution: BreakoutScan pre-runs all 13 technical scans across NIFTY 500 overnight and at market open. Analysts arrive to a ranked shortlist β€” sorted by signal strength, volume confirmation, and AI conviction score. The desk saves 60+ minutes per session and acts on cleaner, data-driven setups.

Key features used: Screener, AI Trade Brief, Multi-scan aggregation


πŸ“± Independent Retail Traders

Problem: Free tools like Chartink have 5-minute delayed data. Paying for real-time data across multiple platforms (charts, screener, options) is expensive and requires constant tab-switching.

Solution: BreakoutScan combines screener + charts + options data in a single zero-delay interface. A trader can spot a breakout signal, check the chart, verify the options setup, and review the AI context β€” without leaving the platform.

Key features used: Live screener, Options module, One-click charts, AI briefs


🏦 Portfolio Management Companies (PMS / AIF)

Problem: Fund managers running momentum or factor strategies need systematic, repeatable scan criteria applied consistently across their universe β€” not ad-hoc manual screening.

Solution: The /api/screener/run and /api/screener/custom endpoints allow programmatic scan execution with configurable conditions. Custom scans accept any combination of indicators (RSI, EMA, SMA, MACD, Bollinger, ATR, ADX, VWAP) with standard operators β€” enabling systematic strategy backtesting and live signal generation via API.

Key features used: Custom scan API, Prebuilt scan API, Webhook alerts


πŸ“Š SEBI-Registered Research Analysts (RA)

Problem: Writing daily market commentary and stock-specific trade notes requires synthesising NSE data, news flow, and technical charts β€” a multi-hour process done manually.

Solution: The AI Trade Brief pipeline reads 40+ news articles overnight and outputs structured trade notes with entry rationale, sector context, and risk framing. RAs can use this as a first-draft foundation, cutting commentary preparation time by 70%.

Key features used: AI Picks page, AI Trade Brief, Fundamentals module


πŸŽ“ Algo Trading Students & Quant Researchers

Problem: Learning systematic trading requires a live, real-data environment to test scan logic and understand how technical conditions map to real market behaviour.

Solution: BreakoutScan exposes a fully documented REST API (/docs) with live NIFTY 500 data, pre-computed indicators (RSI, EMA, SMA, MACD, Bollinger, ATR, ADX, VWAP, 52W High), and a custom scan endpoint. Researchers can write scan conditions in JSON and test them against the live market β€” no data vendor subscription required.

Key features used: Custom scan API, Indicator data API, Live charts


πŸ— Fintech Startups Building on Top

Problem: Building a trading platform from scratch requires solving data ingestion, indicator computation, options analytics, and AI integration β€” a 12–18 month engineering effort.

Solution: BreakoutScan's API layer can serve as a data and intelligence backend for fintech applications. The 5-layer data cascade, Redis-cached indicator store, and AI pipeline are all accessible via documented REST endpoints β€” letting product teams focus on their UX rather than rebuilding market data infrastructure.

Key features used: Full REST API, WebSocket feed, AI endpoint, Options API


Repository Structure

breakoutscan/
β”œβ”€β”€ apps/
β”‚   β”œβ”€β”€ api/                    # FastAPI backend
β”‚   β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”‚   β”œβ”€β”€ api/routes/     # REST endpoints
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ screener.py       # /api/screener/*
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ market.py         # /api/market/*
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ stocks.py         # /api/stocks/*
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ ai_suggestions.py # /api/ai/*
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ alerts.py         # /api/alerts/*
β”‚   β”‚   β”‚   β”‚   └── fundamentals.py   # /api/fundamentals/*
β”‚   β”‚   β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ screener_engine.py    # Core scan execution
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ yahoo_finance.py      # Indicator computation
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ nse_poller.py         # Live data + universe
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ prebuilt_scans.py     # 13 scan definitions
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ condition_evaluator.py# Scan DSL
β”‚   β”‚   β”‚   β”‚   └── redis_cache.py        # Cache layer
β”‚   β”‚   β”‚   └── core/
β”‚   β”‚   β”‚       β”œβ”€β”€ config.py             # Settings + env
β”‚   β”‚   β”‚       └── rate_limit.py         # slowapi limits
β”‚   β”‚   β”œβ”€β”€ Dockerfile
β”‚   β”‚   └── requirements.txt
β”‚   β”‚
β”‚   β”œβ”€β”€ web/                    # Next.js 15 frontend
β”‚   β”‚   └── src/
β”‚   β”‚       β”œβ”€β”€ app/
β”‚   β”‚       β”‚   β”œβ”€β”€ dashboard/      # Main trading dashboard
β”‚   β”‚       β”‚   β”œβ”€β”€ screener/       # Full screener page
β”‚   β”‚       β”‚   β”œβ”€β”€ ai-picks/       # AI trade briefs
β”‚   β”‚       β”‚   β”œβ”€β”€ charts/         # Interactive charts
β”‚   β”‚       β”‚   β”œβ”€β”€ alerts/         # Alert management
β”‚   β”‚       β”‚   β”œβ”€β”€ watchlist/      # Personal watchlist
β”‚   β”‚       β”‚   └── fundamentals/   # Company fundamentals
β”‚   β”‚       β”œβ”€β”€ components/
β”‚   β”‚       β”‚   β”œβ”€β”€ dashboard/      # Dashboard widgets
β”‚   β”‚       β”‚   └── layout/         # App shell, sidebar, topbar
β”‚   β”‚       └── hooks/              # TanStack Query hooks
β”‚   β”‚
β”‚   β”œβ”€β”€ mobile/                 # Expo React Native app (iOS/Android)
β”‚   └── ios/                    # Native iOS configuration
β”‚
β”œβ”€β”€ packages/
β”‚   └── contracts/              # Shared TypeScript types
β”‚
β”œβ”€β”€ docs/                       # Architecture docs, design system
β”œβ”€β”€ infra/                      # Infrastructure configuration
β”œβ”€β”€ docker-compose.yml          # Local development
└── README.md

Security

Production-grade hardening applied throughout:

Layer Implementation
Rate Limiting slowapi β€” 30 req/min screener, 10 req/min AI, 60 req/min default
CORS Strict origin allowlist β€” production domain only, no wildcards
Debug Routes Blocked at middleware layer in production (ENVIRONMENT=production)
Secrets Zero hardcoded credentials β€” all via environment variables
Database Supabase Row Level Security enforced on every table
Dependencies All packages pinned with explicit version ranges β€” no surprise upgrades
Graceful Degradation API down β†’ frontend shows clean fallback, not crash

Getting Started

Prerequisites

  • Node.js 20+
  • Python 3.12+
  • Docker + Docker Compose
  • Redis (or Upstash Redis URL)
  • Supabase project

Local Development

# Clone
git clone https://github.com/iamadarsha/Codex-Screener.git
cd Codex-Screener

# Copy environment variables
cp .env.example .env
# Fill in SUPABASE_URL, SUPABASE_ANON_KEY, REDIS_URL, GEMINI_API_KEY

# Start everything
docker compose up --build

Services start at:

  • API: http://localhost:8001/health
  • API Docs: http://localhost:8001/docs
  • Web: http://localhost:3000

API-Only (without Docker)

cd apps/api
python -m venv .venv
source .venv/bin/activate
pip install -r requirements-dev.txt

uvicorn app.main:app --reload --port 8001

Frontend Only

cd apps/web
npm install
npm run dev

API Reference

Base URL: https://breakoutscan-api-production.up.railway.app

Method Endpoint Description
GET /health System health β€” Redis, poller, universe size
GET /api/market/status Market open/closed, next session times
GET /api/market/breadth Advance/Decline ratio, total stocks
GET /api/market/indices NIFTY 50, BANK, IT, PHARMA, AUTO live data
GET /api/stocks NIFTY 500 stock list with live prices
GET /api/stocks/{symbol} Single stock detail + indicators
GET /api/screener/prebuilt List all 13 prebuilt scan definitions
POST /api/screener/run Run a prebuilt scan by ID
POST /api/screener/custom Run a custom scan with your own conditions
GET /api/fundamentals/{symbol} P/E, EPS, revenue, sector data
GET /api/alerts List user alerts
POST /api/alerts Create a new alert

Full interactive docs at /docs.


Environment Variables

# Supabase
SUPABASE_URL=https://xxx.supabase.co
SUPABASE_ANON_KEY=eyJ...
SUPABASE_SERVICE_ROLE_KEY=eyJ...

# Redis
REDIS_URL=redis://...

# AI
GEMINI_API_KEY=AIza...
GROQ_API_KEY=gsk_...

# Market Data
INDIAN_API_KEY=...

# Security
ENVIRONMENT=production
SECRET_KEY=...

# CORS (comma-separated, optional)
CORS_ALLOWED_ORIGINS=https://yourdomain.com

Deployment

Railway (API)

The API deploys automatically on push to main. Railway uses the apps/api/Dockerfile.

Build strategy (OOM-safe):

# Phase 1: heavy data-science stack with pre-built wheels only
RUN pip install --prefer-binary numpy pandas pandas-ta

# Phase 2: remaining dependencies
RUN pip install --prefer-binary -r requirements.txt

Vercel (Web)

The web app deploys automatically from apps/web on push to main.


Performance

Operation Time
NIFTY 500 full scan (13 conditions) < 2 seconds
Indicator compute for 50 symbols ~15 seconds (5 parallel batches)
AI Trade Brief generation 3–8 seconds
Live price cache refresh 30 seconds
Indicator cache TTL 4 hours

Contributing

Pull requests are welcome. For major changes, please open an issue first.

# Create a feature branch
git checkout -b feature/your-feature

# Make changes, then run tests
npm run test:api

# Commit and push
git push origin feature/your-feature

Roadmap

  • Mobile app (Expo iOS/Android) β€” in development
  • Options chain full view with Greeks
  • Backtesting module β€” test any scan condition historically
  • Portfolio P&L tracker with positions
  • Push notifications for alerts (iOS/Android)
  • Webhook delivery for scan results
  • Multi-user team workspaces

License

MIT β€” see LICENSE for details.


Built with ❀️ by Adarsha Chatterjee

Made with love by a fellow trader Β· Trade With Adarsha Β· @iamadarsha

breakoutscan.in Β· Live App Β· API

About

Private BreakoutScan monorepo for realtime market screener API, web app, mobile app, and shared contracts.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors