You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tinkoff API — Russian stocks (SBER, GAZP, LKOH, YNDX), free API
CoinGecko API — Cryptocurrencies (BTC, ETH), free API
Quick Start
# Start infrastructure
docker-compose up -d
# Run application
./gradlew bootRun
# Open dashboard
open http://localhost:8080
# Or use API directly
curl http://localhost:8080/api/stocks
curl -N http://localhost:8080/api/stocks/stream # SSE live prices
API Endpoints
Method
Path
Description
GET
/api/stocks
List all tracked stocks
GET
/api/stocks/{symbol}
Get stock by symbol
POST
/api/stocks
Add stock to track
DELETE
/api/stocks/{symbol}
Remove stock
GET
/api/stocks/stream
SSE stream — all prices
GET
/api/stocks/{symbol}/prices/stream
SSE stream — single stock
GET
/api/stocks/{symbol}/prices?limit=50
Price history
Testing
./gradlew test
Test Class
Type
What it covers
StockServiceTest
Unit
CRUD operations, StepVerifier + Mockito
StockHandlerTest
WebFlux
Handlers with WebTestClient
PriceFlowIntegrationTest
E2E
Full flow with Testcontainers (PostgreSQL + Kafka)
Key Patterns
Functional routing — RouterFunction + HandlerFunction instead of @RestController
SSE streaming — Flux<T> + MediaType.TEXT_EVENT_STREAM for real-time updates
Reactive Kafka — non-blocking producer/consumer with Project Reactor
StepVerifier — testing reactive streams step by step
Constructor injection — explicit DI, no @Autowired