K
Kapitl
DOCS
Kapitl/Docs/1. Getting Started & Overview
5 min read•
OVERVIEW & ARCHITECTURE

Kapitl Platform Engineering Blueprint

Institutional-grade multi-Demat IPO intelligence, automated SEBI DRHP forensic diligence, and Mixed-Integer Linear Programming (MILP) capital allocation for Indian primary markets.

RY
Built by Ravi YadavLead Engineer

Full-Stack & Autonomous AI Systems Engineer • Lovely Professional University

The Primary Market Problem

Every year in India, over ₹1,00,000+ Crores are raised through IPOs on NSE and BSE. However, retail family investors consistently underperform due to three systematic structural barriers:

01 / PROSPECTUS OPACITY

400+ Page DRHP Filings

Crucial financial red flags (related-party loans, heavy promoter dilution, auditor qualifications) remain buried in extensive PDFs that retail applicants never read.

02 / LOT ALLOTMENT MATH

Suboptimal Bidding

In retail oversubscribed IPOs, bidding for 13 lots grants the exact same lottery odds as bidding for 1 lot, unnecessarily locking ₹1,80,000 in ASBA.

03 / PAN DISQUALIFICATION

Duplicate Applications

Applying through multiple brokers (e.g. Zerodha + Groww) under the same PAN leads to instant registrar disqualification under SEBI regulations.

The Institutional Edge
Kapitl replaces manual guesswork with mixed-integer linear programming. Family capital is pooled conceptually while keeping Demat PAN ownership segregated, maximizing lottery win probability while guaranteeing zero duplicate PAN penalties.

System Architecture & Data Pipelines

Kapitl is architected as an asynchronous, distributed pipeline running across four specialized stages:

Execution Pipeline Architecture
STAGE 1
Scraping & Normalization
ipoalerts.in / Groww / ipowatch.in
STAGE 2
Dual-Agent AI Diligence
Configured LLM (default Groq)
STAGE 3
PuLP Linear Solver
COIN-OR CBC Algorithm (<50ms)
STAGE 4
SmartAPI Execution
09:00 AM Pre-Market Sell Orders
Monorepo Structure (apps/api + apps/web)
Kapital/
├── apps/
│   ├── api/                     # Python 3.10+ FastAPI Asynchronous Backend
│   │   ├── app/
│   │   │   ├── agents/          # Multi-agent GMP/feed summarisers (configurable LLM)
│   │   │   ├── db/              # SQLAlchemy Async Models & Migrations
│   │   │   ├── routers/         # REST API Routes (/ipos, /funds, /reports, /orders)
│   │   │   ├── schemas/         # Pydantic v2 Contract Validation
│   │   │   └── services/        # PuLP Optimizer, SmartAPI Broker, Scrapers
│   │   └── tests/               # Pytest Unit & Integration Suites (77+ tests)
│   └── web/                     # Next.js 14.2 App Router Web Terminal
│       ├── src/
│       │   ├── app/             # App Router pages (/ipos, /funds, /reports, /docs)
│       │   ├── components/      # Design System (Linear x Ramp x Mercury styled)
│       │   ├── lib/             # SWR Cache Client, Formatters, Auth Context
│       │   └── types/           # Strict TypeScript Domain Interfaces

Quick Start & Local Development

Run Kapitl locally in under 3 minutes with automated database seeding:

1. Clone & Set Up Backend Environment
# Clone repo
git clone https://github.com/ravi-yadav-23/Kapital.git
cd Kapital

# Start FastAPI backend
cd apps/api
python -m venv venv
.\venv\Scripts\activate   # macOS/Linux: source venv/bin/activate
pip install -r requirements.txt
uvicorn app.main:app --reload --port 8000
2. Start Next.js Web Terminal
# In another terminal window
cd apps/web
npm install
npm run dev

# Open http://localhost:3000 in your browser
Was this documentation page helpful?
Kapitl Documentation • Engineered by Ravi Yadav