This document outlines the design principles, architecture, and key components for the CryptoWildfire frontend, aiming for a professional, performant, and user-friendly experience suitable for crypto analysis and trading.
- Navigation ("1-Click Depth"): Users should reach any core feature in 3 clicks or less. Prioritize clear Information Architecture (IA).
- Visual Hierarchy ("3-Second Scan"): Critical data must be immediately glanceable. Use visual weight (size, color, placement) effectively.
- Performance ("60FPS or Bust"): Smooth interactions, especially charting, are paramount. Optimize rendering, data fetching, and state management.
- Error Handling ("Proactive Paranoia"): Anticipate user errors and API failures. Provide clear feedback and validation.
- Dark Mode ("Midnight Trader's Paradise"): Offer a first-class, aesthetically pleasing, and eye-strain-reducing dark theme.
- Onboarding ("5-Second Rule"): Get users to value quickly. Minimize friction and provide contextual help.
- Consistency ("Design System Bible"): Maintain visual and interactive consistency through a documented component library and design tokens.
- Mobile ("Thumb Zone Theology"): Ensure a seamless and ergonomic experience on mobile devices, prioritizing key actions within thumb reach.
- Actionable Analytics ("No Data Puking"): Every piece of data presented should lead to potential insight or action. Context is key.
- Unified Dashboard: Single main view integrating key modules.
- Collapsible Side Navigation: Max 5-7 core sections (e.g., Dashboard, Charts, Predictions, Alerts, Settings). Icons + text labels when expanded, icons only when collapsed.
- Floating Action Button (FAB): For primary actions like "New Analysis" or "Create Alert".
- Breadcrumbs: Show user location within the app, potentially with quick-jump dropdowns.
<CryptoPulseHeader>: Displays hero metrics (BTC Price, Fear/Greed, Top Performer) prominently above the fold.<StrategySandbox>: Interactive module combining live charts, risk sliders, indicator configuration.<NewsTicker>: Compact display for latest news headlines with integrated sentiment scores.<AssetDossier>: Detailed panel showing technical scores, sentiment scores, multi-timeframe analysis, and prediction DNA for a selected asset.<PredictionWizard>: Step-by-step interface for configuring and generating ML predictions.<PredictionXAI>: Component for explaining prediction reasoning (e.g., feature importance, counterfactuals).<GlassBoxAlerts>: Real-time display area for triggered alerts (pattern detection, sentiment shifts, risk thresholds).<SmartChart>: Enhanced charting component with annotations (predictions, news events) and interactive elements (hover effects triggering strategy wizards).
- Primary Library:
Lightweight Charts(TradingView) or similar WebGL-powered library for high performance. - Features:
- Multiple chart types (Candlestick, Line, Area).
- Drawing tools (Trendlines, Fibonacci, Pitchforks, Annotations).
- Standard technical indicators (RSI, MACD, Volume, Bollinger Bands, EMAs).
- Custom Overlays (ML Predictions, Buy/Sell Zones).
- Pattern Recognition (Auto-detection visualization).
- Multiple Layouts (Standard, Advanced, Algorithmic).
- Library: Zustand or Redux Toolkit (with RTK Query for data fetching/caching).
- Strategy: Keep global state minimal. Leverage component state and context where appropriate. Use server-state management for API data.
- Method: CSS Modules or Tailwind CSS (or Styled Components/Emotion if preferred).
- Design Tokens: Centralized definitions for colors, typography, spacing, etc.
- Dark Mode: True black (
#000000) base,#121212surfaces, dynamic chart themes, green/red accents.
- Code Splitting: Route-based and component-based splitting.
- Virtualization: For long lists (transaction history, alerts).
- Memoization:
React.memo,useMemo,useCallback. - Web Workers: Offload heavy computations (e.g., complex indicator calculations).
- WASM: Consider for ultra-performance-critical calculations if needed.
- Image Optimization: Modern formats (WebP, AVIF), lazy loading.
- Bundle Analysis: Regularly analyze bundle size and composition.
- Forms: Real-time inline validation with clear error messages.
- API Errors: Graceful handling using Error Boundaries, user-friendly messages, retry mechanisms.
- Logging: Frontend error logging service (e.g., Sentry).
- Unit Tests: Jest + React Testing Library for components and utility functions.
- Integration Tests: React Testing Library, potentially MSW (Mock Service Worker) for API mocking.
- E2E Tests: Cypress or Playwright for critical user flows.
- Visual Regression Tests: Storybook + Chromatic or similar tools.
- Framework/Library: React + Vite
- Language: TypeScript
- Charting: Lightweight Charts / TradingView Charting Library
- State Management: Zustand / Redux Toolkit (RTK Query)
- Styling: Tailwind CSS / CSS Modules
- Animation: Framer Motion / React Spring
- Testing: Jest, React Testing Library, Cypress/Playwright
- Component Library/Docs: Storybook
- Setup: Initialize project with Vite, TypeScript, React, chosen styling solution.
- Core Layout: Implement main layout with collapsible sidebar navigation.
- Charting Integration: Integrate basic Lightweight Chart component.
- Dashboard Structure: Build basic dashboard page structure.
- API Service: Set up basic API service layer (e.g., using RTK Query).