Skip to content

lyndchen2016/finally

 
 

Repository files navigation

FinAlly — AI Trading Workstation

A visually stunning AI-powered trading workstation with live market data, simulated portfolio trading, and an LLM chat assistant that can analyze positions and execute trades.

Features

  • Live-streaming market prices with flash animations (green uptick / red downtick)
  • Sparkline mini-charts and a main chart for the selected ticker
  • Simulated portfolio: buy/sell with market orders, instant fill
  • Portfolio heatmap (treemap) colored by P&L, plus a P&L history chart
  • AI chat assistant (FinAlly) that can analyze your portfolio, suggest trades, and execute them
  • Watchlist management — manual or via chat

Quick Start

cp .env.example .env
# Add your OPENROUTER_API_KEY to .env

# macOS/Linux
./scripts/start_mac.sh

# Windows (PowerShell)
.\scripts\start_windows.ps1

Then open http://localhost:8000.

Environment Variables

Variable Required Description
OPENROUTER_API_KEY Yes OpenRouter key for LLM chat
MASSIVE_API_KEY No Polygon.io key for real market data (simulator used if absent)
LLM_MOCK No Set true for deterministic mock LLM responses (testing)

Architecture

Single Docker container on port 8000:

  • Backend: FastAPI (Python/uv) — REST + SSE streaming
  • Frontend: Next.js (TypeScript, static export) — served by FastAPI
  • Database: SQLite at db/finally.db, volume-mounted for persistence
  • Market data: GBM simulator by default; Polygon.io REST polling if MASSIVE_API_KEY is set
  • AI: LiteLLM → OpenRouter (Cerebras inference) with structured outputs

Development

# Backend
cd backend
uv sync --extra dev
uv run pytest -v

# Frontend
cd frontend
npm install
npm run dev

Testing

E2E tests use Playwright with LLM_MOCK=true for speed and determinism:

cd test
docker compose -f docker-compose.test.yml up --abort-on-container-exit

About

FinAlly Capstone Project - LLM driven Trader Workstation for Simulated Trading

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 100.0%