How vinistan/tradeapp works
RFlekts is a leader–follower copy-trading platform. A leader connects a brokerage account; followers browse leaders, subscribe with sizing and risk settings, and connect execution accounts. Stream workers detect leader fills and invoke fanout, which checks eligibility and safety constraints, records durable order intent, and submits through broker adapters when the two-key execution gate is open. The graph also includes account, administration, and performance surfaces. Some API and worker internals were not sampled; dashed links mark unverified integration points, while documented product flows are cited to the README.
Main entry points: fanout.py Fill fanout · main.py HTTP application · page.tsx Account connections · leaders.py Leader subscriptions
Components 24
User experience
- Trading interface
apps/web-trade-frontend/src/app/leaders/useLeadersCatalog.ts - Account connections
apps/web-trade-frontend/src/app/accounts/page.tsx - Follower dashboard
apps/web-trade-frontend/src/app/dashboard/useDashboard.ts - Sign-in flow
apps/web-trade-frontend/src/app/sign-in/useSignIn.ts
Application services
- HTTP application
apps/web-trade/maxmar/web_trade/app/main.py - Leader subscriptions
apps/web-trade/maxmar/web_trade/app/api/leaders.py - Broker accounts API
apps/web-trade/maxmar/web_trade/app/api/accounts.py - Execution controls
apps/web-trade/maxmar/web_trade/app/api/trading_controls.py - JWT authentication
packages/auth/maxmar_auth/deps.py
Copy execution
- Tradier stream
apps/workers/tradier-stream/maxmar/workers/tradier_stream/main.py - SnapTrade poller
apps/workers/snaptrade-stream/maxmar/workers/snaptrade_stream/poller.py - Webull stream
apps/workers/webull-stream/maxmar/workers/webull_stream/main.py - Fill fanout
packages/copytrade/maxmar_copytrade/fanout.py - Risk constraints
packages/copytrade/maxmar_copytrade/constraints.py - Position ledger
packages/copytrade/maxmar_copytrade/ledger.py - Broker adapters
packages/brokers/maxmar_brokers/base.py
Platform state
- Trading database
packages/db/maxmar_db/models/copy_trader/mirrored_fill.py - Leader profiles
packages/db/maxmar_db/models/copy_trader/leader_profile.py - Subscriptions
packages/db/maxmar_db/models/copy_trader/leader_subscription.py - User accounts
packages/db/maxmar_db/models/accounts/user.py - Auto-execution gate
packages/db/maxmar_db/execution_policy.py
Other components
- Follower
- Leader
- Brokerage services
Connections 27
- Follower → Trading interface: browses leaders
- Follower → Account connections: connects accounts
- Leader → Account connections: connects brokerage
- Follower → Sign-in flow: signs in
- Trading interface → Leader subscriptions: loads catalog
- Account connections → Broker accounts API: links broker
- Follower dashboard → HTTP application: requests dashboard
- Sign-in flow → HTTP application: authenticates
- HTTP application → Leader subscriptions: routes requests
apps/web-trade/maxmar/web_trade/app/main.py - HTTP application → Broker accounts API: routes requests
apps/web-trade/maxmar/web_trade/app/main.py - HTTP application → Execution controls: routes controls
apps/web-trade/maxmar/web_trade/app/main.py - Leader subscriptions → Subscriptions: manages subscriptions
- Broker accounts API → User accounts: manages accounts
- HTTP application → JWT authentication: authenticates requests
- Tradier stream → Fill fanout: dispatches fills
apps/workers/tradier-stream/maxmar/workers/tradier_stream/main.py - SnapTrade poller → Fill fanout: dispatches fills
- Webull stream → Fill fanout: dispatches fills
apps/workers/webull-stream/maxmar/workers/webull_stream/main.py - Fill fanout → Risk constraints: checks limits
packages/copytrade/maxmar_copytrade/fanout.py - Fill fanout → Position ledger: loads positions
packages/copytrade/maxmar_copytrade/fanout.py - Fill fanout → Trading database: records outcomes
packages/copytrade/maxmar_copytrade/fanout.py - Fill fanout → Broker adapters: submits orders
packages/copytrade/maxmar_copytrade/fanout.py - Broker adapters → Brokerage services: places orders
- Fill fanout → Auto-execution gate: checks execution gate
packages/copytrade/maxmar_copytrade/fanout.py - Execution controls → Auto-execution gate: attests execution
- Tradier stream → Leader profiles: discovers leaders
apps/workers/tradier-stream/maxmar/workers/tradier_stream/main.py - Fill fanout → Leader profiles: loads leader
packages/copytrade/maxmar_copytrade/fanout.py - Fill fanout → Subscriptions: selects followers
packages/copytrade/maxmar_copytrade/fanout.py