Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "aidin-tools",
"description": "A plugin that reviews code changes and generates a review report.",
"version": "1.0.0",
"author": "Aidin Teymouri",
"license": "MIT",
"owner": {
"name": "Aidin Teymouri",
"email": "aidintv@gmail.com"
},
"plugins": [
{
"name": "independent-reviewer",
"source": "./independent-reviewer",
"author": {
"name": "Aidin Teymouri",
"email": "aidintv@gmail.com"
}
}
]
}
85 changes: 44 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,62 +1,65 @@
# FinAlly — AI Trading Workstation

A visually stunning AI-powered trading workstation that streams live market data, simulates portfolio trading, and integrates an LLM chat assistant that can analyze positions and execute trades via natural language.
FinAlly (Finance Ally) is a Bloomberg-style trading terminal with an AI copilot. It streams live prices, lets you trade a simulated $10,000 portfolio, and includes an LLM chat assistant that can analyze positions and execute trades or manage your watchlist through natural language.

Built entirely by coding agents as a capstone project for an agentic AI coding course.
Built entirely by coding agents as the capstone of an agentic AI coding course.

## Features
## Status

- **Live price streaming** via SSE with green/red flash animations
- **Simulated portfolio** — $10k virtual cash, market orders, instant fills
- **Portfolio visualizations** — heatmap (treemap), P&L chart, positions table
- **AI chat assistant** — analyzes holdings, suggests and auto-executes trades
- **Watchlist management** — track tickers manually or via AI
- **Dark terminal aesthetic** — Bloomberg-inspired, data-dense layout
| Component | State |
| --- | --- |
| Market data (simulator + Massive client, price cache) | Done — `backend/app/market/` |
| Database, trading logic, REST/SSE API, LLM chat | Planned |
| Next.js frontend | Planned |
| Docker packaging, start scripts, E2E tests | Planned |

## Architecture
Full spec: [`planning/PLAN.md`](planning/PLAN.md). Market data design: [`planning/MARKET_DATA_SUMMARY.md`](planning/MARKET_DATA_SUMMARY.md).

Single Docker container serving everything on port 8000:
## Features (target)

- **Frontend**: Next.js (static export) with TypeScript and Tailwind CSS
- **Backend**: FastAPI (Python/uv) with SSE streaming
- **Database**: SQLite with lazy initialization
- **AI**: LiteLLM → OpenRouter (Cerebras inference) with structured outputs
- **Market data**: Built-in GBM simulator (default) or Massive API (optional)
- Live watchlist with price flashes and sparklines
- Market-order trading, fractional shares, no fees
- Portfolio heatmap, positions table, P&L chart
- AI chat that auto-executes trades and watchlist changes
- Single container, single port, no login

## Quick Start
## Architecture

```bash
# Clone and configure
cp .env.example .env
# Add your OPENROUTER_API_KEY to .env
- **Backend:** FastAPI (Python, `uv`), SQLite, Server-Sent Events
- **Frontend:** Next.js (TypeScript), static export served by FastAPI
- **AI:** LiteLLM → OpenRouter (Cerebras) with structured outputs
- **Market data:** built-in simulator by default; real data via the Massive API if a key is set

# Run with Docker
docker build -t finally .
docker run -v finally-data:/app/db -p 8000:8000 --env-file .env finally
## Quick start (once complete)

# Open http://localhost:8000
```bash
cp .env.example .env # add OPENROUTER_API_KEY for chat
docker compose up -d # open http://localhost:8000
docker compose down # stop; data persists (`down -v` resets it)
```

## Environment Variables
The app starts without a `.env`; only chat is disabled.

| Variable | Required | Description |
|---|---|---|
| `OPENROUTER_API_KEY` | Yes | OpenRouter API key for AI chat |
| `MASSIVE_API_KEY` | No | Massive (Polygon.io) key for real market data; omit to use simulator |
| `LLM_MOCK` | No | Set `true` for deterministic mock LLM responses (testing) |
## Configuration

## Project Structure
| Variable | Purpose |
| --- | --- |
| `OPENROUTER_API_KEY` | Enables AI chat |
| `MASSIVE_API_KEY` | Optional. Real market data instead of the simulator |
| `LLM_MOCK` | `true` for deterministic mock LLM replies (testing) |
| `DB_PATH` | SQLite file location |

```
finally/
├── frontend/ # Next.js static export
├── backend/ # FastAPI uv project
├── planning/ # Project documentation and agent contracts
├── test/ # Playwright E2E tests
├── db/ # SQLite volume mount (runtime)
└── scripts/ # Start/stop helpers
On the Massive free tier (5 calls/min) prices update every 15 seconds, so the UI looks fairly static. The simulator is recommended for most users.

## Development

```bash
cd backend
uv sync
uv run market_data_demo.py # market data demo
uv run pytest
```

## License

See [LICENSE](LICENSE).
See [`LICENSE`](LICENSE).
11 changes: 11 additions & 0 deletions independent-reviewer/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "independent-reviewer",
"description": "A plugin that reviews code changes and generates a review report.",
"version": "1.0.0",
"author": {
"name": "Aidin Teymouri",
"email": "aidintv@gmail.com"
},
"license": "MIT",
"keywords": ["code review", "automation", "plugin"]
}
15 changes: 15 additions & 0 deletions independent-reviewer/hooks/hooks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"hooks": {
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "codex exec \"Review changes since last commit and write results to a file named planning/REVIEW.md\"",
"timeout": 120
}
]
}
]
}
}
Loading