How karthikreddy-7/infytrade works
Project type and purpose
• From the README and file‐tree we see InfyTrade is a full-stack, containerized web trading platform.
• Frontend: a ReactJS SPA with ChartJS visualizations and TailwindCSS/DaisyUI.
• Backend: a NestJS monolith (modularized by feature: Users, Stocks, Portfolios, MLmodels, etc.), backed by PostgreSQL.
• Auxiliary service: a NodeJS cron job to fetch stock prices into the database.
File structure
• Top-level directories:
• frontend/infytradefe – React app, public assets, API wrappers, Redux store, components.
• backend/pms – NestJS application, composed of modules (Community, Dashboards, MLmodels, …), TypeORM entities, DTOs, controllers and services, plus Dockerfile and docker-compose.yml.
• backend/stock-price-cron – standalone NodeJS cron job.
• Configuration and infra: Dockerfiles, docker-compose.yml under backend/pms, .env in frontend, tsconfig, ESLint/Prettier, Gitignore.
• The NestJS app defines controllers→services→entities per feature; the React app organizes reusable UI components and Redux for state management.
Key insights from README
• Emphasis on real-time analytics, multiple dashboards, community & marketplace, custom & pre-defined ML models.
• Tech stack calls out React/ChartJS/Tailwind for FE, NestJS+Postgres for BE, Docker for containerization, cron job for data ingestion.
a. Main components (high-level):
• Users (Browser / ReactJS SPA)
• API Gateway / Backend Service (NestJS monolith)
• Database (PostgreSQL)
• Stock-Price Cron Worker (NodeJS)
• External Data Providers (stock/forex/crypto APIs)
• (Optional) ML Execution Engine or Jupyter-style Editor module
b. Relationships & data flows:
1. Browser → HTTP(S) → API Gateway
2. API Gateway routes requests by module (Users, Stocks, Portfolios, MLmodels, etc.).
3. Services → TypeORM → PostgreSQL
4. Cron Worker → External APIs → PostgreSQL
5. MLmodels module reads raw data → runs computation → writes results back → frontend queries for visualization.
c. Architectural patterns & design principles:
• Layered architecture (Controller → Service → Repository/Entity).
• Modularization by feature (NestJS modules).
• Single SPA with Redux for state, thunks for async API calls.
• Containerization: each service (frontend, backend, cron, DB) in its own Docker container; orchestrated via docker-compose.
d. Key technologies & frameworks:
• Frontend: React, Redux, ChartJS, TailwindCSS
• Backend: NestJS, TypeORM, PostgreSQL
• Data ingestion: Node cron job
• Infra: Docker, docker-compose