How niranjangowdakm423-gif/alphawise works
Alphawise is a web portfolio-optimization and risk-analytics platform. A user enters a portfolio in the dashboard; the API validates the request and delegates the optimization workflow to PortfolioAgent, which fetches market history and returns portfolio strategies, risk metrics, and diagnostics. Separate branches provide health checks and an AI copilot with chat and memo regeneration. The frontend-to-API link and some internal quantitative dependencies are not directly shown in the excerpts, so those links are marked unverified rather than asserted as calls.
Main entry points: portfolio_agent.py Portfolio pipeline · chat.py Chat and memo endpoints · optimization.py Optimization endpoint · llm_service.py LLM service
Components 22
Portfolio dashboard
- Dashboard
frontend/index.html - Dashboard logic
frontend/js/app.js - API client
frontend/js/api.js - Portfolio charts
frontend/js/charts.js
API and contracts
- FastAPI app
backend/app/main.py - API v1 router
backend/app/api/v1/api_router.py - Optimization endpoint
backend/app/api/v1/endpoints/optimization.py - Chat and memo endpoints
backend/app/api/v1/endpoints/chat.py - Health endpoint
backend/app/api/v1/endpoints/health.py - Request contracts
backend/app/models/request.py - Response contracts
backend/app/models/response.py - Runtime settings
backend/app/core/config.py - Domain exceptions
backend/app/core/exceptions.py
Portfolio analytics
- Portfolio pipeline
backend/app/services/portfolio_agent.py - Market data ingestion
backend/app/services/data_ingestion.py - Optimization engine
backend/app/services/optimizer.py - Risk engine
backend/app/services/risk_engine.py
Diagnostics and AI
- Risk diagnostics
backend/app/services/ai_diagnostics.py - LLM service
backend/app/services/llm_service.py
Other components
- Investor
- Yahoo Finance
- LLM provider
Connections 28
- Investor → Dashboard: uses
README.md - Dashboard → Dashboard logic: hosts
README.md - Dashboard logic → API client: uses
- Dashboard logic → Portfolio charts: renders
- API client → Optimization endpoint: requests
- FastAPI app → API v1 router: mounts
backend/app/main.py - API v1 router → Optimization endpoint: routes
backend/app/api/v1/api_router.py - API v1 router → Chat and memo endpoints: routes
backend/app/api/v1/api_router.py - API v1 router → Health endpoint: routes
backend/app/api/v1/api_router.py - Optimization endpoint → Request contracts: accepts
backend/app/api/v1/endpoints/optimization.py - Optimization endpoint → Response contracts: returns
backend/app/api/v1/endpoints/optimization.py - Optimization endpoint → Portfolio pipeline: runs pipeline
backend/app/api/v1/endpoints/optimization.py - Chat and memo endpoints → Request contracts: accepts
backend/app/api/v1/endpoints/chat.py - Chat and memo endpoints → Response contracts: returns
backend/app/api/v1/endpoints/chat.py - Chat and memo endpoints → LLM service: generates replies
backend/app/api/v1/endpoints/chat.py - Chat and memo endpoints → Risk diagnostics: builds fallback memos
backend/app/api/v1/endpoints/chat.py - FastAPI app → Runtime settings: configures
backend/app/main.py - FastAPI app → Domain exceptions: handles
backend/app/main.py - Portfolio pipeline → Market data ingestion: fetches prices
backend/app/services/portfolio_agent.py - Market data ingestion → Yahoo Finance: downloads history
backend/app/services/data_ingestion.py - Portfolio pipeline → Optimization engine: delegates optimization
- Portfolio pipeline → Risk engine: computes risk
- Portfolio pipeline → Risk diagnostics: generates diagnostics
backend/app/services/portfolio_agent.py - Portfolio pipeline → Response contracts: builds response
backend/app/services/portfolio_agent.py - Portfolio pipeline → LLM service: enhances memos
backend/app/services/portfolio_agent.py - LLM service → Runtime settings: reads configuration
backend/app/services/llm_service.py - LLM service → LLM provider: sends prompts
backend/app/services/llm_service.py - LLM service → Yahoo Finance: looks up tickers
backend/app/services/llm_service.py