TradeFlux is a cloud-native distributed trading infrastructure platform built to simulate real-world stock trading workflows using microservices, event-driven architecture, observability, and container orchestration.
The project focuses on designing production-grade backend systems by combining synchronous and asynchronous communication patterns, service discovery, distributed tracing, monitoring, and Docker-based deployment.
TradeFlux was built to explore:
- Distributed Systems Design
- Event-Driven Architecture
- Cloud-Native Development
- Microservices Communication
- Observability & Monitoring
- Containerization & Orchestration
- Production-Grade Backend Engineering
+------------------+
| API Gateway |
+---------+--------+
|
---------------------------------------------------------
| | | |
βΌ βΌ βΌ βΌ
+-------------+ +-------------+ +-------------+ +-------------+
| Auth Service| | User Service| |Order Service| |WalletService|
+-------------+ +-------------+ +------+------| +------+------+
| |
| |
βΌ βΌ
+-------------+ +-------------+
| Kafka | | PostgreSQL |
+------+------+ +------+------+
|
|
βΌ
+---------------+
|PortfolioService|
+---------------+
Client
β
βΌ
API Gateway
β
βΌ
Order Service
β
βββ Reserve Funds (Wallet Service)
β
βββ Publish OrderPlacedEvent
β
βΌ
Kafka
Order Service
β
βΌ
OrderExecutedEvent
β
βΌ
Kafka
β
βββ Wallet Service
β βββ Consume Funds
β
βββ Portfolio Service
βββ Update Holdings
Responsibilities:
- Single Entry Point
- JWT Authentication
- Request Routing
- Route Protection
Responsibilities:
- User Registration
- User Authentication
- JWT Generation
- JWT Validation
Responsibilities:
- User Profile Management
- User Registration Event Handling
Responsibilities:
- Wallet Creation
- Fund Management
- Reserve Funds
- Release Funds
- Consume Funds
Responsibilities:
- Buy Order Placement
- Order Lifecycle Management
- Kafka Event Publishing
- Wallet Integration
Responsibilities:
- Portfolio Holdings
- Position Tracking
- Event-Based Updates
OpenFeign
Used for:
Order Service β Wallet Service
Apache Kafka
Events:
- UserRegisteredEvent
- OrderPlacedEvent
- OrderCancelledEvent
- OrderExecutedEvent
Implemented using:
- Micrometer Tracing
- Brave
- Zipkin
Trace Flow:
Gateway
β
Order Service
β
Wallet Service
β
Portfolio Service
Implemented using:
- Spring Boot Actuator
- Micrometer
- Prometheus
Available Metrics:
- JVM Metrics
- Memory Usage
- CPU Usage
- HTTP Requests
- Response Time
- Application Health
Implemented using:
- Grafana
Dashboards:
- Service Health
- Request Throughput
- JVM Monitoring
- Application Metrics
All services are fully containerized using Docker.
Containerized Components:
- API Gateway
- Auth Service
- User Service
- Wallet Service
- Portfolio Service
- Order Service
- Discovery Server
- PostgreSQL
- Kafka
- Zipkin
Start the complete platform:
docker compose up -dStop the platform:
docker compose downCheck running containers:
docker ps- Java 21
- Spring Boot 3
- Spring Cloud
- Eureka Discovery Server
- Spring Cloud Gateway
- OpenFeign
- Apache Kafka
- PostgreSQL
- Prometheus
- Grafana
- Zipkin
- Micrometer
- Spring Actuator
- Docker
- Docker Compose
- JWT Authentication
- Service Discovery
- API Gateway Routing
- Event-Driven Communication
- Portfolio Management
- Wallet Management
- Order Lifecycle Management
- Distributed Tracing
- Metrics Collection
- Dockerized Infrastructure
- Docker Compose Deployment
- Kubernetes Deployment
- ConfigMaps & Secrets
- Ingress Controller
- Horizontal Pod Autoscaler
- Minikube Deployment
- AWS EKS Deployment
- CI/CD Pipeline
- GitHub Actions
- Centralized Logging
- Designing Event-Driven Systems
- Distributed Transaction Handling
- Service-to-Service Communication
- Cloud-Native Architecture
- Container Orchestration
- Production Observability
- Microservice Deployment Strategies