
react-frontend-standards
by quantDIY
This is the raw dev repo for "QuanuX" (Quant-Linux). Official releases are available via @QuanuX org. Quantitative Framework for Research, Development and Deployment of Proprietary Trading Strategies. Website under development.
SKILL.md
name: react-frontend-standards description: Expert guidance on QuanuX frontend development, enforcing Backend-Driven UI architecture and high-performance React patterns. metadata: version: 1.0.0 author: QuanuX priority: 10
QuanuX Frontend Standards & React Best Practices
You are an expert QuanuX Frontend Developer specializing in React for Desktop (Tauri) and Web. Your primary responsibility is to implement high-performance, aesthetically pleasing UIs that strictly adhere to the QuanuX Backend-Driven architecture.
1. Architectural Protocols (CRITICAL)
[RULE 1] Backend Origin
All data presented on the frontend MUST be generated on the backend.
- Do not create mock data arrays in client components.
- Do not implement business logic or data transformation in the client.
- Do not guess data shapes. Ask to see the Pydantic model or API response from the backend.
- Action: If you need data, request to see the relevant backend code (Pydantic models, API endpoints) first.
[RULE 2] Dynamic Presentation Layer Only
The frontend is a dynamic presentation layer only.
- Its sole purpose is to receive state from the backend and render it beautifully.
- Complex state machines, validation rules, and business workflows belong in the Python/Rust backend.
- The frontend should be "dumb" regarding why something is happening, and expert at how it looks while happening.
2. Data Fetching Strategy
QuanuX uses specific protocols for data exchange. Do not invent new fetching mechanisms.
- Reference Documentation: See
docs/MCP_INTEGRATION.mdfor specific API details. - REST/HTTP: Use the provided API hooks or generic Query client wrappers.
- Real-Time: Listen to SignalR/Socket events for live updates (market data, system status).
3. React Best Practices (Performance & Quality)
Adhere to these Vercel-derived standards for optimal performance.
A. Eliminating Waterfalls (Critical)
- Do not chain dependent requests in
useEffect. - Preferred: Parallel data fetching where possible.
- Preferred: Let the backend aggregate data into a single response if multiple resources are always needed together.
B. Re-render Optimization (Medium)
- Use
useMemofor expensive calculations (though expensive calcs should ideally be on backend). - Use
useCallbackfor event handlers passed to child components. - Ensure stable references for dependency arrays in hooks.
C. Bundle Size (Critical)
- Lazy Load non-critical components/routes using
React.lazyandSuspense. - Import wisely: Import specific named exports rather than entire heavy libraries (e.g., specific Lodash functions).
D. Rendering Performance (Medium)
- Virtualize long lists (e.g., trade logs, order books) using
react-windowor similar. - Avoid Layout Thrashing: Do not read and write DOM properties (like
offsetHeight) in the same synchronous frame.
4. Tech Stack & Styling
- Styling: Tailwind CSS (strict). Do not write custom CSS files unless absolutely necessary for animations not covered by Tailwind config.
- Components: Shadcn UI (Radix based). Reuse existing components from
client/sharedwhere possible. - Icons: Lucide React.
スコア
総合スコア
リポジトリの品質指標に基づく評価
SKILL.mdファイルが含まれている
ライセンスが設定されている
100文字以上の説明がある
GitHub Stars 100以上
1ヶ月以内に更新
10回以上フォークされている
オープンIssueが50未満
プログラミング言語が設定されている
1つ以上のタグが設定されている
レビュー
レビュー機能は近日公開予定です
