How akashdeep-bit-gif/aegis-risk-terminal works
This is a portfolio-risk dashboard with a backend that periodically reads holdings and wallet data, calculates portfolio risk, and broadcasts metrics to a React UI. Users inspect live risk indicators and portfolio composition, then explore shock and hedge scenarios. The sampled code supports the backend calculation and broadcast flow and the UI’s analytics views; the exact frontend event subscription and database schema are not shown, so that connection is marked unverified.
Main entry points: RiskDashboard.jsx Risk dashboard · riskstream.js Metrics poller · db.js MySQL pool · App.jsx App shell
Components 11
Dashboard
- App shell
frontend/src/App.jsx - Risk dashboard
frontend/src/components/RiskDashboard.jsx - Risk indicators
frontend/src/components/RiskDashboard.jsx - Shock simulator
frontend/src/components/RiskDashboard.jsx - Portfolio views
frontend/src/components/RiskDashboard.jsx
Live Metrics
- Socket server
backend/server.js - Metrics poller
backend/riskstream.js
Risk Analytics
- Risk calculations
backend/riskengine.js
Portfolio Data
- MySQL pool
backend/db.js
Other components
- Portfolio user
- MySQL database
Connections 10
- Portfolio user → Risk dashboard: explores
frontend/src/components/RiskDashboard.jsx - App shell → Risk dashboard: renders
frontend/src/App.jsx - Risk dashboard → Risk indicators: presents
frontend/src/components/RiskDashboard.jsx - Risk dashboard → Shock simulator: simulates
frontend/src/components/RiskDashboard.jsx - Risk dashboard → Portfolio views: shows
frontend/src/components/RiskDashboard.jsx - Socket server → Metrics poller: starts
backend/server.js - Metrics poller → MySQL pool: queries
backend/riskstream.js - MySQL pool → MySQL database: connects
- Metrics poller → Risk calculations: calculates with
backend/riskstream.js - Metrics poller → Risk dashboard: broadcasts metrics