Skip to main content

Funded Futures Family — full system flow

The risk/compliance dashboard is one corner of a larger platform spread across four repositories. This page draws the whole path a request takes — browser to database and back — and gives a module-by-module reference for every service involved.

RepoRoleDeploys as
fff-risk-webNext.js staff UI + BFF — seefff-risk-web overview and User flowfrontend
fff-risk-apiDjango views/permissions/RBAC layer for the risk dashboardBACKEND_SCOPE = risk_dash
FFF-BackendCore trading-platform Django backend — owns the actual models (users, accounts, payouts, security flags)BACKEND_SCOPE = fff_backend
fff_be_automation (referenced, not explored in this pass)Celery worker that executes background jobs dispatched by the other twoworker

The relationship between the two Django services is closer than a typical microservice boundary: fff-risk-api imports Python modules directly from the FFF-Backend package (RBAC permission definitions, payout-transition logic, KYC config) and both operate against the same PostgreSQL database — they're two settings-scoped deployments of a shared codebase family, not independent systems that only talk over HTTP.

System map​

One request, start to finish​

Login through to a gated data fetch and an async compliance check — the same mechanism every feature in the dashboard reuses.

Module reference — fff-risk-web (frontend / BFF)​

Covered in full in fff-risk-web architecture docs; summarized here for continuity.

LayerModulesRole
Pages & feature UIpages/**, modules/dashboard/pages/**Route shells →use<Feature> hooks + <Feature>UI> components
Data fetchingapi/hooks/** (React Query)~280 hooks across auth, dashboard, security flags, exceptions, policy center, compliance cases
BFF proxypages/api/**, lib/functions/commonApiHandler.ts, bffAuth.tsDecrypts the Knox token cookie, forwards tofff-risk-api, normalizes responses
Auth/sessionmodules/auth/SessionContextProvider.tsxPollsGET auth/session-context/, exposes live capability checks app-wide
Stateredux-toolkit/** (encrypted persist), React Query cacheSmall persisted UI/bootstrap state vs. all server data

Module reference — fff-risk-api (BACKEND_SCOPE=risk_dash)​

Thin views/permissions layer; most models.py files here are empty — it operates on models imported from FFF-Backend.

AppMounted atOwns / exposesPurpose
risk_dash/risk-dash/~360 routes: orders, traders, customers, products, dashboard KPIs, payouts, exposure/hedging reports, security-flags (run checks, enforcement, notices, IP lookups), policy center, exception center, compliance cases, ip-ingestion webhooksThe dashboard's own API surface — nearly every hook inapi/hooks/dashboard/* in the frontend maps to a route here
user_management/auth/login-v2, login-v2-verify, session-context/, generate-otp, logout, profileAuth entry point;session_authorization_service.py builds the capabilities map the frontend polls; scoped_token_service.py issues one Knox token per user per scope
rbac_manage(routes defined, not wired into core/urls.py)admin/role/permission CRUD viewsDormant in this snapshot — likely superseded by the sharedFFF-Backend.rbac_manage app
utils (not an installed app)—permissions.py, risk_dashboard_permissions.py, endpoint catalog, strict-matrix registrySection-based capability primitives (HasRiskDashboardAccess, CanView*/CanManage*) every view's permission_classes are built from

RBAC response shape (GET /auth/session-context/) — this is exactly what SessionContextProvider on the frontend consumes: user, roles, permissions (risk_dashboard.* names), capabilities (flat {key: bool} map, _view/_manage pairs per section), permission_version (a hash the frontend uses to invalidate caches), rbac_mode (empty|audit|compat|strict).

Module reference — FFF-Backend (BACKEND_SCOPE=fff_backend)​

The platform of record. 15 registered Django apps.

AppMounted atKey modelsPurpose
user_managementauth/FFFAuthUser, BrokerAccountInfo, CustomAuthToken (Knox), SessionScopeIdentity + trading-account graph; the apprisk_dash depends on most directly
account_managementaccount/Broker, BrokerCountryRule, AccountTypeBroker/account admin & lifecycle (ban/unban, autoscale, sync)
ecommerce_appshop/Product, Coupon, Subscription, CartCheckoutOrder, OrdersEvaluation/funded-account purchase funnel
payout_managepayout/TraderPayoutRequest, TraderPayoutActivityLog, PayoutRuleVersionShared payout transition logic — used by both the trader-facing submit flow here and the risk-dashboard's admin approve/deny UI
dashboard_managedashboard/SecurityFlag (+ large related family), Fill/PositionInterval/ExposureInterval, HedgeGroup/HedgeViolationLargest app — realtime trade ingestion and the compliance/security-flag engine thatrisk_dash is built on top of
rbac_managerbac-manage/Permissions, Role, UserRolesAuthoritative role/permission store; owns therisk_dashboard.* permission namespace fff-risk-api imports
rise_managerise-manage/RiseIdOfusers, PaymentIntentForRiseRise payout/KYC processor integration
kyc_managekyc/KycProviderSession, UserKycAttemptDidit KYC verification
plaid_manage—PlaidKYCPlaid identity verification (parallel to Didit)
affiliate_managementaffiliate-manage/AffiliateUserProfile, AffiliateCommissionAffiliate program
activity_log_manageactivities/ActivityLog, SchedulerLog, ExternalAPILogAudit trail + scheduler/automation logs
automation_control(service-only, no urls.py)Automation, AutomationPipeline*Advisory locking + manual-run tracking for jobsfff_be_automation executes
commoncommon/RuntimeControl, AppNotification, Decision* rule engineFeature flags — includingrisk-dash-features/, the endpoint useRiskDashFeatures on the frontend polls
live_ops_manage(service-only)LiveAccountManagerRecord, LivePayoutRequestFunded → live trading account pipeline
disputifierdisputifier/Dispute, PayarcWebhookEventChargeback/dispute management

Shared infrastructure & external providers​

SystemUsed for
PostgreSQLSingle database both Django deployments read/write
RedisShared cache (fff_risk_api key prefix) + Celery broker
fff_be_automationCelery worker executing async jobsrisk_dash dispatches by task name (security-flag checks, payout side effects)
Tradovate / WealthChartsBroker trading-account data and session sync
RisePayout disbursement + KYC invites
Didit / PlaidTwo parallel KYC/identity-verification providers
IPQualityScoreIP reputation / VPN / proxy scoring for the security-flags engine
Twilio / VonageSMS OTP delivery for 2FA
Worthy / 365 / PayPalPayment processing for the e-commerce funnel
Disputifier / PayarcChargeback handling

Things worth knowing before touching this system​

  • Not independent services. fff-risk-api imports Python modules straight from FFF-Backend (RBAC aliases, payout-transition logic, KYC config) and shares its database — changes to FFF-Backend models can break fff-risk-api without a network call ever failing.
  • One deployment flag separates the two backends. BACKEND_SCOPE (fff_backend vs. risk_dash) is checked throughout both codebases to decide which product's rules apply — notification routing, session scoping, RBAC product-scope checks.
  • Auth sessions are scoped, not shared. scoped_token_service issues a separate Knox token per (user, BACKEND_SCOPE), and only one is active at a time per scope — logging into the risk dashboard doesn't reuse a trading-platform session or vice versa.
  • RBAC has one owner. Permissions/Role/UserRoles live only in FFF-Backend.rbac_manage; fff-risk-api's own rbac_manage app has its routes unwired and appears dormant.
  • Async work has no consumer in fff-risk-api. It only ever calls celery.send_task() by name onto a shared Redis broker — the actual execution (and any retry/failure handling) happens in fff_be_automation, a fourth repository this pass didn't open.