Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FinAlly — AI Trading Workstation

A visually stunning AI-powered trading workstation that streams live market data, lets you trade a simulated portfolio, and integrates an LLM chat assistant that can analyze positions and execute trades on your behalf. Think Bloomberg terminal with an AI copilot.

Features

  • Live price streaming via SSE — prices flash green/red on change with sparkline mini-charts
  • Simulated portfolio — $10,000 virtual cash, instant market order fills, no fees
  • Portfolio visualization — treemap heatmap by P&L weight + portfolio value chart over time
  • AI chat assistant — ask about your portfolio, get analysis, execute trades via natural language
  • Dual market data — built-in simulator (default) or real data via Massive/Polygon.io API

Quick Start

# Copy and configure environment variables
cp .env.example .env
# Add your OpenRouter API key (required for AI chat)

# Build and run
docker run -v finally-data:/app/db -p 8000:8000 --env-file .env finally

# Or use the provided scripts
./scripts/start_mac.sh

Open http://localhost:8000.

Environment Variables

Variable Required Description
OPENROUTER_API_KEY Yes OpenRouter key for LLM chat (uses Cerebras inference)
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)

Stack

Layer Technology
Frontend Next.js (TypeScript, static export), Tailwind CSS, Lightweight Charts
Backend FastAPI (Python), uv, SQLite
AI LiteLLM → OpenRouter → Cerebras (fast inference)
Deployment Single Docker container, port 8000

Architecture

Docker Container (port 8000)
├── FastAPI
│   ├── /api/*           REST endpoints
│   ├── /api/stream/*    SSE price streaming
│   └── /*               Static Next.js frontend
├── SQLite (volume-mounted at db/finally.db)
└── Background tasks: market data (~500ms), portfolio snapshots (30s)

Development

# Backend
cd backend && uv sync && uv run uvicorn app.main:app --reload

# Frontend
cd frontend && npm install && npm run dev

Testing

# Backend unit tests
cd backend && uv run pytest

# E2E tests (requires Docker)
cd test && docker compose -f docker-compose.test.yml up

About

for test app finally

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages