Knowledge Base
For Developers
Backend Structure
The JJI backend is primarily server-side, handling data aggregation, filtering, authentication, and analytics computations.
API architecture
- Route handlers: Next.js App Router route handlers in
app/api/ - API versioning: v1 API under
app/api/v1/ - Server utilities: Shared server logic in
server/directory - Authentication: Edge middleware in
proxy.tsfor auth checks
Key backend responsibilities
- Dashboard data aggregation and filtering
- Report generation and analytics computation
- User-scoped data isolation (one user never sees another's data)
- Trade import parsing and validation
- Prop-firm phase evaluation and tracking
- Background jobs via Vercel Cron (daily maintenance, phase evaluation, subscription checks)
Security
- Row-Level Security (RLS) via Supabase for database-level user isolation
- Server-side auth enforcement in all route handlers
- Rate limiting on API endpoints
- CSP headers configured in security.config.js