(any api request you want send please send this request this domain name) https://vencorx.digitaldigimart.shop
want to check api you want to install postman to check all api
this user collection api https://www.postman.com/dakshsuvarna46-3623851/workspace/yt-auth/collection/53078795-90d64444-34fb-4480-ab45-0d9dd29efdee?action=share&source=copy-link&creator=53078795
this admin collection api https://www.postman.com/dakshsuvarna46-3623851/workspace/yt-auth/collection/53078795-fc6aeb21-1de6-4e34-a3a1-3ede73528f53?action=share&source=copy-link&creator=53078795
chat server api test this (not comfirm in live market work or cursh code 500 get)
(notice when you want to see the api endpoint please check following files)
- doc.md
- docExplaination.md
(2 notice you want to add any stock name please check this link below you search name exited name that same copy name copy past to api , stock will be added successfully)
it will take time to load jsons
This repository contains the complete backend microservices architecture for the Vencorx platform. It is a highly scalable, multi-service backend built using NestJS, Next.js API Routes, PostgreSQL (TimescaleDB), Redis, and Apache Kafka.
The platform uses an Nginx reverse proxy to route traffic to the appropriate microservices. The backend is split into multiple independent services:
Acts as the main API Gateway. It routes all incoming traffic (/api/auth, /api/admin, /api/fyers, /socket.io) to their respective Docker containers.
- Technology: Next.js App Router (API Routes)
- Purpose: Handles all authentication (Registration, Login, OTP Verification, Password Resets) for both Users and Admins.
- Database: Connects to the primary PostgreSQL database using Prisma ORM.
- Technology: Next.js App Router (API Routes)
- Purpose: Exposes administrative endpoints for managing the platform (e.g., adding/removing active stocks, clearing historical data).
- Communication: Interacts with PostgreSQL via Prisma and sends commands to other microservices.
- Technology: NestJS, Socket.io
- Purpose: The central real-time hub.
- Features:
- WebSocket Gateway (
/socket.io/): Manages thousands of simultaneous WebSocket connections from frontend clients. - REST Endpoints: Provides endpoints for fetching active listed stocks (
GET /api/market-data/stocks) and triggering background jobs. - Angel One Integration (
AngelOneFetchService): Connects directly to Angel One's live ticker WebSocket and processes real-time stock ticks. - Throttled Historical Fetcher: Pulls 5 years of daily historical data from Angel One in the background via strict chunking to avoid rate limits.
- Kafka Consumer: Listens to Kafka topics (e.g.,
fyers-chart-update-*) and broadcasts real-time chart candles to subscribed users.
- WebSocket Gateway (
- Technology: NestJS
- Purpose: Dedicated microservice for handling all Fyers API integrations.
- Features:
- OAuth 2.0 Auth Flow (
FyersAuthService): Automatically manages Access and Refresh tokens using a daily Cron Job. - Historical Data Engine (
FyersDataService): Pulls 1m, 15m, and 4h historical data in large chunks. - Throttled Fetching: Intelligently chunks data (e.g., 90-day intervals) and sleeps between requests to protect the server's 2 vCPU / 8GB RAM limitations.
- Kafka Producer: Publishes processed OHLCV candle updates to Kafka topics so the
chat-servicecan stream them to the frontend.
- OAuth 2.0 Auth Flow (
- PostgreSQL / TimescaleDB: The primary database. TimescaleDB hypertables (
stock_ticks,fyers_candles,angel_candles) are used for blazing fast time-series queries. - Redis: Used for high-speed caching, storing Fyers API tokens, and maintaining active WebSocket session maps.
- Kafka / Zookeeper: The event bus for real-time inter-service communication (e.g., sending chart updates from
fyers-chart-servicetochat-service).
- Admin hits
POST /api/admin/stocks(orPOST /api/market-data/stocks). - The endpoint instantly returns
Successto the frontend so it doesn't freeze. - In the background,
chat-servicestarts downloading 5 years of Angel One data in chunks. - Concurrently, an HTTP call is made to
fyers-chart-serviceto start downloading 1 year of intraday data (1m, 15m, 4h). - The downloaded data is safely written into TimescaleDB without overloading the server.