Prism is an AI-driven fund portfolio analysis system for the Chinese market. It is designed for research and decision support, not for real-time trading.
- Wizard-based portfolio setup:
- Portfolio name
- Fund codes and allocations
- Risk preference and investment horizon
- Async analysis workflow:
POST /api/portfolios/{id}/analyzereturns atask_id- Background job runs
PrismKernel - Progress is pushed via WebSocket
- Dashboard consumption:
- View portfolio details
- Track task status (
queued/running/completed/failed) - Read latest analysis result
- Frontend (TypeScript + React + Vite):
- Wizard
- Dashboard
- Task progress via WebSocket
- Backend (Python + FastAPI):
- REST APIs for portfolios, analysis, task status
- WebSocket endpoint for progress events
- Core Engine (Python):
PrismKernelwith LangGraph orchestration- Fetchers for fund and market data
- Analysis synthesis to structured recommendations
- Storage:
- SQLite for MVP
- PostgreSQL via async driver for production
POST /api/portfoliosGET /api/portfoliosGET /api/portfolios/{id}POST /api/portfolios/{id}/analyzeGET /api/tasks/{task_id}GET /api/portfolios/{id}/analysisWS /ws/tasks/{task_id}
# One-command start (backend + frontend)
./start.sh
# Fast start without reinstalling dependencies
./start.sh --skip-install
# Override ports/host
PRISM_BACKEND_PORT=8001 PRISM_FRONTEND_PORT=5174 ./start.sh
# Stop backend/frontend services
./stop.sh
# Smoke test the backend flow:
# health -> create portfolio -> analyze -> poll task -> get analysis
./smoke.sh
# Or run services separately:
# Install backend dependencies
uv sync
# Initialize env
cp .env.example .env
# Run backend
uv run uvicorn src.api.main:app --host 0.0.0.0 --port 8000 --reload# Run frontend
cd frontend
npm install
npm run dev# Backend
ruff check src
python -m compileall src
# Frontend
cd frontend
npm run lint
npm run build- This project does not execute trades and does not connect to brokerage APIs.
- Outputs are for research/decision support only and not investment advice.
- Black swan monitoring and periodic snapshot service are planned for next phase.