Back to projects
Web

Investra - Investment Platform

Full-stack investment management platform with real-time trading and portfolio tracking.

JavaSpring BootNext.jsTypeScriptSpring SecuritySQL ServerDockerRedis

Financial institutions need a secure, scalable platform to manage stock trading, multi-currency portfolios, and customer accounts - all in one place. Investra is a full-stack simulation of that platform, built during my internship at Infina Yazılım: a Spring Boot backend fronting a Next.js dashboard, with role-based access for ADMIN, TRADER, and USER accounts.

Investra trading dashboard

Settlement and fees, not just CRUD

The interesting part of a trading platform isn't the forms - it's getting the money math right. Every buy/sell order has to price the trade, apply a commission rate that depends on client type, stack a tax on top of that commission, and net it all against the trade amount. OrderCalculationService centralizes that so the buy and sell flows can't drift out of sync with each other:

BigDecimal commissionRate = client.getClientType() == ClientType.INDIVIDUAL
        ? INDIVIDUAL_COMMISION_RATE   // 0.2%
        : CORPORATE_COMMISION_RATE;   // 0.1%
 
BigDecimal totalAmount = orderPrice.multiply(quantityBD)
        .setScale(DECIMAL_SCALE, RoundingMode.HALF_UP);
BigDecimal commission = totalAmount.multiply(commissionRate)
        .setScale(DECIMAL_SCALE, RoundingMode.HALF_UP);
BigDecimal bsmv = commission.multiply(BSMV_FEE_RATE) // 5% banking tax on the commission
        .setScale(DECIMAL_SCALE, RoundingMode.HALF_UP);
 
// Sell: net = total - fees. Buy: net = total + fees.
BigDecimal netAmount = orderType == OrderType.SELL
        ? totalAmount.subtract(commission.add(bsmv))
        : totalAmount.add(commission.add(bsmv));

Every order also carries a hard-coded "T+2" settlement label, simulating the two-business-day gap between trade date and value date that real equity settlement uses.

Stack

  • Backend: Java 17 / Spring Boot 3.5, layered into controllerservice (+ service/impl) → repositoryentity, with JWT auth (JwtUtil, AuthFilter) and role-based SecurityConfig
  • Frontend: Next.js + TypeScript, TanStack Table for the account/order/portfolio tables that make up most of the dashboard
  • Data: SQL Server for persistence, Redis for caching stock lookups and account/client lists (10-minute TTLs)
  • Ops: Docker Compose wiring the API, frontend, SQL Server, Redis, Prometheus, and Grafana together, plus a health-check.sh script that checks the app, Redis ping, and DB pool status

Result

A platform that supports market and limit orders, real-time portfolio valuation, KYC-style customer management, and Excel/PDF report export - with commission and settlement logic centralized enough that both the buy and sell sides trust the same numbers, and a Grafana dashboard to watch it run.