StrangeXin/propguard-ai

AI-powered Prop Firm risk management + signal intelligence

★ 0Forks 0PythonGitHub ↗Compare

Project website ↗

README

PropGuard AI

AI-powered risk management for Prop Firm traders.

PropGuard AI monitors trading accounts against Prop Firm compliance rules, scores trading signals with AI, and helps traders size positions before a rule breach becomes expensive.

Live Demo

Features

  • Real-time compliance checks for Prop Firm rules
  • FTMO, TopStep, and CryptoFundTrader rule packs
  • WebSocket streaming with HTTP polling fallback
  • MT5 account monitoring through MetaApi
  • TradingView signal parsing and AI scoring
  • Position sizing calculator
  • Telegram alerts
  • Supabase-backed auth, billing, alerts, and trade history
  • English and Chinese UI

Tech Stack

  • Frontend: Next.js 16, TypeScript, shadcn/ui, KlineCharts
  • Backend: FastAPI, Uvicorn, Pydantic
  • Database: Supabase PostgreSQL
  • Integrations: MetaApi, Anthropic, OKX, Twelve Data, Telegram, Stripe
  • Deploy: Vercel frontend, Railway backend

Repository Layout

backend/                 FastAPI app and tests
frontend/                Next.js app
data/prop_firm_rules/    Versioned Prop Firm rule JSON files
supabase/migrations/     Database migrations
scripts/                 Local project scripts

Local Development

Backend

Python 3.12 is recommended.

cd backend
cp .env.example .env
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python -m uvicorn app.main:app --port 8001

Frontend

cd frontend
cp .env.example .env.local
npm install
npm run dev -- --port 3001

Open http://localhost:3001.

Tests

cd backend
python -m pytest tests/ -v

cd frontend
npm run lint

Environment Variables

Use the example files as templates:

  • Backend: backend/.env.example
  • Frontend: frontend/.env.example

Do not commit real .env files or production secrets. The deployed app expects variables to be configured in Railway and Vercel.

Set a stable JWT_SECRET in production. If it is omitted, the backend generates a temporary in-memory secret on startup, which invalidates sessions on every restart.

Prop Firm Rules

Rule files live in data/prop_firm_rules/. Rule data should match official Prop Firm documentation exactly. When updating rules:

  • Verify against the Prop Firm's official source.
  • Include source URLs in the JSON.
  • Update the effective_date.
  • Prefer conservative calculations when exact official calculations cannot be reproduced locally.

Database Migrations

./scripts/db-migrate.sh new "description_here"
export SUPABASE_ACCESS_TOKEN=<token>
./scripts/db-migrate.sh push
./scripts/db-migrate.sh status

Security

This project is read-only for compliance monitoring. It does not execute trades on behalf of users for compliance enforcement. The trading panel uses broker APIs separately and should be deployed only with carefully scoped credentials.

Please report security issues privately. See SECURITY.md.

License

MIT. See LICENSE.

Contributors

StrangeXin

Issues